我正在尝试学习Python,并试图在终端中执行python文件.我在我的OS X上使用2.7.3 python版本.我已经将终端中的目录更改为文件所在的位置,但是我在终端中收到错误:
>>> python ex1.py
File "<stdin>", line 1
python ex1.py
^
SyntaxError: invalid syntax
Run Code Online (Sandbox Code Playgroud)
ex1.py文件包含:
print "Hello World!"
print "Hello Again"
print "I like typing this."
print "This is fun."
print 'Yay! Printing.'
print "I'd much rather you 'not'."
print 'I "said" do not touch this.'
Run Code Online (Sandbox Code Playgroud)
有想法该怎么解决这个吗?好一堆.
python-2.7 ×1