PDA

View Full Version : How to look at sorce code



microsoft92sucks
June 7th, 2007, 12:50 AM
I've been learning to program in python and once I get a lot better I want to make some game (along with other things). And I've heard a good way to learn how to program is looking at coding. so where can I go to download some games that were written in python and once I do that how would I look at all the coding?

microsoft92sucks
June 7th, 2007, 01:19 AM
I need GNU,Open source games of course.

Auria
June 7th, 2007, 01:45 AM
For learning, I dont recommend looking at existing games at all - their source code will probably be very big and intimidating to you...

you better read books and tutorials - you say "a good way to learn how to program is looking at coding"... this is right, but, and especially for a beginner, small examples. digging into the code of a big project can be very intimidating even for experienced programmers (or just look at very small games ;) i don't know any )

i think you can ind good resources here http://www.pygame.org/wiki/tutorials

building along tutorials will be more rewarding than getting lost in files of code.

unless I misundertsood your current level and you're no beginner

jfinkels
June 7th, 2007, 01:59 AM
Don't look at source code for large programs, that won't do you any good. I suggest thinking up a small application that might be useful to you and writing it! You can do pretty much anything you can dream up :D

microsoft92sucks
June 7th, 2007, 02:47 AM
Thanks and i'm still very much a noob I'm reading a online book right now to learn I'm about half way through it.

Lord Illidan
June 7th, 2007, 02:51 AM
Aye, I tried looking at programs once, and I gave up immediately..books are the way to go.

microsoft92sucks
June 7th, 2007, 04:10 AM
I still want to know how do I look at the source code of stuff like for all the GNU software that I have most if not all my software is GNU so how would I look at the code on any of it?

microsoft92sucks
June 7th, 2007, 04:23 AM
Sorry for my bad gramer.

Feba
June 7th, 2007, 04:24 AM
While you should listen to their advice, if you want to look at source code, look up "svn".

microsoft92sucks
June 7th, 2007, 08:01 AM
I am listing to them but I've always wanted to know how to look at source code.And I'll try looking up svn. Thanks

microsoft92sucks
June 7th, 2007, 08:17 AM
Looking up svn is'ent helping can you be more pacific.

WW
June 7th, 2007, 08:17 AM
Take a look at the games and demos at pygame.org (http://www.pygame.org/).

ankursethi
June 7th, 2007, 11:59 AM
There's a book which has some tips on reading source code called "Code Reading : The Open Source Perspective" which starts from basic UNIX apps like echo and goes up to the X server. You might find it helpful, though most of the examples in it are in C.

pmasiar
June 7th, 2007, 01:08 PM
After reading intro book, start with simple programs. Real programs (with GUI and error handling) might be too complicated for a beginner. After couple months, when you wrote and debug your own 500 line program, reading code of other people will suddenly become much easier. You will be able to see "patterns" and distinguish bigger chunks of the code.

But really deeply reading and understanding code of other people is hard, reading code is always slower that reading ie. sci-fi novel :-)

ssam
June 7th, 2007, 04:36 PM
to get the source code to any program in ubuntu you can run


apt-get source program_name

to get a list of all the ubuntu packages using pygame


apt-cache rdepends python-pygame

so pick one of those and run, for example


apt-get source singularity

cunawarit
June 8th, 2007, 12:09 AM
Looking up svn is'ent helping can you be more pacific.

svn is the client for Subversion.

Subversion is version control system, it is open source and just about everyone uses it (yep, even Microsoft heavy companies do). Many open source projects will tell you the URL for their repositories so you can download the source.

microsoft92sucks
June 8th, 2007, 04:41 AM
Thanks ssam now I get how this all work's.

microsoft92sucks
June 8th, 2007, 05:03 AM
Take a look at the games and demos at pygame.org (http://www.pygame.org/).
Thanks for this site there's lot's of Python source code here.