Hello, I am trying to run a client / server application where the client sends the lines to the server and the server takes the lines and it creates a cloudtag (image.png) and copies it to the html file (to the web page) in a python script.
I have an error in the line where I copy the image file to the html directory:
query = 'sudo cp imagen.png /var/www/html'
subprocess.call(shlex.split(query))
I do not know why I can send two lines only to the server. Then an error occurs when sending the third from the client to the server, and the console says:
File "/usr/lib/python2.7/subprocess.py", line 522, in call return Popen(*popenargs, **kwargs).wait()
File "/usr/lib/python2.7/subprocess.py", line 710, in __init__ errread,errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1223, in _execute_child
self.pid = os.fork()
OSError: [Errno 12] Cannot allocate memory
Does anyone know what is the relationship between the subprocess module and the memory and how can I solve it? Thank!
source
share