Page 1 of 1

the contents of boot.py

Posted: Mon May 02, 2016 11:23 pm
by cappy2112
This is the contents of boot.py, as indicated at this url -> http://micropython.org/doc/tut-script

import pyb
#pyb.main('main.py') # main script to run after this one
#pyb.usb_mode('CDC+MSC') # act as a serial and a storage device
#pyb.usb_mode('CDC+HID') # act as a serial device and a mouse

Since everything is commented out, how is it that main.py still gets executed?

Re: the contents of boot.py

Posted: Tue May 03, 2016 3:46 am
by dhylands
Calling pyb.main('foo.py') would set the name of the main script to be main.py.

If you don't call pyb.main, then the default script name of 'main.py' is used.

So not calling pyb.main and calling pyb.main('main.py') both do the same thing.

Re: the contents of boot.py

Posted: Tue May 03, 2016 10:05 am
by platforma
dhylands wrote:Calling pyb.main('foo.py') would set the name of the main script to be main.py.
I guess you meant "foo.py"? :)

Re: the contents of boot.py

Posted: Tue May 03, 2016 3:40 pm
by dhylands
Bah - yes.

That's what happens when you get distracted in the middle of typing a response.