May-11-2019, 10:56 AM
Had to make some changes to your changes:
#!/usr/bin/env python2.5
# -*- coding: utf-8 -*-
import subprocess
import sys
with open('ligands') as infile:
ligand = infile.read().strip().split()
for nvar in ligand:
command = [
"./pythonsh", "./prepare_ligand4.py",
"-l", nvar + ".mol2",
"-o", nvar + ".pbdqt" ]
proc = subprocess.Popen(command, stdout=subprocess.PIPE)
out, err = proc.communicate()
print(out)
print(err)
if proc.returncode:
print ('Subprocess FAILED:', proc.command)
Here are the results:
runfile('/sdc1/Apps/Modeling/FileEditing/untitled1m2.py', wdir='/sdc1/Apps/Modeling/FileEditing')
Traceback (most recent call last):
File "/home/comp/Apps/miniconda3/lib/python3.7/site-packages/IPython/core/interactiveshell.py", line 3296, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "<ipython-input-1-51b00a34bbcd>", line 1, in <module>
runfile('/sdc1/Apps/Modeling/FileEditing/untitled1m2.py', wdir='/sdc1/Apps/Modeling/FileEditing')
File "/home/comp/Apps/miniconda3/lib/python3.7/site-packages/spyder_kernels/customize/spydercustomize.py", line 824, in runfile
execfile(filename, namespace)
File "/home/comp/Apps/miniconda3/lib/python3.7/site-packages/spyder_kernels/customize/spydercustomize.py", line 110, in execfile
exec(compile(f.read(), filename, 'exec'), namespace)
File "/sdc1/Apps/Modeling/FileEditing/untitled1m2.py", line 17
print 'Subprocess FAILED:', proc.command
^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print('Subprocess FAILED:', proc.command)?
runfile('/sdc1/Apps/Modeling/FileEditing/untitled1m2.py', wdir='/sdc1/Apps/Modeling/FileEditing')
Traceback (most recent call last):
File "/home/comp/Apps/miniconda3/lib/python3.7/site-packages/IPython/core/interactiveshell.py", line 3296, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "<ipython-input-2-51b00a34bbcd>", line 1, in <module>
runfile('/sdc1/Apps/Modeling/FileEditing/untitled1m2.py', wdir='/sdc1/Apps/Modeling/FileEditing')
File "/home/comp/Apps/miniconda3/lib/python3.7/site-packages/spyder_kernels/customize/spydercustomize.py", line 824, in runfile
execfile(filename, namespace)
File "/home/comp/Apps/miniconda3/lib/python3.7/site-packages/spyder_kernels/customize/spydercustomize.py", line 110, in execfile
exec(compile(f.read(), filename, 'exec'), namespace)
File "/sdc1/Apps/Modeling/FileEditing/untitled1m2.py", line 12
proc = subprocess.Popen(command, stdout=subprocess.PIPE, stdout=subprocess.PIPE)
^
SyntaxError: keyword argument repeated
runfile('/sdc1/Apps/Modeling/FileEditing/untitled1m2.py', wdir='/sdc1/Apps/Modeling/FileEditing')
b''
None
b''
None
b''
None
b''
None
b''
None
b''
None
b''
None
b''
None
b''
None
b''
None
b''
None
b''
None
b''
None
b''
None
b''
None
b''
None
b''
None
b''
None
b''
None
b''
None
b''
None
b''
None
b''
None
b''
None
b''
None
b''
None
b''
None
b''
None
b''
None
b''
None
b''
None
b''
None
#!/usr/bin/env python2.5
# -*- coding: utf-8 -*-
import subprocess
import sys
with open('ligands') as infile:
ligand = infile.read().strip().split()
for nvar in ligand:
command = [
"./pythonsh", "./prepare_ligand4.py",
"-l", nvar + ".mol2",
"-o", nvar + ".pbdqt" ]
proc = subprocess.Popen(command, stdout=subprocess.PIPE)
out, err = proc.communicate()
print(out)
print(err)
if proc.returncode:
print ('Subprocess FAILED:', proc.command)
Here are the results:
runfile('/sdc1/Apps/Modeling/FileEditing/untitled1m2.py', wdir='/sdc1/Apps/Modeling/FileEditing')
Traceback (most recent call last):
File "/home/comp/Apps/miniconda3/lib/python3.7/site-packages/IPython/core/interactiveshell.py", line 3296, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "<ipython-input-1-51b00a34bbcd>", line 1, in <module>
runfile('/sdc1/Apps/Modeling/FileEditing/untitled1m2.py', wdir='/sdc1/Apps/Modeling/FileEditing')
File "/home/comp/Apps/miniconda3/lib/python3.7/site-packages/spyder_kernels/customize/spydercustomize.py", line 824, in runfile
execfile(filename, namespace)
File "/home/comp/Apps/miniconda3/lib/python3.7/site-packages/spyder_kernels/customize/spydercustomize.py", line 110, in execfile
exec(compile(f.read(), filename, 'exec'), namespace)
File "/sdc1/Apps/Modeling/FileEditing/untitled1m2.py", line 17
print 'Subprocess FAILED:', proc.command
^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print('Subprocess FAILED:', proc.command)?
runfile('/sdc1/Apps/Modeling/FileEditing/untitled1m2.py', wdir='/sdc1/Apps/Modeling/FileEditing')
Traceback (most recent call last):
File "/home/comp/Apps/miniconda3/lib/python3.7/site-packages/IPython/core/interactiveshell.py", line 3296, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "<ipython-input-2-51b00a34bbcd>", line 1, in <module>
runfile('/sdc1/Apps/Modeling/FileEditing/untitled1m2.py', wdir='/sdc1/Apps/Modeling/FileEditing')
File "/home/comp/Apps/miniconda3/lib/python3.7/site-packages/spyder_kernels/customize/spydercustomize.py", line 824, in runfile
execfile(filename, namespace)
File "/home/comp/Apps/miniconda3/lib/python3.7/site-packages/spyder_kernels/customize/spydercustomize.py", line 110, in execfile
exec(compile(f.read(), filename, 'exec'), namespace)
File "/sdc1/Apps/Modeling/FileEditing/untitled1m2.py", line 12
proc = subprocess.Popen(command, stdout=subprocess.PIPE, stdout=subprocess.PIPE)
^
SyntaxError: keyword argument repeated
runfile('/sdc1/Apps/Modeling/FileEditing/untitled1m2.py', wdir='/sdc1/Apps/Modeling/FileEditing')
b''
None
b''
None
b''
None
b''
None
b''
None
b''
None
b''
None
b''
None
b''
None
b''
None
b''
None
b''
None
b''
None
b''
None
b''
None
b''
None
b''
None
b''
None
b''
None
b''
None
b''
None
b''
None
b''
None
b''
None
b''
None
b''
None
b''
None
b''
None
b''
None
b''
None
b''
None
b''
None