Python Forum
Error message when running autostarted code
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Error message when running autostarted code
#1
I have created a python3 script for use on Raspberry pi 3 (approx. 300 lines of code), this program runs perfectly under the included Terminal utility. ie start Terminal, cd to myDir, enter "python myCode.py
BUT when I try to run it automatically at start-up I get an error message part way through the code, first 50 lines of code work ok,
error message is "syntax err: unexpected EOF while parsing" I cannot see any code problems at the message pointer.
I got the program to run automatically in Terminal at start-up by adding the following code to "/.config/lxsession/LXDE-pi/autostart"
Added code = "@lxterminal -e python -i /home/pi/myDir/myCode.py" (added before "@xscreensaver -no-splash" line).
The program uses operator keyboard and push button inputs to control a real world, real time, process via GPIO and various relays, switches and motors.
Can any one help?
I can supply the area of code which produces the error in auto-run mode if needed.
Reply


Messages In This Thread
Error message when running autostarted code - by Python4Mike - Jan-31-2018, 02:57 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  problem in running a code akbarza 7 724 Feb-14-2024, 02:57 PM
Last Post: snippsat
  writing and running code in vscode without saving it akbarza 1 436 Jan-11-2024, 02:59 PM
Last Post: deanhystad
  the order of running code in a decorator function akbarza 2 571 Nov-10-2023, 08:09 AM
Last Post: akbarza
  error "cannot identify image file" part way through running hatflyer 0 738 Nov-02-2023, 11:45 PM
Last Post: hatflyer
  Error message about iid from RandomizedSearchCV Visiting 2 1,058 Aug-17-2023, 07:53 PM
Last Post: Visiting
  Error when running kivy on python janeik 8 2,166 Jun-16-2023, 10:58 PM
Last Post: janeik
  Another Error message. the_jl_zone 2 1,012 Mar-06-2023, 10:23 PM
Last Post: the_jl_zone
  Getting error when running "MINUS" between 2 databases marlonbown 4 1,316 Nov-10-2022, 05:49 AM
Last Post: deanhystad
  Code running many times nad not just one? korenron 4 1,408 Jul-24-2022, 08:12 AM
Last Post: korenron
  Error while running code on VSC maiya 4 3,873 Jul-01-2022, 02:51 PM
Last Post: maiya

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020