kent <fuzzba...@comcast.net> added the comment:

I tried using subprocess.Popen and subprocess.call, both of which did the same 
behavior. Under the interpreter I get the desired string output:
>>> subprocess.call('ls')
bin      Documents  eclipse  local  Pictures   tmp     workspace
Desktop  Downloads  hamlib   Music  Templates  Videos
0

Under Idle:

>>> subprocess.call('ls')
0
Thus the subprocess.call method provides the string output.  Why should I have 
to use the subprocess.check_output('command').decode() when subprocess.call() 
gives me what I want?

Thus it does not seem to be an os.system issue, but a failure of Idle to 
capture the sysoutput string as the interpreter does  The xterminal example 
highlights this.  The sysoutput is echoed at the xterminal not in idle.

You are correct there are other ways to get the specific information for ls.  I 
was using that as test command.  I was experimenting with the commands in order 
to a write a program which will run an executable under either windows or 
linux.  I wanted to see the output in the interpreter in order to test it.  I 
was using Idle for the testing.  It does NOT work the same as the interpreter.  
If Idle is to be useful as an IDE, shouldn't it's shell work the same as the 
interpreter? If it doesn't why use Idle ?

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue11820>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to