Re: Please help for Python programming

2005-03-29 Thread yy0127
Thanks for your help! I am already fix it!! Many thanks! -- http://mail.python.org/mailman/listinfo/python-list

Re: Please help for Python programming

2005-03-24 Thread bruno modulix
[EMAIL PROTECTED] wrote: I am sorry that i forgot to see the working example. Base on your example, i can show the value without missing but got the other problem. I would like to culmulate the value by users. This is (almost) exactly the same. I was rewrite your example but cannot not work. ## im

Re: Please help for Python programming

2005-03-23 Thread yy0127
I am sorry that i forgot to see the working example. Base on your example, i can show the value without missing but got the other problem. I would like to culmulate the value by users. I was rewrite your example but cannot not work. ## import sys import pprint try: f = open('data.txt', 'r') e

Re: Please help for Python programming

2005-03-23 Thread bruno modulix
[EMAIL PROTECTED] wrote: Thanks for your advice.^^ It would be more useful to follow them than to thank me. I find out something special (because i don't know). I would like to retrieve data from source file into array. The data will be omited if the value is duplicated. For example, there is 3 val

Re: Please help for Python programming

2005-03-23 Thread yy0127
Thanks for your advice.^^ I find out something special (because i don't know). I would like to retrieve data from source file into array. The data will be omited if the value is duplicated. For example, there is 3 values - 1,2,1. It will only display 1,2 after i ran the script. value = (1,2,1) wh

Re: Please help for Python programming

2005-03-22 Thread M.E.Farmer
Hello again, For some strange reason Google isn't showing this so I got this from gmane sorry if I missed something. The fixed/proportional link is located on the google groups c.l.py pages. I wasn't clear at all sorry for the ambiguity. Google groups for c.l.py seems to be fixed by default, so no

Re: Please help for Python programming

2005-03-22 Thread Terry Reedy
"M.E.Farmer" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Terry, > This was posted from google groups, can you see the indents? Yes, looks good > # code snippet >convertpage = 0 >form = None >for o, a in opts: >if o in ["-h", "--help"]: >Usage()

Re: Please help for Python programming

2005-03-22 Thread M.E.Farmer
Terry, This was posted from google groups, can you see the indents? # code snippet convertpage = 0 form = None for o, a in opts: if o in ["-h", "--help"]: Usage() sys.exit() if o in ["-o", "--output", "--out"]: output = a if o

Re: Please help for Python programming

2005-03-22 Thread bruno modulix
[EMAIL PROTECTED] wrote: (snip) The PRINT code is for my testing. My problem is bytemsg will be omitted some records. For example, my text file have 53 records about username. After byteDict = users1[user1], Which, from your previous snippet, should raise a KeyError... If it does, then first unde

Re: Please help for Python programming

2005-03-21 Thread yy0127
Actually, this script will open a text file which is seperated by tabs. The PRINT code is for my testing. My problem is bytemsg will be omitted some records. For example, my text file have 53 records about username. After byteDict = users1[user1], it remains 50 records in the output file. I woul

Re: Please help for Python programming

2005-03-21 Thread Terry Reedy
This is what I see (minus the '> '): > while 1: > user, serviceType, msgType, inOut, date, time, numBytes = > aLog.GetNextMessage("") [etc] Advice: use spaces, not tabs, to indent posted code (some readers discard tabs). Don't use google groups to post code (it deletes initial spaces and won't

Re: Please help for Python programming

2005-03-21 Thread bruno modulix
[EMAIL PROTECTED] wrote: I don't know why i entered the below code And we don't know either !-) and it will miss some records. Anyone can help me??? If you hope to get some useful help, it would be a good idea to follow Diez's advice (see other post in this thread) users = {} users1 = {} while

Re: Please help for Python programming

2005-03-21 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: > I don't know why i entered the below code and it will miss some > records. > Anyone can help me??? Sorry, my mindreading brain extension is at the service right now, so I can't guess what that piece of syntactically incorrect code is supposed to do and what error messag

Please help for Python programming

2005-03-21 Thread yy0127
I don't know why i entered the below code and it will miss some records. Anyone can help me??? users = {} users1 = {} while 1: user, serviceType, msgType, inOut, date, time, numBytes = aLog.GetNextMessage("") fullmsg = serviceType + "|" + msgType + "|" + inOut bytemsg = u