Parsing & question about usages off classes!
Frans
frans at haarman.com
Sun Nov 3 16:14:38 EST 2002
Peter Hansen wrote:
> Can you explain why you think you want a new list with the name "some"?
> If you can dig down to your real requirements and express them here,
> we can probably show you how to approach the problem in a more
> workable fashion.
Ok. Here we go.
I am very new with python as you have guessed! For school I can choose
my own projects and earn credits with them so I choose to build
something in python.
I want to make a program which uses analogs computer output. From the
output I want to create nice websites with graphics.
Example lines off analogs computer output:
R P ---- DATE ----------------
D RP 901 133 2002 09 18
H RP 6 6 2002 10 26 00
W RP 3347 662 2002 10 06
D H w being differnt reports. RP meaning Request and Pages. Now I need
to read all these lines into python and then do stuff to extract the data.
I wanted to put the D lines in the list DAILY. Analogs computer output
has around 30 or 40 different reports. So using longer names might make
my code a bit more readable. Which is nice if other people ever decide
to do something with it :)
So I thought I would do the following:
short=['D','H','W']
long=['DAILY','HOURLY','WEEKLY']
information = string.split(logline,'\t')
DAILY.append(information)
Giving me a list DAILY. The list DAILY would contain other lists, and
those lists would containt loglines which started with a D.
After reading all lines from my logfile I would have serveral lists
which I could then use for futher processing.
Futher processing would be:
* creating HTML for output to browser
* creating gfx to visualize statistics
* whatever I come up with
Ok thats it.
Thanks again :)
Frans
More information about the Python-list
mailing list