Skip to main content
 首页 » 编程设计

python之找不到我的 Python 3.3 语法错误

2025年05月04日17yxwkf

<分区>

我收到以下错误:

  File "foo.py", line 6 
    print "This implementation requires the numpy module." 
                                                         ^ 
SyntaxError: invalid syntax 

在这段 Python 代码中:

#!/usr/bin/python 
 
try: 
    import numpy 
except: 
    print "This implementation requires the numpy module." 
    exit(0) 
 
############################################################################### 
 
if __name__ == "__main__": 
    R = [ 
         [1,2,3], 
         [4,5,6] 
        ] 

怎么了?

编辑:我使用 Python 3.3