main.py not running (script error)

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
Post Reply
Nogga
Posts: 4
Joined: Thu Apr 27, 2017 7:47 pm

main.py not running (script error)

Post by Nogga » Thu May 25, 2017 7:18 am

I am trying to run my script which sits in sitago.py via importing in main.py:

Code: Select all

import sitago
sitago.main()
But when I am resetting the ESP8266 it always ends in an error:
Traceback (most recent call last):
File "main.py", line 1
SyntaxError: invalid syntax
My Micropython version is:
MicroPython v1.8.7-7-gb5a1a20a3 on 2017-01-09; ESP module with ESP8266

Any ideas or advice?

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: main.py not running (script error)

Post by pythoncoder » Thu May 25, 2017 7:57 am

Well there's no obvious syntax error. I'd comment out the lines in main.py and reset the board. Assuming it starts without error what happens if you issue those same lines at the REPL?
Peter Hinch
Index to my micropython libraries.

Nogga
Posts: 4
Joined: Thu Apr 27, 2017 7:47 pm

Re: main.py not running (script error)

Post by Nogga » Thu May 25, 2017 6:49 pm

I have recognized, that this does not happen, when I close each line with ;.

I suspect that ESPlorer, which I am using for uploading is not properly inserting line-breaks.

I now managed to use mpfshell to upload the file and now it works...

Post Reply