Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Ok so I have decided to delve into the realms of casual coding and I have been told Python is a great language for beginners like myself. I know (not really sure though) the Python interpreter is included by default in Ubuntu but plan to install the IDLE GUI as my Python GUI. What else do I need to do to make my 12.04 set-up a true Python development environment?

share|improve this question
    
A quick tip, python IDLE GUI is cool for testing some code snippets.Though its not at all practical to do any serious development on it.Most developer prefer command line. Its more robust and speedy. –  Vinit Jun 21 '12 at 19:24

6 Answers 6

up vote 5 down vote accepted

In Ubuntu 12.04 Python 2.7.3 is already pre-installed

Take a look at the Ubuntu Software Center -> Developer Tools -> Python There you can find IDLE or SPE, which are both good development environments. They should work out of the box. There are also Plugins available for Eclipse and Netbeans.

if you want to use the newest version of Python take a look at this website

http://www.python.org/download/releases/3.2.3/

share|improve this answer

There is a good video here on YouTube about how to write a python program for Ubuntu using Quickly. The example shows how to create a quick browser.

It uses whatever editor you have configured, such as gedit or vim.

share|improve this answer

There are a lot of different development evironments. You can simply use the text editor of your choice. Most of them, like the integrated gedit have syntax highlighting. You can then simply run your program with python. There is no need for compiling. You could also use an integrated developer environment (IDE). Those give you a little more support in coding. Take a look at this list. I prefer eclipse with the PyDev plugin.

For starters create a file myProgram.py and open it wiht gedit. Write your program in that file, just google for some tutorials. After the first few lines of code gedit will recognize you're writing python and starts to highlight the syntax. If you're done open a terminal, change to the folder where your program is saved and start it with python myProgram.py. Python is a interpreted language so the code can be executed directly. In some other languages you have to compile your source code first. It then creates an binary file you can execute. But you don't have to bother with that if you use python.

Hope that helps a little, if you want more detailed information just ask :-)

share|improve this answer
    
More details please. The closest I have come to programming is QBASIC :D –  Mysterio Jun 21 '12 at 17:38
    
I've added some details. Just take another looks if it helps. –  André Stannek Jun 21 '12 at 17:47

I tried IDLE but after a bit I found that a better development environment was using Eclipse with the pydev plugin. Eclipse can be gotten using the software center or from apt-get install. The plugin is easy to add by starting Eclipse and going

http://www.eclipse.org/

http://pydev.org/

share|improve this answer

sudo apt-get install python should do it. (although this is usually already installed)

Then you can just create your python code in some folder as .py files, and then do python /path/to/the/python/script.py.

share|improve this answer
    
What about IDLE because I don't want to be coding from the terminal.. Is it really true that Python is noob-friendly ?? –  Mysterio Jun 21 '12 at 17:32
    
its pretty straight forward. I've never used IDLE, i've used Stani's Python Editor, but I dont know if its in the repositories. Dr Python's not a bad IDE either (i think that's still in the repos, but i dont remember what package it is). As for running the python code, I think SPE can do it, idk about DrPython. (I just run it all in Terminal) –  Thomas W. Jun 21 '12 at 17:45
    
Does that command automatically install the latest version of Python? What can I do to get 2.x? –  sodiumnitrate Jul 31 at 21:07
    
If 2.x isn't available on the version of Ubuntu you are on you'll have to use either a PPA with an older version or compile the older version yourself. There's no guarantee the IDEs will install a version of Python either so you should always check and install a version to use yourself. –  Thomas W. Jul 31 at 21:08

Ubuntu has Python installed by default. Python IDLE is good for checking some snippets of code but it is not very good for doing some serious work. I recommend installing ipython for doing some command line exploration.

Well, in order to setup an IDE you could choose between Sublime Text 2(highly recommended) and Vim. You could use my dotfiles for both the editors:

Both of these dotfiles have all the plugins, linters installed and would be excellent place for you to start with. Hope this helps you.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.