"BartlebyScrivener" <[EMAIL PROTECTED]> writes:
> There are several of these writing quotes, all good in their own way,
And from Hamlet: brevity is the soul of wit.
--
http://mail.python.org/mailman/listinfo/python-list
"John Salerno" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Ben Cartwright wrote:
>> BartlebyScrivener wrote:
>>> What about a console beep? How do you add that?
>>>
>>> rpd
>>
>> Just use ASCII code 007 (BEL/BEEP):
>>
>> >>> import sys
>> >>> sys.stdout.write('\007')
>>
>> O
John Salerno wrote:
> John Salerno wrote:
>
> > from time import sleep
> ...
> > sleep(1.0)
>
> Very picky point, but I'd like to know what others think of this. Should
> I import as above, or should I do this:
>
> import time
>
> time.sleep(60.0) ???
>
> I think the 'from time import sl
>>You might also want to synchronize to a caesium clock, but the guy is
timing his laundry, <<
My morning coffee just streamed out of my nose. Air. I need air.
rpd
--
http://mail.python.org/mailman/listinfo/python-list
There are several of these writing quotes, all good in their own way,
because they emphasize concision as the first order of business for any
writer.
"If I had more time, I would write a short letter."--Blaise Pascal
"If the author had been less industrious, this book would be twice as
long."--Ev
Alex Martelli wrote:
> I'm hardly new to Python, yet it keeps helping me too;-).
Yeah, from what I hear and read, you know a thing or two about the
language. :)
--
http://mail.python.org/mailman/listinfo/python-list
John Salerno <[EMAIL PROTECTED]> wrote:
> Alex Martelli wrote:
>
> > I only use the 'from' statement to import specific modules from a
> > package, never to import specific objects (functions, classes, or
> > whatever) from a module.
>
> I like that. So in my case I'd use 'import time' (which I
Kent Johnson <[EMAIL PROTECTED]> wrote:
...
> If you use from xx import yy, searching for yy will show you its
> provenance as well.
But when seeing the barename yy, it gives no clue whether the module
you're reading used 'from xx import yy' or defined yy in any other way
(localy, globally, or
Alex Martelli wrote:
> I only use the 'from' statement to import specific modules from a
> package, never to import specific objects (functions, classes, or
> whatever) from a module.
I like that. So in my case I'd use 'import time' (which I actually
already changed last night). I think especial
Steve Holden wrote:
> You might also want to synchronize to a caesium clock, but the guy is
> timing his laundry, for Pete's sake! Can we agree your approach, while
> theoretically sound, might be a little over-complicated for a first
> application?
LOL. Thanks, I was about to fall out of my c
On 2006-03-09, John Salerno <[EMAIL PROTECTED]> wrote:
> Grant Edwards wrote:
>> On 2006-03-09, John Salerno <[EMAIL PROTECTED]> wrote:
>>
>>> from time import sleep
>>>
>>> minutes = input('Enter the number of minutes to wait: ')
>>>
>>> for x in range(minutes):
>>> sleep(1.0)
>>> minutes
Alex Martelli wrote:
> John Salerno <[EMAIL PROTECTED]> wrote:
>...
>
>>I think the 'from time import sleep' looks cleaner, because I'm only
>>taking what I need (is an import any more expensive than this from?),
>>but I also feel like the 'time.sleep' syntax is much more
>>self-describing a
Paul Rubin wrote:
> John Salerno <[EMAIL PROTECTED]> writes:
>
>>>for x in range(minutes,0,-1):
>>>sleep(60.0)
>>>print minutes, 'minutes remaining'
>>>
>>
>>Nice! Cross off another line! I feel like Hemingway. :)
>
>
> Besides the bug mentioned, I don't think you should really do it th
John Salerno <[EMAIL PROTECTED]> wrote:
...
> I think the 'from time import sleep' looks cleaner, because I'm only
> taking what I need (is an import any more expensive than this from?),
> but I also feel like the 'time.sleep' syntax is much more
> self-describing and better to read than just
Grant Edwards <[EMAIL PROTECTED]> wrote:
...
> > Nice! Cross off another line! I feel like Hemingway. :)
>
> Was he the one who once apologized to his editor for a story
> being so long because he was in a hurry and didn't have time to
> make it shorter?
Nope, that immortal quote is by Blaise
John Salerno <[EMAIL PROTECTED]> writes:
> > for x in range(minutes,0,-1):
> > sleep(60.0)
> > print minutes, 'minutes remaining'
> >
> Nice! Cross off another line! I feel like Hemingway. :)
Besides the bug mentioned, I don't think you should really do it that
way, since sleep(60.0) migh
James Stroud wrote:
> John Salerno wrote:
>> Grant Edwards wrote:
>>
>>> On 2006-03-09, John Salerno <[EMAIL PROTECTED]> wrote:
>>>
from time import sleep
minutes = input('Enter the number of minutes to wait: ')
for x in range(minutes):
sleep(1.0)
minutes
John Salerno wrote:
>> for x in range(minutes,0,-1):
>> sleep(60.0)
>> print minutes, 'minutes remaining'
>>
>
> I might be doing something wrong, but this just keeps printing out '10
> minutes remaining' each time.
should be:
for x in range(minutes,0,-1):
sleep(60.0)
print x,
John Salerno wrote:
> Grant Edwards wrote:
>
>> On 2006-03-09, John Salerno <[EMAIL PROTECTED]> wrote:
>>
>>> from time import sleep
>>>
>>> minutes = input('Enter the number of minutes to wait: ')
>>>
>>> for x in range(minutes):
>>> sleep(1.0)
>>> minutes -= 1
>>> print minutes, 'min
Ben Cartwright wrote:
> BartlebyScrivener wrote:
>> What about a console beep? How do you add that?
>>
>> rpd
>
> Just use ASCII code 007 (BEL/BEEP):
>
> >>> import sys
> >>> sys.stdout.write('\007')
>
> Or if you're on Windows, use the winsound standard module.
>
> --Ben
>
I'd prefer to
Grant Edwards wrote:
> On 2006-03-09, John Salerno <[EMAIL PROTECTED]> wrote:
>
>> from time import sleep
>>
>> minutes = input('Enter the number of minutes to wait: ')
>>
>> for x in range(minutes):
>> sleep(1.0)
>> minutes -= 1
>> print minutes, 'minutes remaining.'
>
> for x in
Grant Edwards wrote:
> Was he the one who once apologized to his editor for a story
> being so long because he was in a hurry and didn't have time to
> make it shorter?
Hmm, not sure. He doesn't seem like the type to apologize, or even have
long stories. :) He was ruthless with his edits, that'
On 2006-03-09, John Salerno <[EMAIL PROTECTED]> wrote:
> Grant Edwards wrote:
>> On 2006-03-09, John Salerno <[EMAIL PROTECTED]> wrote:
>>
>>> from time import sleep
>>>
>>> minutes = input('Enter the number of minutes to wait: ')
>>>
>>> for x in range(minutes):
>>> sleep(1.0)
>>> minutes
BartlebyScrivener wrote:
> What about a console beep? How do you add that?
>
> rpd
Just use ASCII code 007 (BEL/BEEP):
>>> import sys
>>> sys.stdout.write('\007')
Or if you're on Windows, use the winsound standard module.
--Ben
--
http://mail.python.org/mailman/listinfo/python-list
John Salerno wrote:
> from time import sleep
...
> sleep(1.0)
Very picky point, but I'd like to know what others think of this. Should
I import as above, or should I do this:
import time
time.sleep(60.0) ???
I think the 'from time import sleep' looks cleaner, because I'm only
tak
Grant Edwards wrote:
> On 2006-03-09, John Salerno <[EMAIL PROTECTED]> wrote:
>
>> from time import sleep
>>
>> minutes = input('Enter the number of minutes to wait: ')
>>
>> for x in range(minutes):
>> sleep(1.0)
>> minutes -= 1
>> print minutes, 'minutes remaining.'
>
> for x in
BartlebyScrivener wrote:
> What about a console beep? How do you add that?
>
> rpd
>
Ooh, good point! I forgot about the most important part, otherwise I'd
never know it was done and someone would steal my clothes! :)
Time to do some library reference research
--
http://mail.python.org/m
James Stroud wrote:
> Very nice, but maybe
>
> ...
>sleep(60.0)
>
> This corrects for the number of seconds in a minute.
>
> James
>
Thanks! And yeah, I fixed that little issue. If only laundry could be
done that fast. :)
--
http://mail.python.org/mailman/listinfo/python-list
On 2006-03-09, John Salerno <[EMAIL PROTECTED]> wrote:
> from time import sleep
>
> minutes = input('Enter the number of minutes to wait: ')
>
> for x in range(minutes):
> sleep(1.0)
> minutes -= 1
> print minutes, 'minutes remaining.'
for x in range(minutes,0,-1):
sleep(60.
What about a console beep? How do you add that?
rpd
--
http://mail.python.org/mailman/listinfo/python-list
John Salerno wrote:
> My first project when I started learning C# was to make a little timer
> to tell me when my laundry was done :) and I thought it would be fun to
> convert this to Python. Here's what I came up with after much struggling
> with the Timer class from the threading module -- as
John Salerno wrote:
> sleep(1.0)
Heh heh, that was for testing. Obviously it should read 60.0 (is a float
necessary at all?).
--
http://mail.python.org/mailman/listinfo/python-list
My first project when I started learning C# was to make a little timer
to tell me when my laundry was done :) and I thought it would be fun to
convert this to Python. Here's what I came up with after much struggling
with the Timer class from the threading module -- as you can see, I
abandoned i
33 matches
Mail list logo