There is another solution that still allows you to use Sublime's build systems, in case SublimeREPL doesn't exactly fit into your workflow. Create a new file with the following contents:
{
"cmd": ["start", "cmd", "/k", "c:/python33/python.exe", "$file"],
"selector": "source.python",
"shell": true,
"working_dir": "$file_dir"
}
and save it as Packages/User/Python_cmd.sublime-build
where Packages
is the folder opened when selecting Preferences -> Browse Packages...
- it should be %APPDATA%/Sublime Text 2/Packages
for you.
Next, go to Tools -> Build System
and select Python_cmd
down at the bottom, then switch to your .py
file and hit CtrlB to build. A new command line window will open, allowing you to input values to your heart's content. When the program is done, the window will remain open, allowing you to examine output, tracebacks, etc. Just close the window to return to Sublime.
I highly recommend SublimeREPL for interactive development, and running small bits of code, but there are definitely times when you want to interact with your program in a command-line environment. This build system allows you to do that, without switching over to an open command window and manually running python myprogram.py
every time you want to build.