orbeckst/GromacsWrapper — Issue #7: Error when giving input parameters to g_traj
Author: ezitoc
Created: 2011-12-28 20:22:56+00:00
State: open

I get this error message when running the command gromacs.g_traj in a python script:

Traceback (most recent call last):
File "run.py", line 32, in
gromacs.g_traj(f=MOL+"-md.trj", s=MOL+"-md.tpr", of="force.xvg", noz="", noy="", input=("6", "q"))
File "/usr/local/lib/python2.7/dist-packages/GromacsWrapper-0.2.4-py2.7.egg/gromacs/core.py", line 265, in __call__
return self.run(*args,**kwargs)
File "/usr/local/lib/python2.7/dist-packages/GromacsWrapper-0.2.4-py2.7.egg/gromacs/core.py", line 84, in run
return self._run_command(*_args, **_kwargs)
File "/usr/local/lib/python2.7/dist-packages/GromacsWrapper-0.2.4-py2.7.egg/gromacs/core.py", line 451, in _run_command
self.check_failure(result, command_string=p.command_string)
File "/usr/local/lib/python2.7/dist-packages/GromacsWrapper-0.2.4-py2.7.egg/gromacs/core.py", line 402, in check_failure
raise GromacsError(rc, msg)
gromacs.GromacsError: [Errno 255] Gromacs tool failed
Command invocation: printf "6\nq\n" | g_traj -of force.xvg -s esfera-md.tpr -noy -noz -f esfera-md.trj

shell returned 1

The problem arises when i run the command "printf "6\nq\n" | g_traj -of force.xvg -s esfera-md.tpr -noy -noz -f esfera-md.trj" in shell (bash), as it works as desired.