我在 Eclipse PyDev 環境中的檔案 test.py 中運行以下列印陳述句,它提供了所需的輸出:
print(f"Epoch {j}: {self.evaluate(test_data)} / {n_test}")
但是,當我嘗試在命令提示符(OSX 終端)中從檔案中運行相同的代碼時,我得到以下資訊
% 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
有人有解決問題的線索嗎,謝謝?
uj5u.com熱心網友回復:
看起來您在 Eclipse 和終端中使用了兩個不同的 python 版本。嘗試
python3 test.py
在你的終端
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/414648.html
標籤:
下一篇:無法安裝pyserial
