Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

General Discussion

Using Python in Sublime2 / 3

I've been trying to use Python in sublimetext 2 / 3 but it always gives me an error message(different ones). Can anyone tell me the steps on how to install and use python in sublimetext 2 / 3 correctly?

3 Answers

What do You mean by "use Python in sublimetext 2/3" ? Sublimetext is just code editor and it's just highlighting your code syntax to make it easier to read. If you have .py files you can open it in sublimetext and edit it ;) If you want to use python you can open system console and type "python" and you will be in python shell where you can write python code.

Yeah I know :D I mean the way to use my program in sublimetext in this little window at the bottom.

Can you copy and paste the error message here? Also check Tools > Build System if you can see if Python is there to select?

Everything is set up for Python, this isn't the problem. I tried a simple program like this one:

def Test():
    question = input("Do you like potatos?")
    if question == "no":
        print("Why?")
    elif question == "yes":
        print("Nice!")
    else:
        print("I don't understand your answer.")

Test()

Error message: Do you like potatos?Traceback (most recent call last): File "C:\Users\Julian\Desktop\Informatik_Privat\Python Programme\Test.py", line 11, in <module> Test() File "C:\Users\Julian\Desktop\Informatik_Privat\Python Programme\Test.py", line 3, in Test question = input("Do you like potatos?") EOFError: EOF when reading a line [Finished in 0.1s with exit code 1] [shell_cmd: python -u "C:\Users\Julian\Desktop\Informatik_Privat\Python Programme\Test.py"] [dir: C:\Users\Julian\Desktop\Informatik_Privat\Python Programme] [path: C:\Python34\;C:\Python34\Scripts;C:\ProgramData\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;D:\Programme (x86)\Phone]

This is just one of many error messages I get when I try to use my written programm :(

Ah ok. You mentioned Sublime as topic so.. Don't know exactly how to solve your code problem. At first glance it seems to be missing a return statement at the end? I'm also still learning ;)