Omnimaga

General Discussion => Technology and Development => Computer Programming => Topic started by: parserp on September 19, 2011, 12:56:06 am

Title: Linux python
Post by: parserp on September 19, 2011, 12:56:06 am
I have just decided to learn python with my father. So my question is:
what are the things that I have to do in order to get python to work on my linux computer?
Is there something that the computer allready comes with, or do you have to download something?
Note: the computer's OS is open suse 11.1... I am pretty sure.
Title: Re: Linux python
Post by: Michael_Lee on September 19, 2011, 01:25:58 am
I'm 90% percent sure you already have Python.

Try typing in 'python' in your terminal, and see if it spasms.

If you don't have Python installed by default, just download a copy of Python from whatever repository you use or directly from Python's website.

The default IDE is called IDLE, and it works fine, but it looks like crap on Linux boxes, so you might want to consider getting a different IDE if that sort of thing bothers you (I like Geany, myself).


Title: Re: Linux python
Post by: Munchor on September 19, 2011, 09:38:09 am
I have just decided to learn python with my father. So my question is:
what are the things that I have to do in order to get python to work on my linux computer?
Is there something that the computer allready comes with, or do you have to download something?
Note: the computer's OS is open suse 11.1... I am pretty sure.

OpenSUSE? You can install packages named "python" and "python-idle". "python2.6", "python2.7", etc should also be available.

The Python IDLE was not made for Linux, it was made with Windows in mind, because of its crappy console. On Linux, I recommend you just use the terminal, because it's very good.

To make a file use a text editor (vim, nano, emacs, gedit, geany, etc), and then to run the file use:

Code: [Select]
python name_of_file.py

Good luck!
Title: Re: Linux python
Post by: LincolnB on September 19, 2011, 10:03:29 am
Hey, good luck. Most Linux distros come with Python pre-installed. I know Ubuntu does, and that's the only linux I've used, so yeah.
Title: Re: Linux python
Post by: Munchor on September 19, 2011, 12:59:58 pm
Hey, good luck. Most Linux distros come with Python pre-installed. I know Ubuntu does, and that's the only linux I've used, so yeah.

In fact, most of them *have to* because A LOT of programs use python and thus linux distros have python pre-installed for program compatibility, unlike *cough* Microsoft *cough*.
Title: Re: Linux python
Post by: parserp on September 19, 2011, 03:34:54 pm
Sweet, it does come with it installed... I just did it in the terminal.
But how do you execute the programs? I know that they are interpreted, but from where do you run them?
 ???
Title: Re: Linux python
Post by: Michael_Lee on September 19, 2011, 06:03:35 pm
If you write a script named 'test.py', navigate using the terminal to the folder containing the file, then type in 'python test.py'.

Title: Re: Linux python
Post by: flyingfisch on September 19, 2011, 06:11:29 pm
If you want to know where you can learn python, here you go: http://www.khanacademy.org/#computer-science
Title: Re: Linux python
Post by: parserp on September 19, 2011, 06:34:43 pm
Awesome! thank you. now the real work begins... ;)
Title: Re: Linux python
Post by: flyingfisch on September 19, 2011, 06:42:05 pm
and you may want to use pyscripter: http://code.google.com/p/pyscripter/downloads/list

screenie:

(http://pyscripter.googlecode.com/svn/wiki/images/screenshot1.png)
Title: Re: Linux python
Post by: Deep Toaster on September 25, 2011, 12:28:22 am
and you may want to use pyscripter: http://code.google.com/p/pyscripter/downloads/list
That seems to be for Windows ???