[Tutor] Practice sets for newbies

Michael Janssen Janssen@rz.uni-frankfurt.de
Tue Feb 25 16:18:16 2003


On Tue, 25 Feb 2003 riex@ligbr.com.br wrote:

>
> Hello, tutor,
> I wonder if there are any practice tutorial sets for things like
> loops,lists, the use of modules, and etc.

nice idea :-)

You did have access to a computer? Take it as your set of practice
problems ;-)

I have no problems in constantly finding problems that are worth to solve
(more or less ;-) and worth to do it in python (but I suppose the gurus
from comp.unix.shell could replace any of my scripts with very small
shell scripts ;-).

It feels odd to me to suggest single tasks but nonetheless:

1. general tips:

* Simple practice tasks are properly easier to find under linux, because
access to the commandline-interface is easier (and you can help yourself
with cmdl-tools): you needn't do your first steps mangled with
GUI-programming.

* When I'm in neeed of a simple task, I ask myself which common tasks with
my computer are really annoying amd could better be done by a script or
with the kind help by a script.

* Don't believe there is something like a simple task! You need to thought
thorough and look for solution, which are modular and as clear as
possible.

* Explain other people your plans. This helps to get a better idea what to
plan. The tutor could possibly play a role in this process.

* Try to see the difference between your beginners style and the style of
a expierenced programmer. Learn to use better programm structures.

* delete code. I have got this subtle advise from Mr Laningham.

2. special tasks

I do *very* often lookups in the Python Library Reference. This means to
point and click (search target - aim - shuffle with the mouse, cause it's
dirty and forget, what I originally wanted...) through my webbrowser. To
hard. A script come to mind that reads lib/genindex.html and found every
function of a giving name. My version is pretty helpful but ugly.

The same point and click, when I want to listen music. My player is xmms
and fortunatelly it can be launched from commandline. A script search
every file from my music-directory and choose a random track. Or it
chooses from tracks matching a given string. Or the else. Reduces my
afforts to get a music playback to merely a single keystroke. Best.

I want to observe my usage of programm XXX (in my case the TV-viewer :-):
A minutely cronjob (taskmanager on windows) checks if the programm runs
and writes line for line to file. A small python script count the
TV-sessions.

And more of this (much more examples would come from a computer related
job but a personal computer is just fine). All these scripts doesn't need
special technics (like sockets, GUI or else) but the wellknown five
modules string, re, time, sys, os (random for random-xmms). And you will
learn a lot of lists and loops.

Michael


>
> I'm new to python, and programing in general. So far I have used Josh
> Cogliati's "non-prog. tutorial for python", and also Guido Van Rossun's nice
> "python tutorial" to get me started.
>
> However, I think that having some basic practice problems could take me a
> step further.
> Does anyone have a tip for me on how to improve my python skils ?
>
> All the best to all, Diego.
>                riex@ligbr.com.br
>
> _______________________________________________
> Tutor maillist  -  Tutor@python.org
> http://mail.python.org/mailman/listinfo/tutor
>