the contents of boot.py

The official pyboard running MicroPython.
This is the reference design and main target board for MicroPython.
You can buy one at the store.
Target audience: Users with a pyboard.
Post Reply
cappy2112
Posts: 8
Joined: Fri Apr 22, 2016 9:58 pm

the contents of boot.py

Post by cappy2112 » Mon May 02, 2016 11:23 pm

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?

User avatar
dhylands
Posts: 3821
Joined: Mon Jan 06, 2014 6:08 pm
Location: Peachland, BC, Canada
Contact:

Re: the contents of boot.py

Post by dhylands » Tue May 03, 2016 3:46 am

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.

User avatar
platforma
Posts: 258
Joined: Thu May 28, 2015 5:08 pm
Location: Japan

Re: the contents of boot.py

Post by platforma » Tue May 03, 2016 10:05 am

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"? :)

User avatar
dhylands
Posts: 3821
Joined: Mon Jan 06, 2014 6:08 pm
Location: Peachland, BC, Canada
Contact:

Re: the contents of boot.py

Post by dhylands » Tue May 03, 2016 3:40 pm

Bah - yes.

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

Post Reply