Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
program automatization
#1
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:

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
Reply


Messages In This Thread
program automatization - by clarablanes - Aug-23-2018, 11:54 AM
RE: program automatization - by Gribouillis - Aug-23-2018, 12:07 PM
RE: program automatization - by Prabakaran141 - Aug-23-2018, 12:30 PM
RE: program automatization - by clarablanes - Aug-23-2018, 04:12 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020