How to run command line python tool in Heroku

倖福魔咒の 提交于 2020-01-06 01:06:40

问题


I am new to Heroku platform. My requirement is to run a python command line tool from Heroku. I am not sure if this can be done directly as applications over there are the web applications with other mandatory files such as procfile etc. The approach I am thinking to take is to create a web app that could call the python script. But next question comes up is how to call python script which allows passing arguments to it too. And do I need to deploy the python tool and web app separately? Please guide me with the approach.


回答1:


If you want that python scripts are executed automatically, use Heroku Sheduler. It will count towards your dyno usage and is free.

Depending on how long and complex your tasks are/will be in the future, you will need a custom clock process, which is not free.

If you want to execute a script yourself, then cd into your project, login with heroku and use heroku run python.



来源:https://stackoverflow.com/questions/48853754/how-to-run-command-line-python-tool-in-heroku

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!