Sublime text 2 error: When building game

2019-03-05 10:03发布

I keep getting this error

Welcome to Tic Tac Toe
Do you want to be X or O?
Traceback (most recent call last):
  File "C:\Python27\last try.py", line 145, in <module>
    playerLetter, computerLetter = inputPlayerLetter()
  File "C:\Python27\last try.py", line 27, in inputPlayerLetter
    letter = input().upper()
EOFError: EOF when reading a line
Finished in 0.2s with exit code 1

When I put in the code to a python tic tac toe game. Can some one please help?!

The code for the tic tac toe game is from http://inventwithpython.com/tictactoe.py

note: I tried installing and configuring sublimerepl and it doesn't solve the problem.

1条回答
我欲成王,谁敢阻挡
2楼-- · 2019-03-05 10:42

You need to run the code in a terminal, because the input() function is asking you to enter some text.

The Sublime environment is not sufficient.

查看更多
登录 后发表回答