1

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 1

2

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

enter image description here

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.

Sign up to request clarification or add additional context in comments.

1 Comment

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?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.