PDA

View Full Version : [ubuntu] Python Interpreter



TzaB
June 27th, 2008, 03:00 PM
Hello, i want to learn Python and for this reason i need the Python Interpreter. I visited the official site of Python (python.org) and i did what this page (http://wiki.python.org/moin/BeginnersGuide/Download) say about, and i installed the 2 packages. But now what i have to do to open the Interpreter? :P

For example, i opened the Add/Remove and from Programming i installed the Screem HTML/XML Editor. At Application now, there is a category with the name Programming and has the Screem Editor. I think that there i have to find the Python Interpreter but it isnt listed.

I am new at Linux and i don't know basic things :(
If you can answer. Thanks.

tamoneya
June 27th, 2008, 03:02 PM
go into terminal (applications -> accessories -> terminal) and type
python

TzaB
June 27th, 2008, 03:06 PM
Ok i did it. And this is what i get


Python 2.5.2 (r252:60911, Apr 21 2008, 11:12:42)
[GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>


This is the Python Interpreter?

wrtpeeps
June 27th, 2008, 03:08 PM
Yes. YOu can type python code there and it gets executed instantly.

It's good for learning at the start (the python.org docs will tell you more about it)

tamoneya
June 27th, 2008, 03:10 PM
the other way to invoke the python interpreter is to write some code in a file, lets say /home/username/myprogram.py. You pass the file to the interpreter and your code will be run.
python /home/username/myprogram.py

TzaB
June 27th, 2008, 03:11 PM
Ah ok thanks. I thought that it was a bit different. For example like the Screem HTML/XML Editor. Not in a shell.

conscious
June 27th, 2008, 03:46 PM
It looks like you're looking for a Python-capable IDE. There's a plenty of advice on this here: http://www.google.ru/search?q=python+ide+site%3Aubuntuforums.org, people are suggesting IDLE, SPE, gedit + plugins, Eclipse + PyDev, Eric among other things (and emacs and vim, of course). (And a couple of FAQ's: 1 (http://ubuntuforums.org/showthread.php?t=832449) 2 (http://ubuntuforums.org/showthread.php?t=752224))

TzaB
June 27th, 2008, 06:22 PM
Thanks for the help guys :)
I think that now i can do a good start with Python (my first programming language by the way)
I am reading the documents that i found from the python.org and i am doing tests with the python interpreter at shell and with the IDLE.

Later (in some days) i will check the links that conscious gave.

Have a good day !!