473,471 Members | 1,713 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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

does anyone know why the folllowing prints to the screen?

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

Xah
xa*@xahlee.org
∑ http://xahlee.org/

Sep 4 '05 #1
7 2203
Xah Lee wrote:
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
rk***@ucsd.edu

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

Sep 4 '05 #2
Xah Lee wrote:
does anyone know why the folllowing prints to the screen?

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

Xah
xa*@xahlee.org
∑ 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
--
Steve Holden +44 150 684 7255 +1 800 494 3119
Holden Web LLC http://www.holdenweb.com/

Sep 4 '05 #3
Steve Holden wrote:
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
xa*@xahlee.org
∑ http://xahlee.org/

Sep 4 '05 #4
Xah Lee wrote:
Steve Holden wrote:
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?

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
--
Steve Holden +44 150 684 7255 +1 800 494 3119
Holden Web LLC http://www.holdenweb.com/

Sep 4 '05 #5
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
xa*@xahlee.org
∑ http://xahlee.org/

Steve Holden wrote:
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".


Sep 4 '05 #6
On 2005-09-04, Xah Lee <xa*@xahlee.org> wrote:
Steve Holden wrote:
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?


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

--
Grant Edwards grante Yow! BELA LUGOSI is my
at co-pilot...
visi.com
Sep 6 '05 #7
Xah Lee wrote:
does anyone know why the folllowing prints to the screen?
# python
import os
os.system(r"ls")
Steve Holden wrote: 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
xa*@xahlee.org
∑ http://xahlee.org/

Sep 7 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: opt_inf_env | last post by:
Hallo, I want to see from php-file list of files which are in directory, where is the given php-file. To do so, I put in the php-file the following line: <?php $sys = system("ls") ?> Then...
4
by: Jochen Demuth | last post by:
Hi, I am trying to install ZWiki on Zope 2.5.1 / Debian 2.4.20-bf2.4-xfs. First I copied the contents of the ZWiki-0.32.0.tgz to the Products-directory under SOFTWARE_HOME: This is what it...
5
by: Didier C | last post by:
Hi! I was wondering if we can pass some arguments to system("cmdline")? E.g in Perl, we can do something like: $dir="/home/cypher"; system("ls $dir"); which would instruct Perl to do an...
6
by: Matt Adams | last post by:
I want define for a couple of words inside a longer text with different font specifications. I declared it like: ....text before.... <FONT class=aaa> these text should get other attributes...
1
by: apsonline | last post by:
hi people i want to work on a project that would "emulate" unix commands like ls,rm etc... by making use of uunix system calls . by writing programs in c++ using system calls ,these programs...
4
by: marsarden | last post by:
code below: #include <stdio.h> int main(void) { char *aaa={"a","b","c"}; printf("%S\n",*aaa); /*the uppercase character S*/ getchar();
2
by: ramasubramanian.rahul | last post by:
i am trying to implement the unix command ls -l | wc -l in c...( using pipes and excev) its not working.... can anyone help me here ??? thanks in advance rahul #include<stdio.h> 2 #include...
3
by: =?iso-8859-1?q?KLEIN_St=E9phane?= | last post by:
Hi, for example, in http://svn.zope.org/zc.buildout/trunk/src/zc/buildout/ tests.py?rev=89831&view=auto test file, there is this doctests : def develop_verbose(): """ We should be able to...
0
by: Terry Reedy | last post by:
KLEIN Stéphane wrote: 'ls' is the unix abbreviation for the shell command 'list files (in a directory)'. The name is used above for a similar Python function. It presumably was imported...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.