[Tutor] Could I have used time or datetime modules here?

2004-12-05 Thread Dick Moores
, say 08:51 and say, tomorrow at 03:45, to take an example of the most difficult case? See timer3.py at <http://www.rcblue.com/Python/timer3_ForWeb.py> Thanks, tutors. Dick Moores [EMAIL PROTECTED] ___ Tutor maillist - [EMAIL PROT

Re: [Tutor] Could I have used time or datetime modules here?

2004-12-05 Thread Dick Moores
hoursDiff = hoursDiff + 24 # add a day sleepSeconds = hoursDiff*3600 + minutesDiff*60 - nowSecond time.sleep(sleepSeconds) If I'm wrong, could someone please set me right? Dick Brian van den Broek wrote at 09:54 12/5/2004: Dick Moores said unto the world upo

Re: [Tutor] Could I have used time or datetime modules here?

2004-12-05 Thread Dick Moores
Brian van den Broek wrote at 16:53 12/5/2004: Dick Moores said unto the world upon 2004-12-05 15:03: Thanks, Brian. I looked at your code a long time, and also read the 11/26 thread you started. I can see how I could use datetime() and your t2 - t1 to get the seconds for time.sleep(), but the

[Tutor] psyco 1.3 is out, with support for Python 2.4

2004-12-06 Thread Dick Moores
<http://psyco.sourceforge.net/> And "The Ultimate Psyco Guide" for 1.3 is at <http://psyco.sourceforge.net/psycoguide/index.html> Dick Moores ___ Tutor maillist - [EMAIL PROTECTED] http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] psyco 1.3 is out, with support for Python 2.4

2004-12-06 Thread Dick Moores
t in a programme's size/speed does it become worthwhile to implement Pysco? Regards, Liam Clarke On Sun, 05 Dec 2004 23:49:03 -0800, Dick Moores <[EMAIL PROTECTED]> wrote: > <http://psyco.sourceforge.net/> > > And "The Ultimate Psyco Gu

[Tutor] Python 2.3.5 out in January??

2004-12-07 Thread Dick Moores
.3.6 will appear. That would be unprecedented, but not impossible ... end TP's post I ask here because I'm sure it's a newbie question. It's got me wondering if Microsoft is still working on Windows 3.1.. ;-) Thanks, Dick Moores [EMAIL PROTE

Re: [Tutor] Re: Could I have used time or datetime modules here?

2004-12-07 Thread Dick Moores
To Liam and Brian, Liam, actually, Brian did Sunday. See his post in this thread of Date: Sun, 05 Dec 2004 19:53:01 -0500. But you've done is interesting, and I thank you. Here's Brian's script in it's bare bones, without the input error checking and his extensive and helpful comments: ===

Re: [Tutor] Re: Could I have used time or datetime modules here?

2004-12-07 Thread Dick Moores
Brian van den Broek wrote at 07:50 12/7/2004: Dick Moores said unto the world upon 2004-12-07 07:04: To Liam and Brian, Here's Brian's script in it's bare bones, without the input error checking and his extensive and helpful comments: ===begin code

[Tutor] "TypeError: 'int' object is not callable"??

2004-12-08 Thread Dick Moores
I got this error msg for this line of code: n = -(2(a**3.0)/27.0 - a*b/3.0 + c) (where a = 1, b = 2, c = 3) And was baffled until I realized the line should be n = -(2*(a**3.0)/27.0 - a*b/3.0 + c) But I still don't understand what "callable" means. Can someone help? Thanks, Dic

Re: [Tutor] "TypeError: 'int' object is not callable"??

2004-12-08 Thread Dick Moores
My thanks to both Max and Kent. So Python tries, and fails, to see 2() as a function! I also got some help from Dick ___ Tutor maillist - [EMAIL PROTECTED] http://mail.python.org/mailman/listinfo/tutor

[Tutor] How to get the 2 complex cube roots of 1?

2004-12-09 Thread Dick Moores
.1766579932626087e-009j) >>> (-.5 - .866025403j)**3 (0.796196859-1.1766579932626087e-009j) Thanks, Dick Moores [EMAIL PROTECTED] ___ Tutor maillist - [EMAIL PROTECTED] http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Complex roots

2004-12-09 Thread Dick Moores
VERY helpful, Matt. Thanks. One question: This seems to not compute accurately at all when the imaginary part of number=complex() is other than 0. For example, number=complex(5,5): With number=complex(5,5) n=float(4) the code produces {0: (1.631, 0.0), 1: (0.0, 1.631), 2: (-1.631, 0.0), 3: (0.0

Re: [Tutor] Complex roots

2004-12-10 Thread Dick Moores
Aw, that's just amazing. I put your function in http://www.rcblue.com/Python/croots.py, which gets c and n from user and adds a test function. Here's what one run produces: Enter either a complex number in form x + yj, or a real number: 3.1 -1j Enter an intege

Re: [Tutor] Complex roots

2004-12-10 Thread Dick Moores
Oops. Make that croots3.py (<http://www.rcblue.com/Python/croots3.py>). I forgot a couple of abs's. For example, "if n.imag < 1e-13:" is changed to "if abs(n.imag) < 1e-13:" Dick Dick Moores wrote at 07:38 12/10/2004: I've modified croots.py to croots2.py

Re: [Tutor] Complex roots

2004-12-12 Thread Dick Moores
Tim (was: Bill) Peters wrote at 20:45 12/10/2004: [Dick Moores] > Aw, that's just amazing. > I put your function in http://www.rcblue.com/Python/croots.py, That's fine by me -- but I'd appreciate it if you stopped claiming there that my name is Bill . Are you sure

[Tutor] OT?: how to google just the 2.4 tutorial?

2004-12-12 Thread Dick Moores
I know how to limit google search results to a single site, but is it possible to google just one section of a site? I'd like to be able to search just the 2.4 tutorial, http://www.python.org/doc/2.4/tut/tut.html Possible? And if so, how to? Thanks, Dick Moores [EMAIL PROT

Re: [Tutor] OT?: how to google just the 2.4 tutorial?

2004-12-12 Thread Dick Moores
Brian van den Broek wrote at 10:43 12/12/2004: Dick Moores said unto the world upon 2004-12-12 11:53: I know how to limit google search results to a single site, but is it possible to google just one section of a site? I'd like to be able to search just the 2.4 tutorial, http://www.pytho

Re: [Tutor] Complex roots

2004-12-12 Thread Dick Moores
Thanks for the sobering advice, and for the two sites I knew nothing about. So there's a SciPy! Dick Tim Peters wrote at 20:37 12/12/2004: > Are these "numerical approximation methods" pythonically possible? Of course, but coding general-purpose root finders-- even if "general" is limited to just

Re: [Tutor] Complex roots

2004-12-12 Thread Dick Moores
? Sounds mind-boggling. Maybe I should start by approximating real roots, if they exist; and cut my teeth on quadratic equations where b**2 - 4*a*c >= 0! Or linear equations. Thank you. Dick Moores Alan Gauld wrote at 09:25 12/12/2004: > Are these "numerical approximation methods&qu

Re: [Tutor] OT?: how to google just the 2.4 tutorial?

2004-12-15 Thread Dick Moores
Just got this reply from [EMAIL PROTECTED] --Dick Regrettably, we don't currently offer a way to limit your search to a specific section of a site. We really appreciate your thoughtful feedback, and we'll keep it in mind as we work to improve Google. Regards, The Google Team Dick Moore

Re: [Tutor] Complex roots

2004-12-16 Thread Dick Moores
Thanks. Tim Peters helped me out with his answer of 12/9. <http://mail.python.org/pipermail/tutor/2004-December/033967.html> Dick Moores Jacob S. wrote at 19:27 12/15/2004: Finding the all the roots of a complex number shouldn't be too difficult. I tend to do it on paper sometimes.

Re: [Tutor] Complex roots

2004-12-10 Thread Dick Moores
adjusted from (4-2.6645352591e-015j) root3 is (-0.793700525984-1.374729637j) root3 to the 3 power is 4.0, adjusted from (4-5.55111512313e-015j) ==== Dick Dick Moores wrote at 02:15 12/10/2004: Aw, that's just amazing. I put your function in http://www.rcblue.com/Python/cro

Re: [Tutor] Complex roots

2004-12-15 Thread Dick Moores
ck the number of roots you expect versus the number you get as an error detection scheme. I tried to follow your tips, and came up with pinchCubic.py for approximating the real roots of cubic equations. <http://www.rcblue.com/Python/pinchCubic.py> I'd appreciate any g

[Tutor] How to use Python 2.6 with IDLE?

2009-07-27 Thread Dick Moores
use 2.6. When I click on E:\Python26\Lib\idlelib\idle.pyw, I get an IDLE instance that says: Python 2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.1310 32 bit (Intel)] on win32 Type "copyright", "credits" or "license()" for mor

Re: [Tutor] How to use Python 2.6 with IDLE?

2009-07-27 Thread Dick Moores
On Mon, Jul 27, 2009 at 04:27, Gregor Lingl wrote: > Dick Moores schrieb: >> >> I've taken a long break from Python, and now I want to try scripting >> with 2.62. I downloaded and installed 2.62, changed Win XP >> environmental variables to use Python26. Enteri

Re: [Tutor] How to use Python 2.6 with IDLE?

2009-07-27 Thread Dick Moores
On Mon, Jul 27, 2009 at 09:32, Alan Gauld wrote: > > "Dick Moores" wrote > >>> I suggest you have to change the association of *.pyw files to the >>> program, which is used to 'open' it. >>> >> Yes! After I did that, now when I cal

Re: [Tutor] How to use Python 2.6 with IDLE?

2009-07-27 Thread Dick Moores
On Mon, Jul 27, 2009 at 12:50, ALAN GAULD wrote: > > >> > What I do for these things is create a shortcut which specifies the full >> > path to the interpreter and to the pyw file. I also set the working foldeer >> > to wherever is most appropriate - usually my project folder. That's fairly >> > bu

Re: [Tutor] How to use Python 2.6 with IDLE?

2009-07-27 Thread Dick Moores
On Mon, Jul 27, 2009 at 14:32, Alan Gauld wrote: > > "Dick Moores" wrote > >>> So edit the Target field of the shortcut to say: >>> >>> E:\Python26\pythonw.exe E:\Programs\Ulipad37\ulipad.pyw >> >> No, I'd already tried that

Re: [Tutor] How to use Python 2.6 with IDLE?

2009-07-28 Thread Dick Moores
On Tue, Jul 28, 2009 at 02:20, Dave Angel wrote: > Dick Moores wrote: >> >> >> I'm not sure how to edit it. What's required for Ulipad is quite >> different, I believe. >> >> This is what I got from Dave Angel: >> e: >> cd \Python

Re: [Tutor] How to use Python 2.6 with IDLE?

2009-07-31 Thread Dick Moores
output of the script 26.py . I call Ulipad with a Win XP shortcut, <http://www.rcblue.com/Misc/Ulipad_Shortcut2.png>. The contents of the "Target:" textbox is "E:\Python26\pythonw.exe E:\Programs\Ulipad3.7\Ulipad.pyw" (no quotes). Dick Moores __

[Tutor] How to get user input as regex

2005-04-02 Thread Dick Moores
er details like an address and times. Sorry for the dumb question. import re s = raw_input("regex: ") digs = re.compile(r"s") for line in open("data//phone.txt"): if digs.search(line): print line Thanks, Dick Moores [EMAIL PROTECTED] _

Re: [Tutor] How to get user input as regex

2005-04-02 Thread Dick Moores
Pierre Barbier de Reuille wrote at 07:22 4/2/2005: You should do something much simpler ^_^ : import re s = raw_input("regex : ") digs = re.compile(s) [...] Aha! Thanks! Dick ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinf

Re: [Tutor] What is the best book to start? - Many Thanks!

2005-04-07 Thread Dick Moores
will definitely have the latest and greatest." Dick Moores [EMAIL PROTECTED] ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] UselessPython 2.0

2005-04-09 Thread Dick Moores
] return s2 userstring = raw_input('Enter a word or sentence to test: ') userstringRevised = makeStringAllLowercaseAlpha(userstring) if isPalindrome(userstringRevised): print userstring, "is a palindrome." else: print userstring, "is not a palindrome." ===

[Tutor] Trying to write a string formatting demo

2005-04-10 Thread Dick Moores
t "x will be the default 1234.56789" x = 1234.56789 else: x = float(x) s = raw_input("enter a float format string such as '.4f' or '.3e': ") print "%f formatted with '%s' is %s" % (x,s,x) == Thanks, Dick Mo

Re: [Tutor] Trying to write a string formatting demo

2005-04-10 Thread Dick Moores
Brian van den Broek wrote at 01:09 4/10/2005: Hi Dick, why not replace th last line with the following 2: print_value = ('%' + s ) %x print "%f formatted with '%s' is %s" %(x, s, print_value) HTH, Brian vdB Sorry, half asleep: I should also have said that I don't think it is wise to call your user

Re: [Tutor] UselessPython 2.0

2005-04-12 Thread Dick Moores
Michael Janssen wrote at 10:30 4/11/2005: On Apr 10, 2005 7:18 AM, Dick Moores <[EMAIL PROTECTED]> wrote: > I'm a newbie, but would this qualify as a contribution to UselessPython 2.0? Hello Dick, don't be shy, or do you suspect it might be too usefull? ;-) I found it funny,

Re: [Tutor] How to calculate pi with another formula?

2005-04-12 Thread Dick Moores
there another way? Or is there no way? Thanks, Dick Moores [EMAIL PROTECTED] ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] terminology question

2005-08-01 Thread Dick Moores
Why are list comprehensions called that? Thanks, Dick Moores [EMAIL PROTECTED] ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] terminology question

2005-08-01 Thread Dick Moores
[EMAIL PROTECTED] wrote at 21:52 8/1/2005: >Quoting Dick Moores <[EMAIL PROTECTED]>: > > > Why are list comprehensions called that? > >Because that's what they're called in Haskell, I guess.. This Haskell, I suppose? <http://en.wikipedia.org/wiki/Haskell_pr

Re: [Tutor] can python run under windows 95?

2007-05-07 Thread Dick Moores
u may already have it on your system. If not, you can download it freely from Microsoft for Windows 95, 98 and Me and for Windows NT 4.0 and 2000. Windows XP and later already have MSI; many older machines will already have MSI installed." Dick Moores ___

Re: [Tutor] wxPython GUI builders?

2007-06-13 Thread Dick Moores
At 01:08 PM 6/13/2007, Alan Gauld wrote: >What's available and in what state of readiness? I don't have the details you want, but you might look at SPE. <http://pythonide.blogspot.com/> Dick Moores ___ Tutor maillist - Tu

Re: [Tutor] Integer to binary

2007-07-10 Thread Dick Moores
t) = divmod(num, base) seq.append(str(bit)) seq.append(sign) return ''.join(reversed(seq)) Dick Moores ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] Importing question

2007-07-13 Thread Dick Moores
t < http://www.python.org/doc/2.4/lib/module-itertools.html>. A search of my Python25 directory doesn't turn up an itertools.py. So my question is, how does the first line of the code work? Where is itertools? Thanks, Dick Moores ___ Tutor maillist

Re: [Tutor] Importing question

2007-07-13 Thread Dick Moores
At 07:55 AM 7/13/2007, Eric Brunson wrote: >Dick Moores wrote: >>At http://wiki.python.org/moin/SimplePrograms I found this code: >> >> >>import itertools >> >>def iter_primes(): >> # an it

[Tutor] class question

2007-07-13 Thread Dick Moores
quot;overdrawn" be put? If I change the withdrawal amount to 25, it prints the expected "-10", whether the class contains the "overdrawn" function or not. Thanks, Dick Moores ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] class question

2007-07-13 Thread Dick Moores
> > > > This prints the expected "10". > > > > My question is, of what use can "overdrawn" be put? If I change the > > withdrawal amount to 25, it prints the expected "-10", whether the class > > contains t

Re: [Tutor] class question

2007-07-13 Thread Dick Moores
At 12:35 PM 7/13/2007, [EMAIL PROTECTED] wrote: However if you try to withdraw any money after you took out the $25 it would raise the error. The overdrawn function checks if you are in the negatives. Since the balance is checked before the money is taken out, there is no error when you take ou

Re: [Tutor] class question

2007-07-13 Thread Dick Moores
At 03:12 PM 7/13/2007, Alan Gauld wrote: >"Dick Moores" <[EMAIL PROTECTED]> wrote > > > Thanks. You've clarified it for me completely. > > > > Your second way seems to make more sense. > > And instead of raising the error, why not just print

Re: [Tutor] Importing question

2007-07-13 Thread Dick Moores
At 02:50 PM 7/13/2007, Alan Gauld wrote: >"Dick Moores" <[EMAIL PROTECTED]> wrote in > > > > import itertools > > > > def iter_primes(): > > # an iterator of all numbers between 2 and +infinity > > numbers = itertools.count

Re: [Tutor] Good writeup on Python assignment semantics

2007-07-17 Thread Dick Moores
e current context, it is a semantic error. " < http://www.angelfire.com/anime3/internet/programming.htm> Thanks, Dick Moores ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Good writeup on Python assignment semantics

2007-07-17 Thread Dick Moores
At 07:38 AM 7/17/2007, Kent Johnson wrote: >Dick Moores wrote: >>At 04:57 AM 7/17/2007, you wrote: >>>A recent comp.lang.python thread has a good explanation of Python's >>>assignment semantics: >>>http://groups.google.com/group/comp.lang.pyt

Re: [Tutor] What exactly is [::-1]?

2007-07-26 Thread Dick Moores
At 12:37 PM 7/26/2007, Chris Calloway wrote: >The *other* form of extended slicing, the one with two colons (and no >commas) is supported by typeseq objects, though. What are typeseq objects. Searching the python site on "typeseq" draws a bla

Re: [Tutor] What exactly is [::-1]?

2007-07-26 Thread Dick Moores
At 12:17 AM 7/26/2007, Alan Gauld wrote: >"Dick Moores" <[EMAIL PROTECTED]> wrote > > >>I could send you a link but I'd just google 'python list slicing' to > >>find it, so I'll leave that as an exercise for the reader. > > >

Re: [Tutor] What exactly is [::-1]?

2007-07-25 Thread Dick Moores
uld send you a link but I'd just google 'python list slicing' to >find it, so I'll leave that as an exercise for the reader. I don't find Google of help with this. Could someone supply a link? Dick Moores ___ Tutor maill

Re: [Tutor] Code like a Pythonista

2007-07-27 Thread Dick Moores
tic/ Kent, The handout is excellent! Thanks! But the slideshow at <http://python.net/~goodger/projects/pycon/2007/idiomatic/presentation.html>, isn't. Dick Moores ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Code like a Pythonista

2007-07-27 Thread Dick Moores
At 12:02 PM 7/27/2007, Terry Carroll wrote: >On Fri, 27 Jul 2007, Dick Moores wrote: > > > The handout is excellent! Thanks! > > > > But the slideshow at > > > <http://python.net/~goodger/projects/pycon/2007/idiomatic/presentation.html>, > > isn

Re: [Tutor] ideas for college app.

2007-07-28 Thread Dick Moores
our "college app"? What does "college app" mean? Dick Moores ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] Ingenious script (IMO)

2007-08-06 Thread Dick Moores
working at Python--been at it a while--and thought the script was ingenious. Do the Tutors agree? Or is it just run-of-the-mill programming? Could it have been more simply written? Thanks, Dick Moores ___ Tutor maillist - Tutor@pyth

Re: [Tutor] Ingenious script (IMO)

2007-08-06 Thread Dick Moores
At 06:49 AM 8/6/2007, Kent Johnson wrote: >Dick Moores wrote: >>http://www.rcblue.com/Python/changeMaker_revised_for_US_denominations.py >>I'm still working at Python--been at it a while--and thought the >>script was ingenious. Do the Tutors agree? Or is it just >

Re: [Tutor] Ingenious script (IMO)

2007-08-06 Thread Dick Moores
At 07:44 AM 8/6/2007, Kent Johnson wrote: >Dick Moores wrote: >>Gotta say though, I still don't understand how the defaultdict works here. > >Did you try the docs? >http://docs.python.org/lib/defaultdict-objects.html Yes, but it left me still in the dark. >If coinC

Re: [Tutor] Ingenious script (IMO)

2007-08-06 Thread Dick Moores
On 8/6/07, Eric Brunson <[EMAIL PROTECTED]> wrote: > > Try something like: > > def makechange( amount, denominations ): > > coins = {} > for d in denominations: > coins[d] = int( amount/d ) > amount = amount%d > > return coins > > Sorry, but could you spell out your poin

Re: [Tutor] Ingenious script (IMO)

2007-08-06 Thread Dick Moores
At 10:16 AM 8/6/2007, Eric Brunson wrote: Your point about efficiency is well-taken. >def makechange( amount, denominations ): > > coins = {} > for d in denominations: > coins[d] = int( amount/d ) > amount = amount%d > > return coins OK, I used this this way: ===

Re: [Tutor] Ingenious script (IMO)

2007-08-06 Thread Dick Moores
At 02:17 PM 8/6/2007, you wrote: >Nice idea. Written style is average. Other tutors have discussed issues with >performance, style, etc. I thought I would mention that whenever I am asked >to give my opinion on a script, I compare it to something I have >written/would write. In this case, I have al

Re: [Tutor] Ingenious script (IMO)

2007-08-06 Thread Dick Moores
At 08:38 PM 8/6/2007, Tiger12506 wrote: > > The modern way seems to be to look at the change amount given by the > > cash register and count that out starting with dollars... >So true... tsk tsk. > >That's because the teenagers that give you the change do not know how to >count it back. What a grea

Re: [Tutor] Python Editors .. which do you reccomend for a amateur?

2007-08-09 Thread Dick Moores
he new version 3 beta? <http://wingware.com/> Thanks, Dick Moores == Bagdad Weather <http://weather.yahoo.com/forecast/IZXX0008_f.html> ___ Tutor maillist - Tutor@python.org http

Re: [Tutor] Bookpool sale on Addison Wesley

2007-08-09 Thread Dick Moores
I always first check BestBookDeal.com. <http://www.bestbookdeal.com/> Dick Moores ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] WinPdb?

2007-08-09 Thread Dick Moores
WinPdb website (< http://www.digitalpeers.com/pythondebugger/>, where you'll also notice that version 1.2.0 came out August 6 (the latest svn revision of Ulipad already has it: (Ulipad's developer Limodou (who's in Beijing), is very responsive). Thanks, Dick Moores __

Re: [Tutor] WinPdb?

2007-08-09 Thread Dick Moores
At 03:00 PM 8/9/2007, you wrote: > > Dick Moores wrote: > >> (I posted this to the python-list 24 hours ago, and didn't get a > >> single response. How about you guys?) > > You mean this list? Cause if you mean this list, then you didn't post > > it c

[Tutor] Opinions about this new Python book?

2007-08-11 Thread Dick Moores
Title: Python Power!: The Comprehensive Guide Author:  Matt Telles Publisher:  Course Technology Pub. Date:  Jul 27, 2007 Edition:  1st edition Binding:  Paperback Pages:  508 ISBN:  1598631586 List Price:  34.99 USD < http://www.bestbookdeal.com/book/compare/1598631586> Thanks

Re: [Tutor] WinPdb?

2007-08-11 Thread Dick Moores
At 04:31 PM 8/9/2007, Alan Gauld wrote: >"Dick Moores" <[EMAIL PROTECTED]> wrote > > > The only debugging I've done so far is to put in print statements > > where I want to see what's happening. > >Thats OK for basic stuff but for complex things yo

Re: [Tutor] Ingenious script (IMO)

2007-08-11 Thread Dick Moores
At 07:31 AM 8/6/2007, Dick Moores wrote: >At 06:49 AM 8/6/2007, Kent Johnson wrote: > >Dick Moores wrote: > >>http://www.rcblue.com/Python/changeMaker_revised_for_US_denominations.py > >>I'm still working at Python--been at it a while--and thought the > >>

Re: [Tutor] Ingenious script (IMO)

2007-08-11 Thread Dick Moores
At 04:11 AM 8/11/2007, Dick Moores wrote: >I was just about finished with a script that would tell the clerk >how to give the change to the customer, when I discovered that the >above script computes the wrong amount of change in certain >situations. It works fine if the customer

Re: [Tutor] Ingenious script (IMO)

2007-08-11 Thread Dick Moores
At 06:05 AM 8/11/2007, Kent Johnson wrote: >Dick Moores wrote: > > I was just about finished with a script that would tell the clerk how > > to give the change to the customer, when I discovered that the above > > script computes the wrong amount of change in certain situatio

Re: [Tutor] Ingenious script (IMO)

2007-08-11 Thread Dick Moores
At 07:13 AM 8/11/2007, bob gailer wrote: >Dick Moores wrote: >>Here's the script that hands over change in the traditional way. >><http://www.rcblue.com/Misc/changeMakerKent_Traditional.py> >> >>Is there a better way to handle the singulars and plurals? &

Re: [Tutor] Ingenious script (IMO)

2007-08-11 Thread Dick Moores
At 07:21 AM 8/11/2007, bob gailer wrote: >Dick Moores wrote: >>At 07:13 AM 8/11/2007, bob gailer wrote: >>>Dick Moores wrote: >>>>Here's the script that hands over change in the traditional way. >>>><http://www.rcblue.com/Misc/changeMakerKent

Re: [Tutor] Decoding

2007-08-12 Thread Dick Moores
mpt, I get "NameError: name 'How' is not defined". Dick Moores ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Decoding

2007-08-12 Thread Dick Moores
At 02:12 PM 8/12/2007, Dick Moores wrote: At 01:15 PM 8/12/2007, Khamid Nurdiev wrote: Hello All,  I am currently learning python with the book "Python programming: An introduction to CS" by John M. Zelle and have come the section where he speaks of encoding messages. Currently the bas

Re: [Tutor] Python Book Recommendations [Was:[Re: Security]]

2007-08-13 Thread Dick Moores
is BestBookDeal.com <http://www.bestbookdeal.com/> Dick Moores ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

[Tutor] Graphing the random.gauss distribution

2007-08-14 Thread Dick Moores
o run on my computer. To fit your situation, the length of the bars can be shortened or lengthened by decreasing or increasing, respectively, the divisor of gaussCalls in line 5, "barLengthAdjuster = gaussCalls//2600". Dick Moores == from random import gau

Re: [Tutor] Graphing the random.gauss distribution

2007-08-14 Thread Dick Moores
At 06:47 AM 8/14/2007, Kent Johnson wrote: >Dick Moores wrote: > > Kent Johnson posted this to Tutor list Aug 8, 2007 > > (<http://mail.python.org/pipermail/tutor/2007-August/056194.html>): > > > > > > > Pytho

[Tutor] Question re Tutor List Etiquette

2007-08-14 Thread Dick Moores
the admins to do with Tutor -- to include a "Reply-To: tutor@python.org" header in the posts sent out by the list, it would enable us to address a reply only to the list by hitting the "Reply" button. Dick Moores ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Graphing the random.gauss distribution

2007-08-14 Thread Dick Moores
At 10:28 AM 8/14/2007, you wrote: >Dick Moores wrote: > > At 06:47 AM 8/14/2007, Kent Johnson wrote: > >> This could be a list comprehension: > >> d = [ [k, 0] for k in range(200) ] > > > > So you recommend using list comprehensions wherever possible? (I sur

Re: [Tutor] Question re Tutor List Etiquette

2007-08-14 Thread Dick Moores
At 11:56 AM 8/14/2007, Kent Johnson wrote: >Dick Moores wrote: > > When sending a reply to a post, to the list, should we also address > > the reply to the author of the post to which we are replying? > > (There's gotta be an easier way to say that..) If we do so,

Re: [Tutor] Python Book Recommendations

2007-08-15 Thread Dick Moores
there may be different classes of access, because I just searched on 'python' in titles and got only 15 hits. The latest published book is Python for Dummies (2006). And that's the ONLY Python book for 2006. Dick Moores ___ Tutor mail

[Tutor] Need to convert 1,987,087,234,456 to an int

2007-08-15 Thread Dick Moores
Str) So this is fine as long as none of the parts of the tuple is of the form 08X (where X is from 0-9). What to do? Thanks, Dick Moores ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Need to convert 1,987,087,234,456 to an int

2007-08-15 Thread Dick Moores
At 06:58 PM 8/15/2007, John Fouhy wrote: >On 16/08/07, Dick Moores <[EMAIL PROTECTED]> wrote: > > Python sees 1,987,077,234,456 as a tuple: > > >>>type(1,987,077,234,456) > > > >Hmm, not for me: > > >>> type(1,987,077,234,456) &g

Re: [Tutor] Need to convert 1,987,087,234,456 to an int

2007-08-15 Thread Dick Moores
At 06:58 PM 8/15/2007, John Fouhy wrote: >You could do this: > > >>> def decomma(*t): >... return int(''.join(str(i) for i in t)) What's that asterisk doing in decomma(*t)? Where do I go in the docs to look it up? Thanks, Dick ___ Tutor maillist -

Re: [Tutor] Need to convert 1,987,087,234,456 to an int

2007-08-15 Thread Dick Moores
At 06:58 PM 8/15/2007, John Fouhy wrote: >What python are you using? (2.5.1 for me) 2.5. If I install 2.51 will it install itself "over" my 2.5? Or will it set itself up in a separate Python 251 folder/directory? Dick ___ Tutor maillist - Tutor@pyt

Re: [Tutor] Need to convert 1,987,087,234,456 to an int

2007-08-15 Thread Dick Moores
To Eric Walker, John Fouhy, and Eric Brunson: Thanks very much. I think I'm beginning to get it. At least I was able to write a couple of functions that do what I wanted: = def f(n,m,*args): x = n*m for arg in args: product = arg*x x = product

Re: [Tutor] Python Book Recommendations [Was:[Re: Security]]

2007-08-15 Thread Dick Moores
At 05:48 PM 8/14/2007, Kent Johnson wrote: >I also have a shortcut set up so if I type >py modulename >in the Firefox address bar it takes me directly to the docs for that >module. To do this, create a bookmark with this URL: >file://localhost/Users/kent/Library/Documentation/Python-Docs-2.5/li

Re: [Tutor] Need to convert 1,987,087,234,456 to an int

2007-08-16 Thread Dick Moores
At 02:41 AM 8/16/2007, Alan Gauld wrote: >But Python 3000 is a semi mythical fancy that doesn't exist and may >never exist. >It is where all the ills of Python will be cured. Saying it is in Python 3000 >is usually a synonym for it won't be "fixed" anytime soon! But have you seen what Guido says?

Re: [Tutor] Python Book Recommendations [Was:[Re: Security]]

2007-08-17 Thread Dick Moores
>http://www.swc.scipy.org/ > >There are several links to older SWC URLs on python.org. None of them >are in the wiki where they could be easily fixed, however. Chris, THANK YOU, especially for the link, <http://www.swc.scipy.org/>. My thanks also to Alan, Wesley, and bhaaluu. What

[Tutor] What is a "symbolic debugger"

2007-08-17 Thread Dick Moores
g about for a while. Google was of little help (to me, at least), and searching Wikipedia on "symbolic debugger" gets me the Debugger article "Redirected from Symbolic debugger". I'm beginning to think that the debugger I want to learn, WinPdb, is also a symbolic deb

[Tutor] The Python 2.5 Quick Reference

2007-08-18 Thread Dick Moores
imon Brunning for Python 2.0 18 Jun 2000 upgraded by Richard Gruet for Python 1.5.2 30 Oct 1995 created by Chris Hoffmann for Python 1.3 Dick Moores ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] What is a "symbolic debugger"

2007-08-18 Thread Dick Moores
At 01:13 AM 8/18/2007, Alan Gauld wrote: >"Dick Moores" <[EMAIL PROTECTED]> wrote > > > article I saw a term, "symbolic debugger", I had been wondering > > about for a while. Google was of little help (to me, at least), and > >Its a debugger

Re: [Tutor] The Python 2.5 Quick Reference

2007-08-18 Thread Dick Moores
At 04:42 AM 8/18/2007, Kent Johnson wrote: >Dick Moores wrote: >>I was wondering if the Python 2.5 Quick Reference, by Richard >>Gruet, wouldn't make a suitable addition to a list of useful Python >>references. > >It has a link on the top-level documen

Re: [Tutor] A fun puzzle

2007-08-23 Thread Dick Moores
x in xrange(100): pass because there appears to be so much more going on, but their timings are essentially identical. Dick Moores XP, Python 2.5, editor is Ulipad == Bagda

Re: [Tutor] A fun puzzle

2007-08-23 Thread Dick Moores
At 08:20 AM 8/23/2007, Kent Johnson wrote: >Dick Moores wrote: >>At 07:34 PM 8/22/2007, Kent Johnson wrote: >>>FWIW here is my fastest solution: >>> >>>01 from itertools import chain >>>02 def compute(): >>>03 str_=str; int_=int; slice_=s

Re: [Tutor] A fun puzzle

2007-08-24 Thread Dick Moores
At 11:49 AM 8/23/2007, Kent Johnson wrote: >Dick Moores wrote: >>>Two reasons. First, looking up a name that is local to a function >>>is faster than looking up a global name. To find the value of >>>'str', the interpreter has to look at the module na

  1   2   3   4   5   6   >