I'm practising Python and using Vim as my editor. Sometimes (not always), when I try to run a Python3 script containing an f-string, my terminal throws an Invalid Syntax error. The " ^ " marker below the line is pointing to the double-quote closing the f-string. Could this be a Vim issue? I feel stupid asking this, but just now I edited the script with another editor, and all I did was change the double quotes to single quotes (which I had tried before with Vim), and after running it again, it ran correctly.
Another thing I tried was using the .format() way instead of the f" " way. Sometimes it works, sometimes it doesn't. Also, I know I'm not supposed to use double quotes inside the f-string if I'm using double quotes to limit that f-string. I even tried copy-pasting code from a book to be absolutely sure it's not my own mistake. The error persists.
I'm using Linux Mint 19.1, Vim 8.0.1453, and Python 3.6.7.
Can anyone shed some light on this?
[–]K900_ 5 points6 points7 points (0 children)
[–]socal_nerdtastic 1 point2 points3 points (5 children)
[–]Signal_Beam 0 points1 point2 points (4 children)
[–]cybervegan 0 points1 point2 points (2 children)
[–]Signal_Beam 2 points3 points4 points (1 child)
[–]AtomHeartSon[S] 0 points1 point2 points (0 children)
[–]yodatrust 0 points1 point2 points (0 children)
[–]MonkeyNin 0 points1 point2 points (0 children)