When I try to use a print
statement in Python, it gives me this error:
>>> print \"Hello, World!\"
File \"\", line 1
I could also just add that I knew everything about the syntax change between Python2.7
and Python3
, and my code was correctly written as print("string")
and even
print(f"string")
...
But after some time of debugging I realized that my bash script was calling python like:
python file_name.py
which had the effect of calling my python script by default using python2.7
which gave the error. So I changed my bash script to:
python3 file_name.py
which of coarse uses python3 to run the script which fixed the error.