Sto cercando di eseguire un programma per effettuare alcune chiamate di sistema all'interno del codice Python utilizzando subprocess.call()
che genera il seguente errore:
Traceback (most ultima chiamata recente): File "<console>", riga 1, in <module> File "/usr/lib/python2.7/subprocess.py", riga 493, nella chiamata return Popen(*popenargs, **kwargs).wait() File "/usr/lib/python2.7/subprocess.py" , riga 679, in __init__ errread, errwrite) File "/usr/lib/python2.7/subprocess.py", riga 1249, in _execute_child raise child_exception OSError: [Errno 2] Nessun file o directory di questo tipo
Il mio codice Python effettivo è il seguente:
url = "/media/videos/3cf02324-43e5-4996-bbdf-6377df448ae4.mp4" real_path = "/home/chanceapp /webapps/chanceapp/chanceapp"+url fake_crop_path = "/home/chanceapp/webapps/chanceapp/chanceapp/fake1"+url fake_rotate_path = "/home/chanceapp/webapps/chanceapp.chanceapp/fake2"+url crop = "ffmpeg - i %s -vf "%(real_path)+"crop=400:400:0:0 "+ "-strict -2 %s"%(fake_crop_path) rotate = "ffmpeg -i %s -vf "%(fake_crop_path) +"transpose=1 "+"%s"%(fake_rotate_path) move_rotated = "mv"+" %s"%(fake_rotate_path)+" %s"%(real_path) delete_cropped = "rm "+"%s"%( fake_crop_path) #chiamate di sistema: subprocess.call(crop)
Posso ricevere consigli pertinenti su come risolvere questo problema?