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!