os.system(r"ls") prints to screen??

R

Robert Kern

Xah said:
does anyone know why the folllowing prints to the screen?

# python
import os
os.system(r"ls")

os.system() starts a shell and has the shell execute the program as a
separate process. If you want to get the output of the given program,
then use the subprocess module.

--
Robert Kern
(e-mail address removed)

"In the fields of hell where the grass grows high
Are the graves of dreams allowed to die."
-- Richard Harter
 
S

Steve Holden

Xah said:
does anyone know why the folllowing prints to the screen?

# python
import os
os.system(r"ls")

Xah
(e-mail address removed)
∑ http://xahlee.org/
It only prints to the screen when standard output of the invoking
process is the screen. The sub-process forked by os.system inherits
stdin stdout and stderr from the invoking process.

This is all pretty basic stuff. Perhaps you should stop your verbal
assault on the computer science community and start to learn the
principles of what you are doing.

regards
Steve
 
X

Xah Lee

Steve said:
This is all pretty basic stuff. Perhaps you should stop your verbal
assault on the computer science community and start to learn the
principles of what you are doing.

is this a supressed behavior that a human animal can finally
instinctively and justifiably release at another in a group frenzy?

Xah
(e-mail address removed)
∑ http://xahlee.org/
 
S

Steve Holden

Xah said:
is this a supressed behavior that a human animal can finally
instinctively and justifiably release at another in a group frenzy?
Seems to me that you'd know more about frenzy than me. Having read many
of your posts it seems to me that they are deliberately calculated to
inflame the reader.

To be successfully so critical of others you need to demonstrate
superior knowledge and judgment, which your original question revealed
to be lacking.

To put it another way: "People who live in glass houses shouldn't throw
stones".

regards
Steve
 
X

Xah Lee

do you know what the Muses do when a mortal challenged them?

And, please tell me exactly what capacity you hold under the official
Python organization so that i can calculate to what degree i can kiss
your ass or feign mum of your ignorance.

Xah
(e-mail address removed)
∑ http://xahlee.org/
 
G

Grant Edwards

is this a supressed behavior that a human animal can finally
instinctively and justifiably release at another in a group
frenzy?

Wow. As Kelly Bundy would say: "The mind wobbles."
 
X

Xah Lee

Xah said:
does anyone know why the folllowing prints to the screen?
# python
import os
os.system(r"ls")

Steve said:
It only prints to the screen when standard output of the invoking
process is the screen. The sub-process forked by os.system inherits
stdin stdout and stderr from the invoking process.

Thanks.

Xah
(e-mail address removed)
∑ http://xahlee.org/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,228
Members
46,818
Latest member
SapanaCarpetStudio

Latest Threads

Top