Hello,
I would like to start my python script from main.py. I tried to simplify the script by only having one line within the file test.py
The line is:
print('test')
Now, I want to avoid to past this line directly into the main.py, instead I want to simply start the test.py.
I already read the pdf micropython8266.pdf but the information within the document didn't work.
I know that it must be a completely stupid solution but after 2 hours I didn't find a solution.
BR Marcus
Call from main.py
Re: Call from main.py
The micropython main loop goes something like this:
If you want the code to stay in main.py and not leave it, then you need to write the code to do that. Something along the lines of: Technically, you don't need the delay, but it will cause less CPU to be consumed since the MCU will enter a lower sleep state.
Code: Select all
start-of-loop:
call boot.py
call main.py
enter REPL
goto start of loop
Code: Select all
while True:
print('Wasting time. Press Control-C to exit main.py')
utime.sleep(5)