os.popen problem

Matthew K Jensen mattjensen at timetospare.net
Sun Aug 29 02:55:51 EDT 2004


Ok, this might seem odd as to why I am doing this in this certain way,
but it's for a very specific purpose, and in so doing needs to be done
this way. I am writing code on a winbloze box like so:

-----------
import os

vlvl = os.popen('copy con randomfilename','w')
vlvl.write('some stuff')
vlvl.write('some more stuff')
vlvl.write(chr(0))
vlvl.close()

-----------

At the next to last line, the command is supposed to complete and give
output which resembles "\t1 file(s) copied.\r\n". Appearantly this is
not happening. The last line just hangs there, doing nothing. Is there
something I am supposed to be doing, or is there some concept that has
either blown over the top of my head or just simply forgot? Any
feedback is helpful.

With respect,

Matt K Jensen



More information about the Python-list mailing list