[Context]
I have a file upload operation in my Django application (on ubuntu server), I have to execute an operation after the user uploaded the file. The tool for that is only available as a npm package (accessible via command line).
Django is is python webframework. So you can use any of the module provided by python. However give a try to subprocess module. This module is a preferred way of running other programs with Python. Take a look.
import subprocess print(subprocess.check_output(['ls','-l']))
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.