如何让 Python Openshift 运行某个 Python 文件?

I a*_*ron 5 openshift

我想在 OpenShift 应用程序启动时运行某个 python 文件。我尝试了很多东西,比如在运行的 wsgi.py 文件execfile("thefilename.py")中没有用!

我希望能得到一些帮助!非常感谢!

fat*_*sma 0

如果您想在 python 脚本中运行,请尝试此操作。它应该在后台运行该文件。

Import os
os.system("python  pathtofile/thefilename.py &")
Run Code Online (Sandbox Code Playgroud)