os.system question
Hi All,
I am porting Perl script to Python script. Everything works fines until
calling os.system().
In my script, a number of DOS-commands will be executed.
for new_folder, old_folder in folder_array:
os.system('MD "' + new_folder + '"');
os.system('XCOPY "' + old_folder + '" "' + new_folder + '"');
In Perl, all outputs will be printed in console directly.
But in Python, outputs will be printed in separated cmd-windows.
Is it possible to prevent so many cmd-windows to be opened and let all
output be printed direct in Python shell?
best regards ^^)
--
___
oo // \\
(_,\/ \_/ \ Xu, Qian
\ \_/_\_/> stanleyxu2005
/_/ \_\
.
Relevant Pages
- Re: os.system question
... I am porting Perl script to Python script. ... But in Python, outputs will be printed in separated cmd-windows. ... (comp.lang.python) - Re: perl to python
... sed and perl can let you do all that quick command line stuff. ... into a full blown script. ... scripts, call it from the python interpreter, whatever I need. ... If I stick to the traditional unix approach, ... (comp.lang.python) - Re: Learning Tkinter
... and how the command option is used to call the function callback. ... gui programming to see if the python programs I have written can be made ... search their computer for this file, execute the python code and then ... This is the meaning of the test on __name__: this magical variable is set to the string '__main__' if and only if the current script is the top-most one, i.e the one you ran python on. ... (comp.lang.python) - Correct way to handle independent interpreters when embedding in a single-threaded C++ app
... The Python interpreter is ... interpreter and provides an extension module to expose ... manage each script runs in a new interpreter. ... globals that could cause issues. ... (comp.lang.python) - Re: bash vs. python scripts - which one is better?
... Quick, take your one liner, have it traverse an entire directory tree ... For me I just need to change my small script into a function, ... That is where shell falls down. ... alternatives like Python, Perl or Ruby laying around to be used. ... (Debian-User) |
|