__init__confusion

Discussion about programs, libraries and tools that work with MicroPython. Mostly these are provided by a third party.
Target audience: All users and developers of MicroPython.
Post Reply
KJM
Posts: 158
Joined: Sun Nov 18, 2018 10:53 pm
Location: Sydney AU

__init__confusion

Post by KJM » Thu Aug 11, 2022 7:58 am

Since https://docs.micropython.org/en/latest/ ... tolib.html has no usage example I went looking for some. They all look something like

Code: Select all

class AES:
    def __init__(self, key, mode, IV):
There is no mention of 'def' or 'self' on the micropython.org page so I'm wondering if there is a usage example closer to the format given there?

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

Re: __init__confusion

Post by pythoncoder » Fri Aug 12, 2022 8:57 am

These are really basic questions on the Python language. I suggest you do an online course in Python on your PC to learn basic syntax before venturing into MicroPython on microcontrollers.
Peter Hinch
Index to my micropython libraries.

Post Reply