EEVblog Electronics Community Forum

Products => Computers => Programming => Topic started by: SPRX on November 11, 2021, 06:16:59 am

Title: How to schedule a python script with Flask at startup
Post by: SPRX on November 11, 2021, 06:16:59 am

Hi,
I am trying to schedule a python script with 'Flask' module import and use in the programe for Webserver. Python code (with Flsk) runs ok if you run it manually. I am running flask 2.2,  Ubuntu 18.04, Python 3.6.9 on a Jetson Nano.

It sound very simple to use CRONTAB or systemctl to schedule the program, however non seems to work with me as soon as i includ the import flask in the python code. I spent lot of time trying to figure the issue or the solution with no success.

Any suggestion/ direction on how to get it sorted if someone has come across similar issue? 
Title: Re: How to schedule a python script with Flask at startup
Post by: tunk on November 11, 2021, 11:10:13 am
I think they are run in a limited shell.
If you haven't already done it, try to use full paths for commands and files.
Title: Re: How to schedule a python script with Flask at startup
Post by: SPRX on November 11, 2021, 12:27:12 pm

Thanks Tunk, I hv already tried that too without any luck  |O