Use subprocess python


I try to make a program that I was left with as a task in the university about how to execute terminal commands, from a programming language, I am trying with python, but when doing the following I get an error in the "find"

import subprocess  

print("El archivo mas grande de la carpeta :", carpeta1, )['find', carpeta1, '-type', 'f', '-print', '|', 'sort', '-nr', '|', 'head', '-1'])

I get the following error: find: paths must precede expression: '|' I would appreciate someone helping me with this error.

asked by Juan Lopez 25.11.2018 в 18:44

0 answers