Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
Python
Python and Unix Commands
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Alan Gauld, post: 1838457"] I have a question relating to how Unix commands can be issued There are numerous methods including the commands module that you have already discovered, the os.system() call and the various os.popen/os.execXX calls. Also Python 2.4 has introduced the subprocess module that superceded most of these. Do you actually need to execute the python scripts as scripts, each with its own instance of the intrerpreter? (For testing the answer may well be yes) Or would it be possible to simply execute the script code as a function from within a thread of your main program? commands/os.system/subprocess etc are usually used to launch Unix commands or other executable files, not other Python scripts. It's easier to interact with Python from within Python... If you must do this then I'd suggest you need to launch a separate thread per shell then use commands/subprocess to launch each interpreter/script invocation from within its own thread. [ If you are not interested in the results you could just use the Unix '&' character to execute the processes in the background ] HTH, [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
Python
Python and Unix Commands
Top