Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to start a Python script from Django website?

I've made a Django website, whence I would like to call a Python program that I currently start from the command line.

I imagine doing it by clicking on a link or button.

I know this must be a one-liner, but I'm stumped.

like image 945
memius Avatar asked Feb 04 '26 14:02

memius


1 Answers

Here is an article from Guido Van Rossum, who created python, on doing this. Essentially, you just want to invoke your main() function from your controller.

like image 153
Paul Sanwald Avatar answered Feb 06 '26 02:02

Paul Sanwald