I followed the instructions on the following short video to allow Python scripts to be run in Sublime Text.
https://www.youtube.com/watch?v=-d27eACbjnk
Steps were:
- Install 'Package Control'
- Install 'SublimeREPL'
- Choose 'Tools > Build System > Build New System'
- Paste the following:
{
"target":"run_existing_window_command",
"id":"repl_python_run",
"file":"config/python/Main.sublime-menu"
}
- Save as 'Python_Run' and close tab
- Open a new tab and save as 'test.py'
- Choose 'Tools > Build System > Python_Run'
- Paste the following text code:
name = input("Enter your name: ")
print(name)
Choose 'Tools > Build' to run.
Enter name as prompted.
However, when I enter a name, I receive the following NameError message:
Enter your name: Sean
Traceback (most recent call last):
File "test.py", line 1, in <module>
name = input("Enter your name: ")
File "<string>", line 1, in <module>
NameError: name 'Sean' is not defined
I have found the only way around this is to enter the name in inverted commas. BUT the linked video demonstrates the above working without the need to use inverted commas for the input.
I'm new to Python and Sublime so hoping for an easy-to-understand fix.