Quentin Agren wrote:
> Hi,
>
> My name Quentin, and this is my first post to this list so please redirect
> me if this is not the proper audience.
>
> I have been studying the 'importlib' standard library package this past
> week, and although I find it very readable I am puzzled by some questio
Hi,
My name Quentin, and this is my first post to this list so please redirect
me if this is not the proper audience.
I have been studying the 'importlib' standard library package this past
week, and although I find it very readable I am puzzled by some questions
that I'd like to share.
- [Chick
>One question is whats the best GUI library to build from?
WxPython is a very good one. However, you should look into Pythoncard
(http://pythoncard.sourceforge.net/) which lets you build WxPython even
easier.
--
This email has been scanned for viruses & spam by Domenebutikken -
www.domenebutik
> Hello my name is lamonte and I'm interesting in getting
> better @ python so I guess this is the correct place
Welcome, and you are right, this is the place for learning! :-)
> One question is whats the best GUI library to build from?
That depends a lot on what you want to do and what your
Hello my name is lamonte and I'm interesting in getting better @ python so
I guess this is the correct place then :).
One question is whats the best GUI library to build from?
Anyone recommend any good tutorials that helped them get good @ learning
python?
I know some decent basics and soon to t
thats fine its just my dad would need that and it would be easier for him if he had the exchange rate bulit inOn 9/17/06, Dick Moores <
[EMAIL PROTECTED]> wrote:At 07:10 PM 9/17/2006, Amadeo Bellotti wrote:>ok i jsut wanted to say great program but i would like to see an
>acutal exchange rate like
>>> And what's the downside of the way I've done it?
>>
>> Its slow...
>
> Actually it is not particularly slow. The actual function code is
> created once, when the module is compiled; creating a function
> object and binding it to a name is pretty fast. There is a good
> discussion here:
> htt
At 06:56 AM 9/18/2006, Luke Paireepinart wrote:
>Dick Moores wrote:
>>At 05:20 AM 9/18/2006, Kent Johnson wrote:
>>
>>
>>>You have greatly underused Decimal - it is capable of multiplication and
>>>division of fractional quantities directly:
>>>
>>>In [1]: from decimal import Decimal as D
>>>
>>>In
Dick Moores wrote:
> At 05:20 AM 9/18/2006, Kent Johnson wrote:
>
>
>> You have greatly underused Decimal - it is capable of multiplication and
>> division of fractional quantities directly:
>>
>> In [1]: from decimal import Decimal as D
>>
>> In [2]: x=D('1.23')
>>
>> In [3]: y=D('4.5')
>>
>> I
Dick Moores wrote:
> At 01:00 AM 9/18/2006, Alan Gauld wrote:
>
1. in your roundNumber function, you define a function
incrementDigit.
I'm pretty sure that this function is destroyed and recreated
every time
you call the function roundNumber.
>>> I don't
At 05:20 AM 9/18/2006, Kent Johnson wrote:
>You have greatly underused Decimal - it is capable of multiplication and
>division of fractional quantities directly:
>
>In [1]: from decimal import Decimal as D
>
>In [2]: x=D('1.23')
>
>In [3]: y=D('4.5')
>
>In [4]: x*y
>Out[4]: Decimal("5.535")
>
>In
At 01:00 AM 9/18/2006, Alan Gauld wrote:
> >> 1. in your roundNumber function, you define a function
> >> incrementDigit.
> >> I'm pretty sure that this function is destroyed and recreated
> >> every time
> >> you call the function roundNumber.
> > I don't understand. What's another way?
>
>def
Alan Gauld wrote:
>>> 1. in your roundNumber function, you define a function
>>> incrementDigit.
>>> I'm pretty sure that this function is destroyed and recreated
>>> every time
>>> you call the function roundNumber.
>> I don't understand. What's another way?
>
> def f():
> def g(): retur
Dick Moores wrote:
> I'm bck!
>
> I kept getting ideas for what I (and some of you) thought was a
> finished yen-USD.py. And some of the good advice I got was to move on
> to other things. I did for a while, but I kept thinking up new
> revisions. The script has more than doubled in length.
>> 1. in your roundNumber function, you define a function
>> incrementDigit.
>> I'm pretty sure that this function is destroyed and recreated
>> every time
>> you call the function roundNumber.
> I don't understand. What's another way?
def f():
def g(): return 42
return g()
def g():
At 08:13 PM 9/17/2006, Luke Paireepinart wrote:
Dick Moores wrote:
> I'm bck!
>
> I kept getting ideas for what I (and some of you) thought was a
> finished yen-USD.py. And some of the good advice I got was to move
on
> to other things. I did for a while, but I kept thinking up new
> revis
Dick Moores wrote:
> I'm bck!
>
> I kept getting ideas for what I (and some of you) thought was a
> finished yen-USD.py. And some of the good advice I got was to move on
> to other things. I did for a while, but I kept thinking up new
> revisions. The script has more than doubled in length.
At 07:10 PM 9/17/2006, Amadeo Bellotti wrote:
>ok i jsut wanted to say great program but i would like to see an
>acutal exchange rate like maybe get it from a website it would be so
>much nicer and easier to use also it would help linux users who run
>from console so they dont have to look up th
ok i jsut wanted to say great program but i would like to see an acutal exchange rate like maybe get it from a website it would be so much nicer and easier to use also it would help linux users who run from console so they dont have to look up the current rate online
On 9/17/06, Dick Moores <[EMAIL
I'm bck!
I kept getting ideas for what I (and some of you) thought was a
finished yen-USD.py. And some of the good advice I got was to move on
to other things. I did for a while, but I kept thinking up new
revisions. The script has more than doubled in length. I'd previously
posted v4 at <
> 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.
___
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
> 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
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
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(
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. "%
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.
> 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
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/
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
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?
You could use simpl
Pawel Kraszewski kraszewscy.net> writes:
> > > get me into trouble with the flakiness of float(n)? In testing I
> > > didn't find any problems, but ..
> >
> > Nah. Float accuracy is only a problem if you need around lots of
> > significant digits (16 or so).
>
> I wouldn't bet. Such a simple thi
>> I'm looking at the last part of the main() function:
>>
>> #
>> def main():
>> while True:
>> ...
>> again()
>> if again:
>> break
>> #
>>
>> This looks a little suspicious. What does the again() function do, and
>>
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. "%.2f" % 2.34234 will give
At 07:16 AM 9/7/2006, Danny Yoo wrote:
>Hi Dick,
>
>I'm looking at the last part of the main() function:
>
>#
>def main():
> while True:
> ...
> again()
> if again:
> break
>#
>
>This looks a little suspicious. What does
Dnia czwartek, 7 września 2006 14:37, Andrei napisał:
> > get me into trouble with the flakiness of float(n)? In testing I
> > didn't find any problems, but ..
>
> Nah. Float accuracy is only a problem if you need around lots of
> significant digits (16 or so).
I wouldn't bet. Such a simple thing
Hi Dick,
I'm looking at the last part of the main() function:
#
def main():
while True:
...
again()
if again:
break
#
This looks a little suspicious. What does the again() function do, and is
it supposed to return a v
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.
> (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 forma
On 9/7/06, Dick Moores <[EMAIL PROTECTED]> wrote:
I've just finished a script for converting Yen to USD, andvice-versa. A simple, even silly thing to do (a friend asked me to
write it for him--probably just to humor me), but I have tried tobuild in some bells and whistles. In doing so, some questi
I've just finished a script for converting Yen to USD, and
vice-versa. A simple, even silly thing to do (a friend asked me to
write it for him--probably just to humor me), but I have tried to
build in some bells and whistles. In doing so, some questions arose.
If some of you Tutors could take l
40 matches
Mail list logo