How to code such that the program does not wait for execution of a command?
Hi. I am trying a code:
exec python_path python_file.py;
puts 1;
So the problem is that 1 is not printed till the execution of the python file is completed. I want the code to proceed even if the python file is still running.
Does anyone know how to solve the problem?
Regards,
Rachit
Best Answer
-
I think what you are looking for is just to add an & to the end. Like this:
exec python_path python_file.py &;
0
Answers
-
Hi, Rachit Semalty
The following commands may help you
package require Thread
set thread_id [thread::create {exec python_path python_file.py}]puts 1
1 -
I think what you are looking for is just to add an & to the end. Like this:
exec python_path python_file.py &;
0 -
Nagahashi Kouta said:
Hi, Rachit Semalty
The following commands may help you
package require Thread
set thread_id [thread::create {exec python_path python_file.py}]puts 1
Thanks, Nagahashi for your reply. It was helpful. I was hoping to do it without creating a thread but it is also a good solution.
Regards,
Rachit
0 -
Ben Buchanan said:
I think what you are looking for is just to add an & to the end. Like this:
exec python_path python_file.py &;
Hi Ben. Thanks for your reply. Your solution worked for me.
Regards,
Rachit
0