Why doesn't SublimeREPL accept undefined data types? (Issue inputting string)

54 Views Asked by At

I am trying to provide a simple input to a program using SublimeREPL on Sublime Text. Sample code below

print('Please print your name')
name = input()
print(name)

When I try to input my name via SublimeREPL as just

MyNameHere

I get the following error:

  File "input_test.py", line 2, in <module>
    name = input()
  File "<string>", line 1, in <module>
NameError: name 'MyNameHere' is not defined

however, if I input my name as a string such as

'MyNameHere'

I get no such error and the program prints my input. This program seems to work just fine in IDLE regardless of whether I define the input as a string or not. This seems to suggest to me that SublimeREPL cannot accept undefined data inputs? Is this an issue with SublimeREPL or is there something else I am missing?

1

There are 1 best solutions below

0
On

From a question edit:

This issue was caused due to misconfigured sublime text using python 2.x rather than python 3.x