Dec-13-2019, 01:51 PM
I have a RUN script that runs all programs from the project. The script is run after pressing the OK button in the interface (QtDesigner) and is run by the subprocess.call(['py', 'RUN.py']). All programs run by RUN are also executed with the subprocess command.
One of the scripts creates a temp.py script that is located in the working folder and not where all the scripts (including RUN). This script is used as a module by programs run by RUN.
The module is imported in this way:
This is the command:
grid_path / dock_path also come from the parameters.py module and refers to the program paths that perform the action.
the temp.py script has the value best_pose.
cmd is added to allow programs to perform actions on files in the working folder
These programs run twice. The first time they work correctly when best_pose is taken directly from the parameters.py module (located in the same folder as RUN), and it doesn't work the second time when the best pose value is different and comes from the temp.py module (it is located in a different folder than RUN)
One of the scripts creates a temp.py script that is located in the working folder and not where all the scripts (including RUN). This script is used as a module by programs run by RUN.
The module is imported in this way:
import sys sys.path.append(work_dir) from temp import *The problem is that two important programs are not started when RUN is started from the interface. (they work when the RUN program is run directly from python script)
This is the command:
subprocess.call([grid_path, "-p", work_dir+"/"+"grid.gpf", "-l", work_dir+"/"+"grid.glg"],cwd=work_dir,shell=True) subprocess.call([dock_path, "-p", best_pose+"_ligremove.dpf", "-l", best_pose+"_ligremove.dlg"],cwd=work_dir,shell=True)work_dir comes from the parameters.py module, which is included with the scripts and specifies the path to the working folder.
grid_path / dock_path also come from the parameters.py module and refers to the program paths that perform the action.
the temp.py script has the value best_pose.
cmd is added to allow programs to perform actions on files in the working folder
These programs run twice. The first time they work correctly when best_pose is taken directly from the parameters.py module (located in the same folder as RUN), and it doesn't work the second time when the best pose value is different and comes from the temp.py module (it is located in a different folder than RUN)