error when running python script to call lammps

Dear Lammps users,

I’ve wrote a python script (attached) to call Lammps and do some analysis. However, I found the script runs fine if I directly use:

but will generate the following error if I use:

Error message:

File “”, line 55, in
extract_y(12, 40.129, 64.129, 92.258, 2)
File “”, line 21, in extract_y
File “/share/apps/lammps-11Aug17/python/”, line 643, in atoms
return AtomList(self)
File “/share/apps/lammps-11Aug17/python/”, line 465, in init
self.natoms = self.lmp.system.natoms
File “/share/apps/lammps-11Aug17/python/”, line 648, in system
d = self._parse_info_system(output)
File “/share/apps/lammps-11Aug17/python/”, line 699, in _parse_info_system
lines = output[6:-2]
TypeError: ‘NoneType’ object has no attribute ‘getitem

Could you please help with this problem? Thank you! (1.81 KB)

I have no idea why piping the output to script.output would

fail with that kind of error. Maybe Richard (CCd) has an idea.