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 Answer
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.
1 Comment
Tanu Jain
No, I can't use the scheduler. I run the tool on the command line as 'python tool.py -d "domain.txt" -o "outputfile.txt"'. I want the same capability on Heroku. Can I run the above command using Heroku run python?
