Re: [Tutor] [OT] some jobs are just too big for Python

2006-09-08 Thread Amadeo Bellotti
Thats acutally a pretty good analogy but i think python isnt yet at its fullest potential or even closeOn 9/8/06, Terry Carroll < [EMAIL PROTECTED]> wrote: http://www.news.com.au/dailytelegraph/story/0,22049,20372915-5006003,00.htmlSummary: A python (the actual snake) ate an entire pregnant sheep i

[Tutor] [OT] some jobs are just too big for Python

2006-09-08 Thread Terry Carroll
http://www.news.com.au/dailytelegraph/story/0,22049,20372915-5006003,00.html Summary: A python (the actual snake) ate an entire pregnant sheep in Malaysia; and was unable to even move afterwards. The story above includes an impressive if somewhat disturbing photo. ___

Re: [Tutor] is there a tutorial on ez_install.py

2006-09-08 Thread Bill Campbell
On Fri, Sep 08, 2006, Kent Johnson wrote: >Bill Campbell wrote: >> On Fri, Sep 08, 2006, Kent Johnson wrote: >>> http://peak.telecommunity.com/DevCenter/EasyInstall >> >> Is it possible to use EasyInstall to install relative to a >> directory other than the site-packages directory in the manner >>

Re: [Tutor] tempfile and webbrowser

2006-09-08 Thread Kent Johnson
Alan Gauld wrote: >>> Use os.remove() instead. >> os.remove() and os.unlink() are identical according to the docs; if >> you look at posix_module.c you can see this is true - they both map >> to posix_unlink(). >> >> Kent > > Maybe so, but os.remove() works on my XP box... :-) > > I didn't try

Re: [Tutor] Some questions about my yen-USD.py

2006-09-08 Thread Alan Gauld
> Alan Gauld wrote: >> unfortunately 3 values won't work, it only works for numbers... >> > "%**.*" % ('-', 12,3,123.456789) >> >> Error... > > How about this: > In [4]: "%*.*f" % (-12,3,123.456789) > Out[4]: '123.457 ' Silly me! Obvious when you see it :-) Alan G. ___

Re: [Tutor] tempfile and webbrowser

2006-09-08 Thread Alan Gauld
>> Use os.remove() instead. > > os.remove() and os.unlink() are identical according to the docs; if > you look at posix_module.c you can see this is true - they both map > to posix_unlink(). > > Kent Maybe so, but os.remove() works on my XP box... :-) I didn't try unlink since the OP said it di

Re: [Tutor] is there a tutorial on ez_install.py

2006-09-08 Thread Kent Johnson
Bill Campbell wrote: > On Fri, Sep 08, 2006, Kent Johnson wrote: >> http://peak.telecommunity.com/DevCenter/EasyInstall > > Is it possible to use EasyInstall to install relative to a > directory other than the site-packages directory in the manner > that the standard distutils does with the ``--ro

Re: [Tutor] is there a tutorial on ez_install.py

2006-09-08 Thread Bill Campbell
On Fri, Sep 08, 2006, Kent Johnson wrote: >johnf wrote: >> Hi, >> >> Is there a location (web link) that explains the inner workings of >> setuptools, >> etc > >http://peak.telecommunity.com/DevCenter/EasyInstall Is it possible to use EasyInstall to install relative to a directory other tha

Re: [Tutor] Some questions about my yen-USD.py

2006-09-08 Thread Kent Johnson
Alan Gauld wrote: > unfortunately 3 values won't work, it only works for numbers... > "%**.*" % ('-', 12,3,123.456789) > > Error... How about this: In [4]: "%*.*f" % (-12,3,123.456789) Out[4]: '123.457 ' Kent ___ Tutor maillist - Tutor@pyt

Re: [Tutor] Some questions about my yen-USD.py

2006-09-08 Thread Alan Gauld
> http://www.python.org/doc/current/lib/typesseq-strings.html > "%.*f" % (2, 2.234234) > '2.23' Cool! I'd never noticed this, or maybe just difdn't understand the significance. And it works for multiple values too: >>> "%*.*" % (12,3,123.456789) unfortunately 3 values won't work, it only

Re: [Tutor] is there a tutorial on ez_install.py

2006-09-08 Thread Kent Johnson
johnf wrote: > Hi, > > Is there a location (web link) that explains the inner workings of > setuptools, > etc http://peak.telecommunity.com/DevCenter/EasyInstall Kent ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinf

[Tutor] is there a tutorial on ez_install.py

2006-09-08 Thread johnf
Hi, Is there a location (web link) that explains the inner workings of setuptools, etc John ___ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Some questions about my yen-USD.py

2006-09-08 Thread Andrei
Dick Moores rcblue.com> writes: > Version 3 is now at http://www.rcblue.com/Python/yen-USD-v3.txt . Am > I done? Or will a v4 be necessary/advisable? The original program worked fine from the user's POV and the code had lots of good features (functions instead of monolithic code, docstrings). I

Re: [Tutor] Some questions about my yen-USD.py

2006-09-08 Thread Kent Johnson
Dick Moores wrote: > Yes, Danny, I've taken yours and Andrei's comment about again() to > heart; I see my confusion. I've revised again() and main(). See my > version 2: http://www.rcblue.com/Python/yen-USD-v2.txt Is this better? Have you noticed the similarity between getRate() and getAmount(

Re: [Tutor] Some questions about my yen-USD.py

2006-09-08 Thread Kent Johnson
Dick Moores wrote: > At 05:37 AM 9/7/2006, Andrei wrote: >> Dick Moores rcblue.com> writes: >> >>> (2) Is my roundingN() function OK? Is there a better way to write it? >>> Will the line >>> >>> n = round(float(n)*(10**rounding))/(10**rounding) >> Using format strings is easier I think. "%

Re: [Tutor] Some questions about my yen-USD.py

2006-09-08 Thread Dick Moores
Version 3 is now at http://www.rcblue.com/Python/yen-USD-v3.txt . Am I done? Or will a v4 be necessary/advisable? At 05:37 AM 9/7/2006, Andrei wrote: >Dick Moores rcblue.com> writes: > > (1) Have I handled possible user-errors OK? > >I've tested it a bit and it seems to be quite robust. Thanks.

Re: [Tutor] tempfile and webbrowser

2006-09-08 Thread Kent Johnson
Alan Gauld wrote: >> The file deletion (os.unlink(f.name)) does not work on Windows (it >> works on Ubuntu with Python 2.4, though). >> >> So, is there a way to get this os.unlink(f.name) to work on Windows? > > Use os.remove() instead. os.remove() and os.unlink() are identical according to the

Re: [Tutor] Some questions about my yen-USD.py

2006-09-08 Thread Alan Gauld
> So now that I know better, I'm trying to write the beginnings of a > general setPrecision() function using format strings. However, it > appears that a variable cannot be used instead of the ".2" in > > "%.2f" % 2.234234 The trick is to create the format string using the variable then use th

Re: [Tutor] Some questions about my yen-USD.py

2006-09-08 Thread Justin Ezequiel
Dick Moores rcblue.com> writes: > So now that I know better, I'm trying to write the beginnings of a > general setPrecision() function using format strings. However, it > appears that a variable cannot be used instead of the ".2" in > > "%.2f" % 2.234234 > How to do this? http://www.python.org/

Re: [Tutor] A simple list question...

2006-09-08 Thread Alan Gauld
> 1. How can I easily strip out the newline characters from the > elements > of cleanedlist? You can use the string strip() method. > 2. Is there a better way to achieve my objective (ie. a list method > for generating the cleaned list?) You can convert the list to a Set. >>> L = [1,2,1,3,4,2]

Re: [Tutor] tempfile and webbrowser

2006-09-08 Thread Alan Gauld
> The file deletion (os.unlink(f.name)) does not work on Windows (it > works on Ubuntu with Python 2.4, though). > > So, is there a way to get this os.unlink(f.name) to work on Windows? Use os.remove() instead. Alan G. ___ Tutor maillist - Tutor@py

Re: [Tutor] Some questions about my yen-USD.py

2006-09-08 Thread Dick Moores
At 09:39 PM 9/7/2006, Danny Yoo wrote: > >> I'm looking at the last part of the main() function: > >> > >> # > >> def main(): > >> while True: > >> ... > >> again() > >> if again: > >> break > >> # > >> > >> This looks a l