Should I close after popen??

Andrew Markebo flognat at flognat.myip.org
Thu Mar 15 23:09:01 CET 2001


I am hacking away a small background program, using popen to call
commands, should I close the file in some way when done or it is taken
care of automagically??

I do something like this once every 10 mins..

        fd1=os.popen("command")
        fd2=os.popen("command")
        os.wait(fd1)
        os.wait(fd2)
        values=fd1.read()+fd2.read()

And.. anything to worry about, nesting popen/wait like this??
(Linux/Solaris)

        /Andy



More information about the Python-list mailing list