Re: [Tutor] Importing and creation on the fly

2007-06-28 Thread Tino Dai
On 6/26/07, Tino Dai <[EMAIL PROTECTED]> wrote: On 6/26/07, Dave Kuhlman <[EMAIL PROTECTED]> wrote: > On Tue, Jun 26, 2007 at 12:20:18PM -0400, Tino Dai wrote: > > Hi there, > > > > I've been banging my head on this for about two weeks, and I can't > > figure out a solution to this. I'm won

Re: [Tutor] Removing a file from a tar

2007-06-28 Thread Jacob S.
>* Adam A. Zajac <[EMAIL PROTECTED]> [2007-06-27 11:26]: >> I was reading over the documentation for the tarfile module and it >> occurred to me that there didn't seem to be a way to remove an >> individual file from the tar. >> >> For example, suppose I did this: >> >> import tarfile >> tar = tarf

[Tutor] Money matters

2007-06-28 Thread Terry
I am going to need to be handling money calculations and was wondering about the float problem in my calculations. Should I simply run the results of all calculations through something like this: from __future__ import division ... ... s=(int(round(s, 2)*100))/100 Or should I be using Decimal o

Re: [Tutor] Money matters

2007-06-28 Thread Brian van den Broek
Terry said unto the world upon 06/28/2007 02:55 PM: > I am going to need to be handling money calculations and was wondering > about the float problem > in my calculations. > > Should I simply run the results of all calculations through something > like this: > > from __future__ import division

Re: [Tutor] Money matters

2007-06-28 Thread Tiger12506
> Should I simply run the results of all calculations through something > like this: > > from __future__ import division > ... > ... > s=(int(round(s, 2)*100))/100 > > Or should I be using Decimal on all money calculations? Firstly - that does not magically fix the imprecisions in floating point n

[Tutor] Iterating through two lists at the same time with manipulation..

2007-06-28 Thread Iyer
I have 2 lists: List 1 has lists in it, such as list1 = [[1,'A'],[2,'B'],[3,'C'],[4,'D']] There is another list2 such as list2 = [[1,'AA'],[3,'CC'], [4,'DD']] For eg, I wish to iterate over both the lists and produce the output a = [[1,'A'],[1,'AA']] b = [[2,'B']] c = [[3,'C'],[3,'CC']] d =

Re: [Tutor] Money matters

2007-06-28 Thread Terry
Thanks! I am playing with Decimal suggested recipe now and it is just way cool! Perfect! In fact, more than perfect! ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Iterating through two lists at the same time with manipulation..

2007-06-28 Thread John Fouhy
On 29/06/07, Iyer <[EMAIL PROTECTED]> wrote: > I have 2 lists: > > List 1 has lists in it, such as > > list1 = [[1,'A'],[2,'B'],[3,'C'],[4,'D']] > > There is another list2 such as > > list2 = [[1,'AA'],[3,'CC'], [4,'DD']] > > For eg, > > I wish to iterate over both the lists and produce the output

Re: [Tutor] Iterating through two lists at the same time with manipulation..

2007-06-28 Thread Kent Johnson
Iyer wrote: > I have 2 lists: > > List 1 has lists in it, such as > > list1 = [[1,'A'],[2,'B'],[3,'C'],[4,'D']] > > There is another list2 such as > > list2 = [[1,'AA'],[3,'CC'], [4,'DD']] > > For eg, > > I wish to iterate over both the lists and produce the output > > a = [[1,'A'],[1,'AA']]

Re: [Tutor] Iterating through two lists at the same time withmanipulation..

2007-06-28 Thread David Heiser
A dictionary would work well here. Read each element of the lists into the dictionary using the integer as the key with a list of strings as the values. {1: ['A', 'AA'], 2: ['B'], 3: ['C', 'CC'], 4: ['D', 'DD']} Then output the contents in the required format. This may take more lines of code t

[Tutor] Python & cgi on win98--tinyweb problems, etc

2007-06-28 Thread Kirk Bailey
RE: TinyWeb running python in windows PROBLEM: getting python scripts to execute. SOLUTION: Insure the script ends in the name extension .py. Windows associates all such files with the pythonw.exe interpreter program, and will use it to interpret them. IT IGNORES THE SHEBANG (the first line in

[Tutor] get pixel color form canvas , or draw text on image (Tkinter lib).

2007-06-28 Thread Yang
What I am trying to do is get the dot matrix of chinese char, and then make a font lib for embed system. I had thought of print the char on a tk canvas, and get dot color one bye one, but I found no mathod to get data form canvas. As for image, I can put and get dots on it, but I don