Q: python os module popen and tmpfile functions I have two things to ask here.. Please help me with this as i am new to python.
first
 i am unable to figure out the usage of pythons os.popen function...what i know is that it is used to open subprocesses...i tried doing the same..tried to open command prompt on windows 7. the documentation gives the syntax as popen(command, [mode, [bufsize]]) and says "open a pipe to or from command. The return value is an open file object connected to the pipe..."  I did not understand what opening a pipe to a command means or what a pipe means.
also if you could kindly explain what is the purpose of popen2 , popen3 and popen4....
second
i tries this with os.tmpfile function
>>> tmpf=os.tmpfile()
>>> type(tmpf)
<type 'file'>
>>> dir(tmpf)
['__class__', '__delattr__', '__doc__', '__enter__', '__exit__', '__format__', '__getattribute__', '__hash__', '__init__', '__iter__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', 'close', 'closed', 'encoding', 'errors', 'fileno', 'flush', 'isatty', 'mode', 'name', 'newlines', 'next', 'read', 'readinto', 'readline', 'readlines', 'seek', 'softspace', 'tell', 'truncate', 'write', 'writelines', 'xreadlines']

as it says tmpf has a type file
i tried the following



help(file.softspace)



--and--



help(tmpf.softspace)



but to my surprise the output of both help commands was a whole lot different....
may you please explain as to why this behaviour..
eagerly waiting for your help..
thankx in advance  :)

A: help(tmpf.softspace) displays the help of the value of tmpf.softspace - which is int.
help(file.softspace) however displays the help for the softspace attribute - i.e. what it's used for.
