Python Forum
f-strings in a script to be made public
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
f-strings in a script to be made public
#1
just about all my python scripts now use f-strings. many of those use many f-strings. as literals to be parsed during the compile phase, in python interpreters before version 3.6, they are syntax errors. this means users get told about this in a traceback. is there some means i can add to this information to be more informative to users that might not be coders so they understand what to do to fix it?
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply
#2
IMHO, I think the best approach is to specify in the description/docstring the script requires 3.6+ and versions before that are not supported.
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply
#3
i already do that, both in the docstring, and in comments. i just wanted to go a step further and handle the situation of the user trying to run the script.
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
Star Nodezator v1.4 released! (Python node editor in the public domain) KennedyRichard 0 920 Sep-04-2023, 01:42 PM
Last Post: KennedyRichard
Star Nodezator (free Python node editor) released to the public domain! KennedyRichard 4 2,179 Jun-24-2022, 09:49 AM
Last Post: Larz60+
  print a list strings is fast but printing the joined strings is slow Skaperen 9 3,913 Aug-26-2019, 07:48 PM
Last Post: Skaperen

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020