i am a beginner in ubuntu i want to program in pythin just give me tips how to start

Asked by rafay on 2010-03-16

i am a beginner in ubuntu i want to program in python just give me tips how to start

Question information

English Edit question
Ubuntu gnome-terminal Edit question
No assignee Edit question
Last query:
Last reply:
arochester (arochester) said : #2

Full Circle Magazine, a FREE pdf download, has been running a series on programming in Python. The first was in Issue 27 here: http://fullcirclemagazine.org/issue-27/

They are currently on article number 8.

The magazine is available in different languages.

Vikram Dhillon (dhillon-v10) said : #3

On Tue, Mar 16, 2010 at 07:07:43PM -0000, rafay wrote:
> New question #104553 on gnome-terminal in ubuntu:
> https://answers.launchpad.net/ubuntu/+source/gnome-terminal/+question/104553
> i am a beginner in ubuntu i want to program in python just give me tips how to start

The best way to learn python is to get some books, there are some pretty good ones out online that you can download as ebooks for free and that's good and some others that you can may be perhaps buy. Also look around at a project you care about that's in python (for example myhdl) and then start looking at the code as you learn, you will get really good soon :)

Vikram Dhillon

A Computer Engineer was asked by his five-year-old son: "Dad, what is Windows 95?".
"Well, it's 32-bit extensions and a graphical shell for a 16-bit patch to an 8-bit operating system originally coded for a 4-bit microprocessor, written by a 2-bit company that can't stand 1 bit of competition."

Larry Jordan (larryjor) said : #4

     Thanks, arochester. I checked out the article and the magazine, and seemed pretty nice to me. Hope it is what rafay is looking for. I started with BASH, doing shell programming, myself, but Python seems to be one of the biggies now.

I find that learners are most satisfied when they get some fairly immediate, concrete and visible results from learning a small amount of programming.

Python is a good candidate for novices because it provides good graphical frameworks which enable you rapidly to get things moving on the screen, but it is not a toy language, and is mature enough that there are libraries to do almost anything if you want to get advanced.

If I were advising you where to start, I would begin with pygame, which has loads of tutorials and examples (don't take any notice of the April fools news article on their frontpage), and is used by a lot of people to produce moving graphics, text and interactivity with very little code.

You can install the python-pygame package from Synaptic, or type...
sudo apt-get install python-pygame
...in a terminal to install it.

After you've installed python-pygame you can visit this URL in your browser...
...which gives you a full introduction to the system and programming tutorials for simple games.

I have found the Komodo edit program to be a good authoring tool.

Note, my suggestions get more advanced from here on in. You won't be able to do all of these things until you've done a good number of online python tutorials.

If you want to play some games which people have already programmed in pygame on your linux box, then type

apt-cache rdepends python-pygame

in a terminal. This lists all the packages, mostly games, which depend on pygame to run. Because these are all open source, you can read the source files for each one too although you will need to invest a decent amount of learning time before these will all make sense to you.

For example...

sudo apt-get install slingshot

...will install the slingshot game, and...

dpkg-query --listfiles slingshot

...shows you all the source files which make that game run.

There is a community of people making games out there with this framework, e.g. look at this game and the sidebar full of other offerings

Equally, you can see the code of python-pygame itself, including all the documentation and tutorial goodies which are included.

dpkg-query --listfiles python-pygame

As you develop as a programmer, you'll be able to migrate to windowing and eventing toolkits like PyQt or PySide to get access to full-fledged, cross-platform windowing toolkits, Pyglet for access to rendering with OpenGL acceleration, 3D objects, and media playback, and many more bindings to established native libraries which do powerful things on Mac, Linux and Windows, without having to change your language, just make different module imports to get access to those extra functions. It sometimes seems like a miracle.

Good luck.

Can you help with this problem?

Provide an answer of your own, or ask rafay for more information if necessary.

To post a message you must log in.