Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Python print statement ambiguity

I am running the following print statement in a file test.py within the Eclipse PyDev environment which gives the required output:

print(f"Epoch {j}: {self.evaluate(test_data)} / {n_test}")

However, when I attempt to run the same code from the file at the command prompt (OSX Terminal), I get the following

% python test.py
Traceback (most recent call last):
  File "test.py", line 7, in <module>
    import simple_nn
  File "/Users/davidklemitz/eclipse-workspace/_neural/simple_nn.py", line 47
    print(f"Epoch {j}: {self.evaluate(test_data)} / {n_test}")
                                                            ^
SyntaxError: invalid syntax

Anybody have some clues to resolve the issue, thanks ?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

Looks like you use two different python versions in Eclipse and your terminal. Try

python3 test.py

in your terminal

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading