I have been using Sublime Text 2 for over a year and recently started using it for Python. Sublime has a built it build for Python which I tried using (the built in one is for 2.7.3 or something 2.X I believe). I am using Python 3.3.0. I already edited the sublime-build file and changed it to:
{
"cmd": ["python3", "-u", "$file"],
"file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
"selector": "source.python"
}
As suggested on stackoverflow on another thread. I tried restarting sublime and trying to run my code:
x = input("Name: ")
print("Welcome " + x)
input()
But at the console at the bottom I get the following error when I run with build (Ctrl+B):
Name: Traceback (most recent call last):
File "/home/andrew/grive/Documents/RandomProjects/PythonStuff/HelloWorld.py", line 32,
in <module>
x = input("Name: ")
EOFError: EOF when reading a line
[Finished in 0.1s with exit code 1]
Also, I tried to bypass the built in build function by just using SublimeREPL and the Python functions in that, but they also detect my Python build to be 2.7.3 thus not compiling my 3.3.0 code. Note that I do have Python 3 installed, I am using Ubuntu and when I type “python3” in the terminal Python is launched in the terminal with the correct version.
So I have two questions:
Why is my python3.sublime-build not working and how can I fix it?
And since I am a linux noob, I am having trouble accessing the build files. I got to them once but I forgot how now. They are in /home/~.config/sublime-text-2/ etc etc etc.
I cannot see the .config file, for bonus points could you explain how this works?
Your problem is that the sublimetext builds cannot take user input – there is no input stream connected. Your Python version is irrelevant.
However, it’s possible to write a plugin to take input!
As for the config files, just use the “preferences -> browse packages” menu item.