开发者

How to start a Python script from Django website?

I've made a Django website, whence I would like to call a开发者_JS百科 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.


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.


import yourscript # is in yourscript.py

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

Or something like that?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜