Search found 735 matches
- Mon Sep 26, 2022 6:44 am
- Forum: Announcements and News
- Topic: Migration to GitHub Discussions
- Replies: 20
- Views: 289828
Re: Migration to GitHub Discussions
First time users of Micropython Github will probably be unsure how to or where to ask, and how to appropriately format py code... And having first time users having to go off tangent and do research on using Github Discussions might in some instances be off putting to some and choose not engage...?...
- Tue Aug 16, 2022 6:41 am
- Forum: General Discussion and Questions
- Topic: Easy way to emulate str 'capitalize' function?
- Replies: 4
- Views: 8484
Re: Easy way to emulate str 'capitalize' function?
Something like s[0].upper() + s[1:] ? Or are you asking how to add this to micropython?
- Tue Aug 16, 2022 6:39 am
- Forum: Development of MicroPython
- Topic: Looked at 10s of examples of how to compile esp8266 firmware, and none of them actually work?
- Replies: 4
- Views: 45228
Re: Looked at 10s of examples of how to compile esp8266 firmware, and none of them actually work?
Did you check the official one, https://github.com/micropython/micropyt ... ts/esp8266? Or alternatively https://github.com/micropython/micropyt ... ci.sh#L154 also works fine.Jibun no kage wrote: ↑Mon Aug 15, 2022 8:36 pmLooked at 10s of examples of how to compile esp8266 firmware
- Thu Aug 11, 2022 9:52 am
- Forum: General Discussion and Questions
- Topic: Frustrations with missing libraries?
- Replies: 18
- Views: 41388
Re: Frustrations with missing libraries?
if solution developers (i.e. MicroPython) are not engaged in the forum That is not really the case though: most of the people having contributed to micropython on Github also have and still do here. But this is all about volunteering so one cannot expect every single question to be seen/answered. M...
- Sun Jul 03, 2022 10:47 am
- Forum: Programs, Libraries and Tools
- Topic: JSON serialisation
- Replies: 5
- Views: 7590
Re: JSON serialisation
Change your class so the members have the exact same name as the arguments, then use __dict__ : class ToDoItem: def __init__(self, name, description, isComplete): self.name = name self.description = description self.isComplete = isComplete import json toSerialize = ToDoItem('a', 'b', 'c') print(toSe...
- Thu Jun 16, 2022 10:01 am
- Forum: General Discussion and Questions
- Topic: The order of operations matters. A lot!
- Replies: 12
- Views: 12556
Re: The order of operations matters. A lot!
That's a 25% improvement just for counting down to zero. Ok, but the counting down compares using equality, the other one using less than. That's not the same as comparing wheher a == 0 is faster than a == 23 which is what we were discussing originally. I don't have time to write a complete portabl...
- Wed Jun 15, 2022 7:35 pm
- Forum: General Discussion and Questions
- Topic: The order of operations matters. A lot!
- Replies: 12
- Views: 12556
Re: The order of operations matters. A lot!
Another one that's interesting is checking for a specific value in a variable as opposed to zero. The zero check is faster because processors don't have to compare to anything, just load the value into a single register. So, a == 0 is faster than a == 23. The exception to that is if the "a" and "23...
- Wed Jun 15, 2022 6:34 am
- Forum: General Discussion and Questions
- Topic: os Vs uos rabbit hole
- Replies: 6
- Views: 6667
Re: os Vs uos rabbit hole
Hard to tell. I mean, I'd say 'this is an implementation detail and the key is in the source code' but I'm actually not sure. I also cannot reproduce it on the unix port for example. The 2 cases you describe differ in more than just .py vs .mpy. First one is 'run from IDE', not sure what that means ...
- Wed Jun 15, 2022 6:22 am
- Forum: General Discussion and Questions
- Topic: The order of operations matters. A lot!
- Replies: 12
- Views: 12556
Re: The order of operations matters. A lot!
Are you asking about short-circuiting boolean operators (https://docs.python.org/3/library/stdty ... and-or-not)? That's a potentially crucial difference with mereley changing order of code: it simply skips code.
- Tue Jun 14, 2022 3:11 pm
- Forum: General Discussion and Questions
- Topic: os Vs uos rabbit hole
- Replies: 6
- Views: 6667
Re: os Vs uos rabbit hole
So your code does
yet it fails saying uos isn't defined? Can you reproduce that with the minimal sample above? Sounds like a bug.
Code: Select all
import os
os.urandom