![]() Subprocess.call("python something.py", shell = True)ĭoes NOT do what I need it to do, nor does: p = subprocess.Popen(". ![]() env.sh except that when one issues the exit command, the rest of the python script. Using subprocess.call("./env.sh", shell = True) opens the shell and stops there. It is important to note env.sh does not terminate until one types exit after running desired commands. When one calls env.sh it sets a whole ton of environment variables and a few other pertinent things and then drops you into a shell to run commands. I understand how to use subprocess.Popen() and subprocess.call() to call things from within the shell that the Python script was called from. Ideally the workflow would go: open new shell -> run some commands -> exit shell -> repeat as necessary.ĮDIT: It seems some clarification is needed. I'm pretty sure I need to use subprocess, but I'm not exactly sure how to go about it. Each env.sh spawns a new script with a whole slew of environment variables and whatnot set within the current directory. path/to/env1.shĮtc for a few more steps. If I am just in the terminal the workflow looks like: user:>.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |