PDA

View Full Version : So many things to learn. My head hurts. Python



Bodsda
August 17th, 2008, 12:15 PM
Ive been learning/attempting to learn python now for a few months. I started off by reading the python tutorial, and reading the stuff in peoples sigs (many thanks to LaRoza & pmasiar for their sigs) which has helped a great deal.

I then started writing a few very small programs just for my own experience, such as hangman and a phone book(that didnt go very well) with various success rates.

Now im sort of stuck, If i read through a noobie python document/book i get bored very quickly because i know/understand most of it, and if i read an intermediate one I get totally confused and give up.

What can i do? i need something between noob and intermediate. Any suggestions would be greatly appreciated.

Thanks

Bodsda

samjh
August 17th, 2008, 12:29 PM
What "intermediate" ones have you read?

One thing I quite enjoyed when learning Python was doing these:
http://www.pythonchallenge.com/

You need to use a bit of lateral thinking for some tasks, but have a go. It's quite fun, and will make you poke into parts of Python you might not otherwise explore. :)

Lster
August 17th, 2008, 12:36 PM
I would recommend Project Euler or similar (like samjh posted):

http://projecteuler.net/index.php?section=problems

The challenges start off quite easy and slowly get harder. By problem 200, some of the challenges are amazingly hard. It will certainly take you from beginner to intermediate, and if you keep on with it you should become very experienced.

From the "About" page:


The problems range in difficulty and for many the experience is inductive chain learning. That is, by solving one problem it will expose you to a new concept that allows you to undertake a previously inaccessible problem. So the determined participant will slowly but surely work his/her way through every problem.

Bodsda
August 17th, 2008, 12:38 PM
@ Samjh

One problem i have encountered is finding out which parts of python i need to poke around in, eg i once thought about making an irc bot, there is amazingly very little information online for this matter, and as i didnt know what modules to look in i just nabbed someon else's source code (with permission)

Dive into python
Byte of python

noob stuff = print statements and inputs
intermediate = dictionaries, lists, functions etc

at least thats how i see it, and how my first post was orientated.

@ Lster

Thanks for the link, il def check it out, it sound like exactly what im looking for

M_the_C
August 17th, 2008, 12:39 PM
What "intermediate" ones have you read?

One thing I quite enjoyed when learning Python was doing these:
http://www.pythonchallenge.com/

You need to use a bit of lateral thinking for some tasks, but have a go. It's quite fun, and will make you poke into parts of Python you might not otherwise explore. :)Seconded. I am a beginner myself, but have increased my knowledge by working through some of those challenges. The best part is if you visit the hints section in their forum, someone usually mentions what commands to learn, so you just look them up and try to apply them.

Also, for a phone book, this is a great article on re (Regular Expressions) and part 7.6 deals with accepting varying styles of phone number. (dash separators, space separators, no spaces, etc.) I haven't actually tried, but it shouldn't be too hard to get a simple CLI phone book with that. Linky. (http://diveintopython.org/regular_expressions/index.html)

Bodsda
August 17th, 2008, 12:42 PM
Wow, thanks a lot. I always wanted to learn python to make life easier for me and others, so a phone book is a good first step i think. Thanks a lot guys

Kadrus
August 17th, 2008, 12:46 PM
What can i do? i need something between noob and intermediate. Any suggestions would be greatly appreciated.
Have you checked the Python Wiki (http://wiki.python.org/moin/)?
It has many links and tutorials for Python Beginners,and for everything Python related.Give the wiki a try and it might help.

samjh
August 17th, 2008, 12:47 PM
@ Samjh

One problem i have encountered is finding out which parts of python i need to poke around in, eg i once thought about making an irc bot, there is amazingly very little information online for this matter, and as i didnt know what modules to look in i just nabbed someon else's source code (with permission)

Google is a wonderful sifter of information. For example, if you're interested in an IRC bot written in Python, try:

Python irc botin Google. One of the top results is http://www.osix.net/modules/article/?id=780 a simple IRC bot written in Python! It even walks you through the lines of the program. :)

For tutorials, this one will get you from novice to intermediate:
http://en.wikibooks.org/wiki/Non-Programmer%27s_Tutorial_for_Python

Bachstelze
August 17th, 2008, 12:47 PM
What I would recommend is going through the Python Tutorial (http://docs.python.org/tut/tut.html) from A to Z without skipping parts that seem obvious. Even if you know what a chapter deals about, chances are you will still learn important things in it.

After you have read and understood all of that, I guess you'll be able do to quite a lot of things.

Bodsda
August 17th, 2008, 12:55 PM
Google is a wonderful sifter of information. For example, if you're interested in an IRC bot written in Python, try:

Python irc botin Google. One of the top results is http://www.osix.net/modules/article/?id=780 a simple IRC bot written in Python! It even walks you through the lines of the program. :)

I found this before actually, but i wasn't knowledgeable enough to understand it, now i think i get most of it, thanks


What I would recommend is going through the Python Tutorial from A to Z without skipping parts that seem obvious. Even if you know what a chapter deals about, chances are you will still learn important things in it.

After you have read and understood all of that, I guess you'll be able do to quite a lot of things.

I have tried this a few times, usually i get frustrated at not understanding it, but i guess i could start reading then ask questions here if i dont get any of it, thanks guys

adamogardner
August 17th, 2008, 02:22 PM
I have been trying to start python but was having difficulty gaining momentum. That is until I bought "learning Python" by mark lutz under O'REILLY publisher. I find it easier to absorb information off of paper, and the book is written excellently. It may be useful. I could not have accomplished so little from nothing so quickly without it.
This is an excellent thread.

pmasiar
August 17th, 2008, 04:38 PM
Programming is craft: you learn it by doing it (and failing, and learning from failures). But IRC bot is way too complicated for beginner.

You need to solve problems. No amount of reading will make you programmer. See
http://learnpython.pbwiki.com/TasksBeginners http://learnpython.pbwiki.com/TasksAdvanced and more on my wiki

Project Euler can be solved using mathematic understanding of the problem (like sum of N numbers is (N+1)*N/2, but solve them without those tricks, using programming.

Qtips
August 17th, 2008, 06:17 PM
Like i say to everyone, try the book : Python programming - An introduction to computer science by John Zelle. It's a good book, very well explained with a bunch of exercise to practice of varied difficulty. You should try it. After this, you can move on to the next level with Learning Python by Mark Lutz.

That's my path so far, and i'm pretty confident with Python now. In fact, i attempt to do the project Euler with Python.

Good luck !

Keep trying Python, it's worth it !

Bodsda
August 17th, 2008, 06:36 PM
Like i say to everyone, try the book : Python programming - An introduction to computer science by John Zelle. It's a good book, very well explained with a bunch of exercise to practice of varied difficulty. You should try it. After this, you can move on to the next level with Learning Python by Mark Lutz.

That's my path so far, and i'm pretty confident with Python now. In fact, i attempt to do the project Euler with Python.

Good luck !

Keep trying Python, it's worth it !

I have that book, and frankly its not good at teaching python. Teaching computer science theories and ways of thinking yes, python no.