Re: print
Hi Boris,
print is there, but with the Python 3.3 syntax (so it requires parenthesis).
print is there, but with the Python 3.3 syntax (so it requires parenthesis).
Code: Select all
Micro Python build 1f85d62-dirty on 2014-05-01; NetduinoPlus2 with STM32F405RG
Type "help()" for more information.
>>> print('Hello there %s' % 'Boris')
Hello there Boris
Re: print
And str.format is also somewhat supported.
One place to look for examples is in the test tree. This tree contains test code which is run against python 3.3 and against MicroPython to confirm that MicroPython produces the same results.
So with str.format, for example, this works:
but this doesn't (yet)
I think that everything that's supposed to come after the colon is supported.
Code: Select all
print('This is {} test'.format('a'))
So with str.format, for example, this works:
Code: Select all
>>> print('{:+8,d}'.format(1234))
+1,234
Code: Select all
>>> print('{foo:}'.format(foo=123))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: function does not take keyword arguments
Re: print
> but this doesn't (yet)
I'm glad you're aware . I wanted to post a ticket to capture that, but didn't want it to sound as not appreciating your great work on supporting other format specifiers. But yep, there's yet a way to go before we have "complete" support for .format() or str %.
I'm glad you're aware . I wanted to post a ticket to capture that, but didn't want it to sound as not appreciating your great work on supporting other format specifiers. But yep, there's yet a way to go before we have "complete" support for .format() or str %.
Awesome MicroPython list
Pycopy - A better MicroPython https://github.com/pfalcon/micropython
MicroPython standard library for all ports and forks - https://github.com/pfalcon/micropython-lib
More up to date docs - http://pycopy.readthedocs.io/
Pycopy - A better MicroPython https://github.com/pfalcon/micropython
MicroPython standard library for all ports and forks - https://github.com/pfalcon/micropython-lib
More up to date docs - http://pycopy.readthedocs.io/
Re: print
I didn't know too much of differences between python 2 and 3 when I started with MicroPython, and now I'm pretty much Python3-ready. That's alone a great outcome from being acquainted with MicroPython, as Python3 is indeed the future, which despite some its controversies, becoming as present as we speak (for example, many Linux distros switch to python3 as default one).badryan wrote:<blushes>Oh.</blushes> Thank you very very much! I've never looked at the actual differences between Python 2 and 3!
Awesome MicroPython list
Pycopy - A better MicroPython https://github.com/pfalcon/micropython
MicroPython standard library for all ports and forks - https://github.com/pfalcon/micropython-lib
More up to date docs - http://pycopy.readthedocs.io/
Pycopy - A better MicroPython https://github.com/pfalcon/micropython
MicroPython standard library for all ports and forks - https://github.com/pfalcon/micropython-lib
More up to date docs - http://pycopy.readthedocs.io/
Re: print
Hey Paul,
File the ticket I've been developing for so long now that I have a pretty thick hide. Not to mention that at work, everything has to be reviewed by somebody else before it lands (gets checked in). It took me 9 review cycles to get my first bug landed
I'm also not one to take offense when bugs are found in my code. A bug is a bug and they should all be eradicated - it doesn't matter how they got there
File the ticket I've been developing for so long now that I have a pretty thick hide. Not to mention that at work, everything has to be reviewed by somebody else before it lands (gets checked in). It took me 9 review cycles to get my first bug landed
I'm also not one to take offense when bugs are found in my code. A bug is a bug and they should all be eradicated - it doesn't matter how they got there
Re: print on pycharm
How can i see the print on pycharm on the terminal log?
Thabks
Thabks
- Attachments
-
- Screen Shot 2019-03-01 at 17.30.24.png (152.36 KiB) Viewed 19359 times
Re: print
You seem to have an encoding problem: your program does not even parse. See this thread on stackoverflow.
-
- Posts: 1
- Joined: Sun Jun 14, 2020 1:58 pm
Re: print
Hello
I uploaded my code to esp8266 via pycharm. Just a simple statement print("Hello World"). When I execute this with REPL it works fine but when I flash it with main.py the pycharm window shows something like Soft Reboot and nothing gets printed.
Please Help
Thanks in advance
I uploaded my code to esp8266 via pycharm. Just a simple statement print("Hello World"). When I execute this with REPL it works fine but when I flash it with main.py the pycharm window shows something like Soft Reboot and nothing gets printed.
Please Help
Thanks in advance