Re: [Tutor] Help please

2013-10-17 Thread Todd Matsumoto
Hello Ruben, You might already know this, but the Python documentation will get you pretty far: http://www.python.org/doc/ Here are some things to lookup that may help you solve the problems. On 10/16/2013 08:49 PM, Pinedo, Ruben A wrote: I was given this code and I need to modify it so that

Re: [Tutor] sqlite question

2013-06-11 Thread Todd Matsumoto
reader: > 6. d[badge]=name > 7. return d > > > > > > ___ > Tutor maillist - Tutor@python.org > To unsubscribe or change subscription options: > http://mail.python.org/mailman/listin

Re: [Tutor] producing PDF files

2013-06-11 Thread Todd Matsumoto
_ > Tutor maillist - Tutor@python.org > To unsubscribe or change subscription options: > http://mail.python.org/mailman/listinfo/tutor > > -- Todd Matsumoto ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Regarding python function arguments

2013-06-11 Thread Todd Matsumoto
> Tutor maillist - Tutor@python.org > To unsubscribe or change subscription options: > http://mail.python.org/mailman/listinfo/tutor > > -- Todd Matsumoto ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Flip the coin 10x and count heads and tails: It works now!

2013-05-26 Thread Todd Matsumoto
ranteed to give either head or tails. So just count the > number of heads, then the number of tails will be ten less the number of > heads. > > > > > -- > Steven > > __**_ > Tutor maillist - Tutor@python.org > To unsubscribe or change subscription optio

Re: [Tutor] Testing for empty list

2009-10-19 Thread Todd Matsumoto
I don't understand how the while loop efficiently tests if the list is empty. Why would going through the entire list be a good test to simply see find out if the list is empty or not. Wouldn't you want to test the list itself, rather than the contents of it? Cheers, T Original-Nachr

Re: [Tutor] Testing for empty list

2009-10-19 Thread Todd Matsumoto
The while loop will print each index of the list. In a way it checks that if the list is empty by printing the items. As far as I know there isn't any 'True' or 'False' output from a list. If you want to do something if mylist is empty you can check it like this: if not mylist: ... do someth

[Tutor] Option parser tools

2009-07-22 Thread Todd Matsumoto
Hello Tutors, I'm building a script that now needs a command line interface. I'm aware of optparse, but I'm wondering if there are any other tools that may be better for building the interface. Cheers, T -- GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT! Jetzt freischalten unter http:

Re: [Tutor] decorators, __call__ (able) objects

2009-07-15 Thread Todd Matsumoto
Thanks guys, In the example the __call__ method has *args and **kws as arguments. Is that required? Also when, in what situation would you use callable objects? Cheers, T Original-Nachricht > Datum: Wed, 15 Jul 2009 12:02:05 -0700 > Von: wesley chun > An: vince spicer , tmat

Re: [Tutor] decorators, __call__ (able) objects

2009-07-15 Thread Todd Matsumoto
hi kent, thanks, i read through the link but still haven't got my head around this concept. will read on. cheers, t Original-Nachricht > Datum: Wed, 15 Jul 2009 08:33:33 -0400 > Von: Kent Johnson > An: Todd Matsumoto > CC: tutor@python.org > Betreff: Re

[Tutor] decorators, __call__ (able) objects

2009-07-15 Thread Todd Matsumoto
Hi, Can some one give, or point to some good examples of how @decorators work, and __call__ (able) objects? I'm having trouble getting my head around these techniques (concepts). Cheers, T -- Neu: GMX Doppel-FLAT mit Internet-Flatrate + Telefon-Flatrate für nur 19,99 Euro/mtl.!* http://portal

Re: [Tutor] unittests, testing a type

2009-07-14 Thread Todd Matsumoto
ve a value that is a Decimal object something is wrong. Cheers, T Original-Nachricht > Datum: Tue, 14 Jul 2009 22:36:14 -0400 > Von: Dave Angel > An: > CC: Todd Matsumoto , tutor@python.org > Betreff: Re: Re: [Tutor] unittests, testing a type > On Tue, J

Re: [Tutor] unittests, testing a type

2009-07-14 Thread Todd Matsumoto
his test-driven development thing. Cheers, T Original-Nachricht > Datum: Tue, 14 Jul 2009 15:45:18 +0200 > Von: "A.T.Hofkamp" > An: Todd Matsumoto > CC: "tutor@python.org" > Betreff: Re: [Tutor] unittests, testing a type > Todd Matsumoto

[Tutor] unittests, testing a type

2009-07-14 Thread Todd Matsumoto
Hi, Does anyone know how to do a unittest assert for a type? So If you have a program returning a Decimal, lets say Decimal("1"), and you want to make sure that what is returned is a Decimal object. At first I thought of importing Decimal and making my own Decimal("1") and doing an assertEqua

Re: [Tutor] While and for loops

2009-07-14 Thread Todd Matsumoto
Okay, Thanks guys. That explains it. Cheers, T Original-Nachricht > Datum: Tue, 14 Jul 2009 00:16:30 -0700 > Von: wesley chun > An: "A.T.Hofkamp" > CC: Todd Matsumoto , "tutor@python.org" > Betreff: Re: [Tutor] While and for loops > &

Re: [Tutor] While and for loops

2009-07-14 Thread Todd Matsumoto
else: if break is False: break Is the above do-able? Is there a better way? T Original-Nachricht > Datum: Tue, 14 Jul 2009 00:05:30 -0700 > Von: wesley chun > An: Todd Matsumoto > CC: tutor@python.org > Betreff: Re: [Tutor] While and for loops >

Re: [Tutor] While and for loops

2009-07-14 Thread Todd Matsumoto
Okay, So how would you break out from this situation? T Original-Nachricht > Datum: Tue, 14 Jul 2009 06:57:41 + > Von: sli1...@yahoo.com > An: "Todd Matsumoto" > Betreff: Re: [Tutor] While and for loops > Your break is for the for loop not the

[Tutor] assigning list to keys

2009-07-14 Thread Todd Matsumoto
Hello, The other day I needed to pack a dictionary, the value of each key was a list. In the code I was packing the list and the dictionary at the same time. First I tried something like this: list = [] dict = {} x = 1 dict['int'] = list.append(x) The result was {'int': None}. Why is the valu

[Tutor] While and for loops

2009-07-13 Thread Todd Matsumoto
Hello, The other day I was playing with a while loop with a for loop nested inside. Within the for loop I had a condition to break the loop, but when loop ran it never existed the loop. I went back and looked in Programming Python to read about loops and I've got two questions (related to each