I have this script:
import time
def hello():
print "yay you got me to print"
def longLoop():
x = 0
for n in range(10):
time.sleep(5)
x = x + n
longLoop()
It will run in the console for a long time. How can I send a command and
cause it to stop and pursue hello(
On 6/7/2009 6:37 PM David said...
In one of my questions to this list, Kent explained to me how to use a
loop like this;
#!/usr/bin/python
from time import sleep
def get(numbers):
print 'Calling ', numbers
sleep(1)
print 'Connected '
sleep(1)
def call_numbers():
for i in r
def get(numbers):
print 'Calling ', numbers
sleep(1)
print 'Connected '
sleep(1)
def call_numbers():
for i in range(9549355543, 9549355560):
numbers = i
get(numbers)
call_numbers()
Is there a technical name for a loop like this?
For loop? That is what I c
On Sun, Jun 7, 2009 at 3:34 PM, Emile van Sebille wrote:
> To explain why we've tended to suggest using int and minval tests and avoid the range inclusion test, consider the following timeit
> results:
The performance penalty for 'in range(...)' is even greater when the
value is not found, becaus
Forwarding to the list, forgot again :(
--
Powered by Gentoo GNU/Linux
http://linuxcrazy.com
--- Begin Message ---
bob gailer wrote:
David wrote:
In one of my questions to this list, Kent explained to me how to use a
loop like this;
#!/usr/bin/python
from time import sleep
def get(numbers):
David wrote:
In one of my questions to this list, Kent explained to me how to use a
loop like this;
#!/usr/bin/python
from time import sleep
def get(numbers):
print 'Calling ', numbers
sleep(1)
print 'Connected '
sleep(1)
def call_numbers():
for i in range(9549355543, 9549
In one of my questions to this list, Kent explained to me how to use a
loop like this;
#!/usr/bin/python
from time import sleep
def get(numbers):
print 'Calling ', numbers
sleep(1)
print 'Connected '
sleep(1)
def call_numbers():
for i in range(9549355543, 9549355560):
read bottom
Date: Sun, 7 Jun 2009 21:48:55 +
From: alan.ga...@btinternet.com
Subject: Re: [Tutor] gui menu
To: e_mit...@hotmail.com
CC: tutor@python.org
Forwarding to group.
Please use Reply All when responding to the tutor group.
Thanks for the extra information it is helpful.
From: Essa
Forwarding to group.
Please use Reply All when responding to the tutor group.
Thanks for the extra information it is helpful.
From: Essah Mitges
To: alan.ga...@btinternet.com
Sent: Sunday, 7 June, 2009 10:32:27 PM
Subject: RE: [Tutor] gui menu
http://osdir.com/ml/python.pygame/2002-11/msg000
"Essah Mitges" wrote
import sys, pygame
pygame.init()
background = pygame.image.load(""My png image 800x 532)
backgroundRect = background.get_rect()
size = (width, height) = background.get.size()
screen = pygame.display.set_mode(size)
screen.blit(background, backgroundRect)
pygame.display.flip(
On 6/7/2009 10:17 AM Gonzalo Garcia-Perate said...
Emile, Kent thank you both for your reply, after sending my previous
email I realised that it wasn't working as expected in all cases.
this does work:
def within_range_final(self, n, n2, threshold=5):
return n in range(n2-threshold, n2+thr
On Sun, Jun 7, 2009 at 1:17 PM, Gonzalo
Garcia-Perate wrote:
> Emile, Kent thank you both for your reply, after sending my previous
> email I realised that it wasn't working as expected in all cases.
>
> this does work:
>
> def within_range_final(self, n, n2, threshold=5):
> return n in range(n
import sys, pygame
pygame.init()
background = pygame.image.load(""My png image 800x 532)
backgroundRect = background.get_rect()
size = (width, height) = background.get.size()
screen = pygame.display.set_mode(size)
screen.blit(background, backgroundRect)
pygame.display.flip()
I want to use pygame t
On 6/7/2009 10:48 AM roberto said...
hello
i have a short question:
is vpython usable in conjunction with python 3.0 ?
This is likely better answered by the vpython crowd -- I've not used or
previously hear of vpython, but they're rather explicit on their
download pages here http://vpython.o
hello
i have a short question:
is vpython usable in conjunction with python 3.0 ?
i hope so, also vpython site for download doesn't issue any warning
about this topic
thank you
--
roberto
___
Tutor maillist - Tutor@python.org
http://mail.python.org/
Emile, Kent thank you both for your reply, after sending my previous
email I realised that it wasn't working as expected in all cases.
this does work:
def within_range_final(self, n, n2, threshold=5):
return n in range(n2-threshold, n2+threshold+1)
What I have is an ultrasound sensor that g
On Sun, Jun 7, 2009 at 10:08 AM, Gonzalo
Garcia-Perate wrote:
> the solution laid somewhere in between:
>
> def within_range(self, n, n2, threshold=5):
> if n in range(n2-threshold, n2+threshold+1) and n <
> n2+threshold or n > n2 + threshold : return True
> return False
This is a b
On 6/7/2009 8:44 AM Emile van Sebille said...
On 6/7/2009 7:08 AM Gonzalo Garcia-Perate said...
the solution laid somewhere in between:
def within_range(self, n, n2, threshold=5):
if n in range(n2-threshold, n2+threshold+1) and n <
n2+threshold or n > n2 + threshold : return True
On 6/7/2009 7:08 AM Gonzalo Garcia-Perate said...
the solution laid somewhere in between:
def within_range(self, n, n2, threshold=5):
if n in range(n2-threshold, n2+threshold+1) and n <
n2+threshold or n > n2 + threshold : return True
return False
Be careful here -- you proba
the solution laid somewhere in between:
def within_range(self, n, n2, threshold=5):
if n in range(n2-threshold, n2+threshold+1) and n <
n2+threshold or n > n2 + threshold : return True
return False
This seems a bit more pythonic than my original function. Thank you both.
2009/6/
On Sun, 2009-06-07 at 00:54 +0200, Sander Sweers wrote:
> 2009/6/6 Nick Burgess :
> > Is it posible to take
> > the regex compile from user input? To make it take an argument, like
> >
> >> csvSearch.py 10.192.55
>
> You can use raw_input() see [1] for the docs
> user_input = raw_input('Please
21 matches
Mail list logo