In the end I want to run the script in the following way: python3 script.py H2_0_1. To run it with subprocess, you would do the following: > import subprocess > n( 'ls') filename CompletedProcess(args'ls', returncode0) You can also set shellTrue, which will run the command through the shell itself. Output_file = xyzfile.split(".") + ".out"Īnd is created within the script via templating. The input file is derived from the *xyz file via xyzfile = str(sys.argv) It comes with several high-level APIs like call, checkoutput, and (starting. The script reads and splits the filename by the point and creates an input file name H2.inp and the output should be written into the file H2.out. The Python subprocess module is a powerful Swiss Army knife for launching and interacting with child processes. How do I "emulate" the command given at the top with the subprocess module? I tried that with n(, stdout=output_file)īut so far it did not work. At the end the script should start the calculation in a way that I could log out of the server without stopping orca. Now I wanted to use a python script (with some templating) to write the input file automatically. Normally you start your quantum chemical programm (in my case it's called orca) with your input file (*.inp) on a remote server as a background process and pipe the output into an outputfile (*.out) via nohup orca H2.inp >& H2.out & I want to automate some quantum chemical calculations and ran into a small problem. I'm looking for a solution for a probably quite easy problem.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |