Hi Peter,
> Here is what I have discovered about config files. Even though a .py
> suffix indicates that the file is a program, the config file must be
> called config.py.
Are you sure these config.py files are specific to MicroPython?
Could they be understood by some higher system which happens to be using
MicroPython? I've not found any MicroPython documentation on them.
> mqtt_server = b'192.168.4.1'
...
> I am not sure of the reason for the 'b' in the term. Does it mean
> read as binary?
The meaning of 'abc' changes between Python 2 and 3. In 2, it is
a string of bytes, but in 3 it's a string of characters in an encoding,
typically UTF-8. To get a string of bytes in 3, the leading 'b' is
used.
>>> type('a'), type(b'a')
(<class 'str'>, <class 'bytes'>)
https://docs.python.org/3/reference/lexical_analysis.html#string-prefixes
--
Cheers, Ralph.
--
Next meeting: Online, Jitsi, Tuesday, 2026-07-07 20:00
Check to whom you are replying
Meetings, mailing list, IRC, ... https://dorset.lug.org.uk
New thread, don't hijack: mailto:[email protected]