Simple Practice Programs

B

Brian Martin

If I have gone through several beginner python tuts and understand
basics, what's next?
It seems there are very many very beginning tutorials but after that
there is a large absence as far as tutorials. Any suggestions for a
simple program to write?

--Brian
 
P

Peter Hansen

Brian said:
If I have gone through several beginner python tuts and understand
basics, what's next?
It seems there are very many very beginning tutorials but after that
there is a large absence as far as tutorials. Any suggestions for a
simple program to write?

The best simple program to write is always (IMHO) the one which
actually gives you back some value. What do _you_ want to use
your programming skills for? Pick some particular task that you
want to automate (CD collection, waking you up in the morning,
whatever) or a game idea you have or the world's Next Great
Editor or something, and start writing it.

A couple of universal truths exist though:

1. You won't actually ever finish it. Don't let that stop you.

2. You'll learn an awful lot more than if you just follow
someone else's idea of what I envision you mean by "practice program".

A slight variation on this approach is also a good one. At
least, it's how I started out(*) when I was much younger and I
think it would still work well, especially with a language
like Python. Find a cool game, perhaps written with PyGame,
and start hacking away on it. Give yourself unlimited lives,
or add a new level, or just muck around in the guts of it
trying to figure out what a particular routine does and how
it does it. Since you're working with real code, you'll
learn how to work with real code instead of "laboratory"
code that you might find in a practice program but never
in the real world.

-Peter

(*) More specifically, it was a Star Trek game written in
BASIC on a CBM 8032, with little asterisks and hash symbols
that fired little slashes and hyphens at each other across a
10x10 sector of periods.... great fun at the time.
 
B

Brian van den Broek

Peter Hansen said unto the world upon 29/06/2004 00:23:
The best simple program to write is always (IMHO) the one which
actually gives you back some value. What do _you_ want to use
your programming skills for? Pick some particular task that you
want to automate (CD collection, waking you up in the morning,
whatever) or a game idea you have or the world's Next Great
Editor or something, and start writing it.

A couple of universal truths exist though:

1. You won't actually ever finish it. Don't let that stop you.

2. You'll learn an awful lot more than if you just follow
someone else's idea of what I envision you mean by "practice program".

<SNIP>

Hi all,

Unlike Peter, I count my programming experience in months, not years. :)

The advice above (and the snipped alternative, too) seem good counsel. At
first, though, many of the things that I would want to be able to program
seemed a bit too big to me. If that is where you are, I'd suggest you pick
one or two (reasonably) small things on your computer that bug you and
make them better. I at least was helped by aiming at a few fairly small
such tasks.

An example from my learning: I have a proprietary information management
application which exports files to a multi-directory HTML file system. The
HTML is really messy, defaults to opening links in new browser, and a
bunch of other stuff that bugs me. So I wrote a Python script to walk the
tree and fix the HTML, etc. issues. I learned a lot. (Enough so I now have
taken on one of the sort of "you are not going to finish that" projects
that Peter recommends.) A task where you can learn a few aspects rather
than try to mix together all the things you've read about is what helped
me anyway.

Last, in case you didn't know, there is a similar thread on the Tutor list
right now. (And if you are learning, that's a good list to read and post
to; very patient folks :)

Best to all,

Brian vdB
 
T

Thomas Guettler

Am Mon, 28 Jun 2004 21:12:50 +0000 schrieb Brian Martin:
If I have gone through several beginner python tuts and understand
basics, what's next?
It seems there are very many very beginning tutorials but after that
there is a large absence as far as tutorials. Any suggestions for a
simple program to write?

Hi,

Try to find
a problem you want to solve. Then look up
the relevant parts in the standard library
(xml, httplib, email, ...)

Have a look at the python cookbook:
http://aspn.activestate.com/ASPN/Python/Cookbook/
There are several small code examples.

Regards,
Thomas
 
C

Cousin Stanley

....
(*) More specifically, it was a Star Trek game written in
BASIC on a CBM 8032, with little asterisks and hash symbols
that fired little slashes and hyphens at each other across a
10x10 sector of periods.... great fun at the time.

An MBasic Star Trek version along with MBasic
that looks very similar to one I played
occasionally under IBM VM/CMS back in
the middle 1970s ....

http://www.issue.org.uk/ .... startrek.zip

I found this only yesterday when someone in another NG
mentioned it and thought it might make a good candidate
for conversion to Python ....
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,202
Messages
2,571,057
Members
47,661
Latest member
FloridaHan

Latest Threads

Top