login - Raspberry pi, run Python script on startup, cron has failed, /etc/profile has failed, .config/autostart has failed, other methods? -




excuse me, i'm trying python script have written autostart on raspberry pi. i've tried several methods they've failed.

i have tried methods using cron's "@reboot" feature, these seem make script run in boot sequence, enough libraries needs haven't loaded yet , other crucial functions of pi has make use of haven't yet started. example had error occur:

traceback (most recent call last):   file "program_name.py", line 688, in <module>     fig=plt.figure()   file "/usr/lib/python2.7/dist-packages/matplotlib/pyplot.py", line 435, in figure     **kwargs)   file "/usr/lib/python2.7/dist-packages/matplotlib/backends/backend_tkagg.py", line 81, in new_figure_manager     return new_figure_manager_given_figure(num, figure)   file "/usr/lib/python2.7/dist-packages/matplotlib/backends/backend_tkagg.py", line 89, in new_figure_manager_given_figure     window = tk.tk()   file "/usr/lib/python2.7/lib-tk/tkinter.py", line 1813, in __init__     self.tk = _tkinter.create(screenname, basename, classname, interactive, wantobjects, usetk, sync, use) _tkinter.tclerror: no display name , no $display environment variable 

which odd start because i'm using pygame not tkinter. , not error has ever occured when i've run program using "python program_name.py" terminal, problem trying run script @ wrong moment rather problem in script. when happened program tried run moment before crashing error, mouse slow , juddery when tried move around on screen , window full screen 1 relevant bits of gui in middle , black space (a kind of "actual size big screen might be" display ) around had been distorted become kind of "fill screen if wrecks aspect ratio" display.

i have tried using /etc/profile using /etc/xdg/autostart/myprogram.desktop , using various methods init.d of these seem nothing, pi logs in , python program doesn't start.

is there anyway python program run automatically after pi has logged in, see pi startup normal, , normal desktop start load split second later script begin , (as pygame based python gui) desktop covered on it.

thanks





wiki

Comments

Popular posts from this blog

Asterisk AGI Python Script to Dialplan does not work -

python - Read npy file directly from S3 StreamingBody -

kotlin - Out-projected type in generic interface prohibits the use of metod with generic parameter -