Run python code at startup


i wrote a code and called some module in python such as tensorflow ,keras, matplot, skfuzzy and flyt_python. all the code run well when i excute the code by python command in terminal .but when i want to run the code at startup the flyt_python module can’t run.

i think the problem related to user but i dont know how solve it.
help me please .

from flyt_python import api
drone = api.navigation()

pls ensure your code is similar to above.


my code exactly like the code you wrote.
its better to show the problem by a sample.
i wrote a python program that just have 2 lines.

from flyt_python import api
drone = api.navigation()

and named it
then execute it by commandpython and the result is:

and then execute the code by sudo python and the result is :
when i use sudo the flyt_python module was unknown for python.


i dont want to run the program on terminal .i want to run it in startup.


Run the following commands:

$ sudo -s
$ python

This will work.