3

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.

2 Answers 2

3

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.

Sign up to request clarification or add additional context in comments.

Comments

2
import yourscript # is in yourscript.py

yourclass = yourscript.Yourclass()
yourclass.run()

Or something like that?

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.