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

Python Object-Oriented Python (retired) Objects Creating Instances

How to Use sublime text 3 editor for python

Hi i am using windows 7 with sublime text 3 editor i do not want to use online workspace so please let me know how to run python using sublime text 3 editor everything in details

thanks

2 Answers

William Li
PLUS
William Li
Courses Plus Student 26,868 Points

First, Python 3 needs to be downloaded and installed, (obviously).

Then, fires up Sublime text 3, writes some code, and, [VERY important] saves the file somewhere by giving it the name ******.py.

After the file is saved, from the Tools menu in ST3, there's a Build option, or Ctrl+b via keyboard shortcut. It will build and run your Python code, the result is outputted in a lower panel.

That's pretty much it.

Thanks and it works but when ask for query in run it do not replay as per tutorial in workspace it idose replay so it just only run for ex; when we ask for color it does reply with color name but didnt work

thanks a lot for needful help

William Li
William Li
Courses Plus Student 26,868 Points

Hi Tejas,

Please keep in mind that the Workspace we used in TeamTreehouse here isn't just a Text Editor, it's a text editor + a Terminal. On a Mac or Linux, with little bit of setup, we can easily replicate Workspace's feature by using any Text editor and the system's built-in Terminal. For Windows user however, there's no Terminal, it has its own CMD, which is an entirely different thing. But I read that there're some alternative solutions to that, http://www.howtogeek.com/249966/how-to-install-and-use-the-linux-bash-shell-on-windows-10/, I haven't tried it out.

Sublime Text is a standalone Text Editor, and there's limitation on what it can do. For example, ST can't accept user input during program execution, for Python or any other languages, and I don't believe there's a plug-ins or ST packages that allow you to bypass this limitation. If you're open-minded about what tools to use for writing Python code, try out some Python IDEs, they are very powerful and have pretty much all the features Python programmers could ever dream of.

Dear Mr William

Thanks a lot for your quick reply very helpful Appreciable

Thanks again