问题
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