I'm using a new platform based on STM32F401CE with 512KB Flash/96KB RAM similar to the G30TH, but targeted to using flat flex cables to connect modules instead of 0.1 inch pitch .025 inch square pins and headers. Flex cables make fitting something in an enclosure so much easier.
We may be running out of code space soon and I wondered if comments are already stripped out during compile, or if that needs an extra step?
Here's the project: https://github.com/kanzure/culture_shock
The platform can be for sale in a while for investigating high voltage D2A, using flat flex cables, other micropython applications.
Flat flex cables are not easy to get generically, so I'm going to be selling them to use to make modules connect at easy prices like 35 cents each for short cables and connectors for 20 conductors. They'll be for sale in ten packs that ship postal tracked for $3. So $13.50 will get you ten connections between prototype boards that can be used 500 times without much degradation, and even work fairly well in humidity.
Are comments stripped out of code?
Are comments stripped out of code?
John Griessen blog.kitmatic.com
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: Are comments stripped out of code?
Compilation converts Python source to bytecode which has no comments. When you say you're running out of code space, what exactly do you mean? If you mean that your code is too big to compile on the target, consider using the cross-compiler or frozen bytecode.
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.
Re: Are comments stripped out of code?
Thanks, I'm not out of space yet, and it's good to know that the comments can flow freely as I improve my code.
I am just loading files to /flash, so they get compiled on the target, but I know how to cross compile instead when I need to.
I'm going to lookup a command to show available flash.
I am just loading files to /flash, so they get compiled on the target, but I know how to cross compile instead when I need to.
I'm going to lookup a command to show available flash.
Last edited by jgriessen on Sun Aug 12, 2018 9:10 pm, edited 1 time in total.
John Griessen blog.kitmatic.com
Re: Are comments stripped out of code?
What about docstrings? I'm too lazy to look at the microPython docs, but I know that with cPython the -OO command line option strips out docstrings, which otherwise eat up space in the bytecode, just wondering of uPy has similar options.
-
- Posts: 969
- Joined: Sat Feb 03, 2018 7:02 pm
Re: Are comments stripped out of code?
So you are too lazy to look at the micropython docs (or at least google it) but other people should not be too lazy to reply to your question?
Kevin Köck
Micropython Smarthome Firmware (with Home-Assistant integration): https://github.com/kevinkk525/pysmartnode
Micropython Smarthome Firmware (with Home-Assistant integration): https://github.com/kevinkk525/pysmartnode