String literal (f-string) not supported in uiflow / micropython on M5StickC Plus?
-
Hi there,
I have a script which is using string literal, something like:
name = "john"
print(f"My name is {name}")This code is not working in UIFlow v1 with an M5StickCPlus
I also tried directly in the REPL and I have the same error.Can someone please confirm this is not supported (by UIFlow? Micropython version of the StickCPlus?)
Thanks
Eric -
Hi @erich
For example:
name='john'
print("my name is {0}".format(name)) -
@pandian-nano thanks I have already applied this workaround but I was just asking for confirmation that f-string is not supported on the StickCPlus with uiflow1.
-
Hi @erich f-strings donât support for micropython
refer this link: https://docs.micropython.org/en/latest/genrst/core_language.html
-
@pandian-nano thanks a lot this is very helpful but according to the page you mention your statement sayingâfstring is not supported in micropythonâ is not totally true.
If you refer to the page you mention you can use FString but not in all scenarios.Example;:
print(f"{x}" "ab") # works
print("a{}a" f"{x}") # failsFString is therefore âpartiallyâ supported in micropython
Thanks anyway, now I have an official explanation ;;)
-
Hi @erich,
These features(f string) are supported by microPython version v1.17 or higher and uiflow 1 is supported by micropython v1.12, so these features(f string) are not supported.
-
@pandian-nano yes youâre right, thanks for the clarification!
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better đ
Register Login