When doing python3 Webhook.py
(this is the file), it gives me the error:
File \"
This happens when anything inside {}
is not valid, in a string formatted using the f
string formatting prefix. Python 3.7 in my case. The upside is you get the string causing the problem on the error message. You don't get the line number, but it's still easy to figure out once you acknowledge that line number 1 is not the correct line number of the error.
for my code. the problem was
I was printing {=*10}
instead the right form {"="*10}
that mistake generated my problem
I pass the string in the like print(f"The length of the set is {len(s) elements}")
So I just move my string out of and problem solved. print(f"The length of the set is {len(s)} elements")
I just spent 1 hour reviewing my code with the same issue. In my case I started removing parts of the code to narrow down the problem.
Finally I to the root cause of the problem.
in my case I was printing an f"string" and inside the f string I had a space in the name of the variable I was calling example print(f"This is a statement {Var 23} "
That space, generated my problem.
I hope this helps :)
it might also be that you have a python 3.8 compatible way of string formating, such as:
f"print{count=}"
which is not compatible with 3.6, 3.7.
In that case, you can either decide to require the user to upgrade to python3.8, or downgrade your code.