Aug-23-2018, 11:54 AM
(This post was last modified: Aug-23-2018, 12:02 PM by Gribouillis.)
Good morning.
I'm very new with python but I have been reading and trying a lot of code. My problem is the following:
I have to use a binary called Process_Ligand. When I pass the argument (the ligand in this case) it works but I need to use it with hundreds of files. To this end, I have done my first little script that works fine when I use only one file:
Thank you in advance.
Clara
I'm very new with python but I have been reading and trying a lot of code. My problem is the following:
I have to use a binary called Process_Ligand. When I pass the argument (the ligand in this case) it works but I need to use it with hundreds of files. To this end, I have done my first little script that works fine when I use only one file:
import os import subprocess import sys cmd = '/usr/share/apps/flexaid_temporal/Process_Ligand -f ligand.pdb' p = subprocess.Popen(cmd, shell=True, stderr=subprocess.PIPE)But when I try to automatize to be able to run hundreds of files it doesn't work. This is what I have done:
import os import subprocess import sys for file in os.listdir('.'): if file.endswith('pdb'): cmd = '/usr/share/apps/flexaid_temporal/Process_Ligand -f file' p = subprocess.Popen(cmd, shell=True, stderr=subprocess.PIPE)Could you help me, please?
Thank you in advance.
Clara