Re: os.popen vs os.system
- From: Peter Hansen <peter@xxxxxxxxxxx>
- Date: Tue, 17 May 2005 14:25:12 -0400
rbt wrote:
Is it more appropriate to use os.popen or os.system on a windows XP client? I'm calling the operting system's shutdown function like this:
restart = os.popen(shutdown -r -f) print restart.read() restart.close()
I don't think there's any significant difference between the above (assuming you add in the missing quotation marks) and os.system('shutdown -r -f'), except that the os.system() approach is shorter and more readable if you are simply discarding or printing the output like that.
> If it matters, I'm doing this remotely over sockets.
You can't be doing exactly that, since there are no sockets involved... do you mean the above call is executed -- on the receiving end -- after some signal is received via a socket in another part of the code? That's not going to have any effect on things...
-Peter .
- Follow-Ups:
- Re: os.popen vs os.system
- From: rbt
- Re: os.popen vs os.system
- From: rbt
- Re: os.popen vs os.system
- From: rbt
- Re: os.popen vs os.system
- References:
- os.popen vs os.system
- From: rbt
- os.popen vs os.system
- Prev by Date: Re: Windows distribution suggestions?
- Next by Date: Re: os.popen vs os.system
- Previous by thread: os.popen vs os.system
- Next by thread: Re: os.popen vs os.system
- Index(es):
Relevant Pages
|