Dive Into Python: The Perfect Python Tutorial

Forum organization and occasional community-building.
Forum rules
Questions about Ren'Py should go in the Ren'Py Questions and Announcements forum.
Post Reply
Message
Author
Friendbot2000
Regular
Posts: 161
Joined: Tue Feb 15, 2011 8:00 pm
Projects: Mutagen : Journey to Haven's Landing
Contact:

Dive Into Python: The Perfect Python Tutorial

#1 Post by Friendbot2000 »

As many of you know, Renpy is made from Python code with smatterings of Pygame intermixed with it. I first learned Python several years ago and I fell in love with it the first time I started a program. I know quite a few languages: C++, Java, HTML, CSS, Javascript, PHP, Visual Basic (and several variants of all those listed, yeah I was a programming geek in high school. Strangely I never took a Computer Science class). Out of all the ones I know, Python definitely comes out on top as my all time favorite. It is very simple and easy for the nonprogrammer to learn because it is basically like speaking. It isn't as complicated as C++ or Java, it is simple and REALLY easy to debug. For instance, if you compare a program made in Java and C++ to a program made with Python that does the exact same thing, you will find that the Python code is 30-50% shorter than the C++ or Java. This makes debugging much much easier, which saves you headaches. Anyways, the point of this post was to give you all an excellent resource if you are interested in learning Python. It will be useful in your games as well because you can interject Python code into your games to add greater functionality for things you want to do. Here is a linky to the resource: http://www.diveintopython.net/

This resource is a book that will give you a hands on approach to learning Python and it will explain step by step all the programs you will create. It shows you what everything does and even has sample programs that come with it so you can check your work. The book is an open source collaborative work by the Python community, just remember that the book only covers the 2.0 Python version (this includes updates ranging from 2.1-2.7, you will be wanting to use 2.7). The book is very easy to read and explains things perfectly and even provides links to other resources so you can get a better idea of what they are talking about if you need another source. This is the book I used to become fluent in Python (I am still working on learning Renpy, so used to more complicated programming structures. Pytom really did a great job of streamlining Renpy so it is accessible to mainstream users.) It is a great resource to learn and I want to share it with you all :)

Also, feel free to ask any questions if you get stuck on something. I have bookmarked this thread so I should get back to you pretty quickly, I kind of stalk this forum >.>
Visit my game development group's Facebook page : Timekeeper Games
Mutagen : Journey to Haven's Landing Facebook Page
Follow our Twitter feed too : TK Games

sciencewarrior
Veteran
Posts: 356
Joined: Tue Aug 12, 2008 12:02 pm
Projects: Valentine Square (writer) Spiral Destiny (programmer)
Location: The treacherous Brazilian Rainforest
Contact:

Re: Dive Into Python: The Perfect Python Tutorial

#2 Post by sciencewarrior »

Personally, I think a better Python tutorial for complete programming beginners is the aptly named Python Tutorial. You can download it with the Language Reference and the rest of the documentation here.
Keep your script in your Dropbox folder.
It allows you to share files with your team, keeps backups of previous versions, and is ridiculously easy to use.

Friendbot2000
Regular
Posts: 161
Joined: Tue Feb 15, 2011 8:00 pm
Projects: Mutagen : Journey to Haven's Landing
Contact:

Re: Dive Into Python: The Perfect Python Tutorial

#3 Post by Friendbot2000 »

I am going to disagree with you there. I always found that tutorial to be really poorly written and hard to understand. The Python documentation is notorious for really crappy writing...
Visit my game development group's Facebook page : Timekeeper Games
Mutagen : Journey to Haven's Landing Facebook Page
Follow our Twitter feed too : TK Games

User avatar
PyTom
Ren'Py Creator
Posts: 16093
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: Dive Into Python: The Perfect Python Tutorial

#4 Post by PyTom »

The Python Tutorial is fine - but it assumes you know how to program, and just want to learn Python. That might not be the case for everyone here.

I've heard good things about Invent your own Computer Games with Python, which might talk a bit more about game logic-type code:

http://inventwithpython.com/

(I haven't read it.)
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

User avatar
Chrizine
Regular
Posts: 178
Joined: Fri Nov 26, 2010 1:47 pm
Projects: Perios - Chained Sorceress (WIP), Sword vs. Staff (WIP)
Organization: Motdl Productions
Location: Currently Switzerland
Contact:

Re: Dive Into Python: The Perfect Python Tutorial

#5 Post by Chrizine »

Friendbot2000 wrote:As many of you know, Renpy is made from Python code with smatterings of Pygame intermixed with it. I first learned Python several years ago and I fell in love with it the first time I started a program. I know quite a few languages: C++, Java, HTML, CSS, Javascript, PHP, Visual Basic (and several variants of all those listed, yeah I was a programming geek in high school. Strangely I never took a Computer Science class). Out of all the ones I know, Python definitely comes out on top as my all time favorite. It is very simple and easy for the nonprogrammer to learn because it is basically like speaking. It isn't as complicated as C++ or Java, it is simple and REALLY easy to debug. For instance, if you compare a program made in Java and C++ to a program made with Python that does the exact same thing, you will find that the Python code is 30-50% shorter than the C++ or Java. This makes debugging much much easier, which saves you headaches. Anyways, the point of this post was to give you all an excellent resource if you are interested in learning Python. It will be useful in your games as well because you can interject Python code into your games to add greater functionality for things you want to do. Here is a linky to the resource: http://www.diveintopython.net/

This resource is a book that will give you a hands on approach to learning Python and it will explain step by step all the programs you will create. It shows you what everything does and even has sample programs that come with it so you can check your work. The book is an open source collaborative work by the Python community, just remember that the book only covers the 2.0 Python version (this includes updates ranging from 2.1-2.7, you will be wanting to use 2.7). The book is very easy to read and explains things perfectly and even provides links to other resources so you can get a better idea of what they are talking about if you need another source. This is the book I used to become fluent in Python (I am still working on learning Renpy, so used to more complicated programming structures. Pytom really did a great job of streamlining Renpy so it is accessible to mainstream users.) It is a great resource to learn and I want to share it with you all :)

Also, feel free to ask any questions if you get stuck on something. I have bookmarked this thread so I should get back to you pretty quickly, I kind of stalk this forum >.>
Well, thanks for posting this...
I just saw this thread, but I'm definitely going to try the tutorial. If it is as good as you say, it could help me a lot!
(Since, you know, my prof just thinks we all are able to program in python by some magic. Note: We did have a computer science lecture last semester, but it was all about learning C++. Yeah, and now we are supposed to use python without any kind of introduction to it. It is possible though, because most things we do only use a lot of numpy arrays... But still, I'd like to approach this differently, it's kinda unsatisfying.)
Do you know numpy and scipy by any chance? (Especially, scipy.sparse?) - If so, I think I will come back on your offer to answer questions ;)

Edit: I started reading it now... :)
There's text.
Explanations.
Not only examples.
It says to document your functions. (I sometimes want to kill the guy who writes the templates, that are supposed to help us, for not doing this! If only I knew who is this person...)
It's written in a way that feels like someone explaining things to you.
=> I love it. (Though I only read one chapter (2) yet. But until now, it is great.)
Take a look at Perios - Chained Sorceress!
And also on Sword vs. Staff, my short new project...
And, of course, our blog!
Honest Critique

Post Reply

Who is online

Users browsing this forum: No registered users