Re: Help with report
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.python archive

Re: Help with report

From: Grant Edwards <grante@visi.com>
Date: Tue Jul 12 2005 - 00:24:11 CEST

On 2005-07-11, ChrisH <secun@yahoo.com> wrote:
> I have some data in the following format:
>
> Fred Flintstone,445553454,47634565
> Wilma Flintstone,74857346,27576847
> Barney Rubble,73487346,27576435
>
> I need to convert this data into a report with the user's name and
> difference between the 2 numbers.
>
> Can someone recommend a good way to do this?
>
> BTW, it would be best if I can have it up and running by tomorrow.

You really oughtn't put off homework assignments until the last
minute. Especially if you don't know how to do them.

> Also, html would be the preferred format, but not required.
>
> Any help would be greatly appreciated!!

Hints:

The string object's "split" method: http://docs.python.org/lib/string-methods.html
  
for line in file('inputfile.txt','r')

the built-in int()

the string formatting operator "%": http://docs.python.org/lib/typesseq-strings.html
  

-- 
Grant Edwards                   grante             Yow!  All right, you
                                  at               degenerates! I want this
                               visi.com            place evacuated in 20
                                                   seconds!
Received on Thu Sep 29 16:53:08 2005