Error:
OSError: [Errno 7] Argument list too long
History:
Running a script on pvpython (vtk); however on older distributions pvpython < 5.0, the matplotlib modules are obsolete, thus making the use of that module not possible. To overcome this, another .py
is used and the arguments passed in the terminal using subprocess
as shown below and run on python but since the information passed is large, the above error is met.
The problematic code is:
import subprocess
command = ("python illustrations.py %s %s %s %s %s %s %s %s %s %s" % (str(post_processing), str(width), str(height), str(len(new_overall_lines)), str(reset_scale), str(str_rose_angle), str(str_damage), str(fname), str(fname1), str("ax=None")))
subprocess.Popen(command, stdout=subprocess.PIPE, shell=True)
argv 6 and 7 are extremely lengthy (882770, 879326) characters each, as they are lists.
An alternate solution could be to pass the list into a temp file and load those in to python module. But I am trying to save on write and load time.
Thus am looking for a way to pass large arguments in terminal or how to pass arguments two environments, in this case pvpython and python.