for (dir, tm) in SEQUENCE:
> NameError: name 'SEQUENCE' is not defined
> ---
>
> import time
> import threading
>
> set_right_speed(150)
> set_left_speed(105)
>
> def cmdHandler():
> g
for (dir, tm) in SEQUENCE:
NameError: name 'SEQUENCE' is not defined
---
import time
import threading
set_right_speed(150)
set_left_speed(105)
def cmdHandler():
global notDone
while True:
Oke, lets try your code.Can you help me with that.
This is my code:
-
from gopigo import *
import time
set_right_speed(150)
set_left_speed(105)
enable_servo()
fwd()
print("forward 1x")
time.sleep(4)
stop()
while True:
servo(90)
mindist = 80
input/ldompel...@casema.nl wrote:
>>The code in capture_key.py may look a bit scary, but just as I took it
>>without bothering the details you can take the resulting module without
>>caring about the code in it. Alternatively you can search
>
>>https://pypi.python.org
>
> Thanks for the link. I
> >
> > > input/ldompel...@casema.nl wrote:
> > >
> > > > > choices = raw_input("letter s to stop:")
> > > >
> > > > Oh no, this is not what I want. Now it is waiting for input when its go
> > > > further with the script. Because I
input/ldompel...@casema.nl wrote:
> In reply to "Peter Otten" who wrote the following:
>
>> input/ldompel...@casema.nl wrote:
>>
>> > > choices = raw_input("letter s to stop:")
>> >
>> > Oh no, this is not what I want.
In reply to "Peter Otten" who wrote the following:
> input/ldompel...@casema.nl wrote:
>
> > > choices = raw_input("letter s to stop:")
> >
> > Oh no, this is not what I want. Now it is waiting for input when its go
> > further with the scr
input/ldompel...@casema.nl wrote:
> > choices = raw_input("letter s to stop:")
>
> Oh no, this is not what I want. Now it is waiting for input when its go
> further with the script. Because I have an while True: so I want that the
> script go's continue onl
assumes Python 3.
>To fix your problem replace the line
> choices = input("letter s to stop:")
>in your script with
> choices = raw_input("letter s to stop:")
Oh no, this is not what I want. Now it is waiting for input when its go further
r script.
In this particular case the problem is that you are using Python 2 where
input() tries to execute the text the user enters as Python code.
Tian's example code assumes Python 3.
To fix your problem replace the line
choices = input("letter s to stop:")
in your script with
choices = raw_input("letter s to stop:")
--
https://mail.python.org/mailman/listinfo/python-list
while True:"
> > Now I want to use "raw_input" and when I press "s" on the keybord that it=
> will=20
> > "break" the continues loop.
In this script it always break even when I not press 's'
I want th
在 2015年11月4日星期三 UTC-6下午3:45:09,input/ld...@casema.nl写道:
> I have an continues loop with "while True:"
> Now I want to use "raw_input" and when I press "s" on the keybord that it
> will
> "break" the continues loop.
>
> I tried:
> choi
On Thu, 5 Nov 2015 09:37 am, input/ldompel...@casema.nl wrote:
> I quote the s, but its still break even when I not press the s.
The code you have shown us is so full of bugs and typos that you cannot
possibly be running that code.
Unfortunately, we do not have magical powers. We cannot see the
In reply to "Joel Goldstick" who wrote the following:
> On Wed, Nov 4, 2015 at 4:44 PM, wrote:
>
> > I have an continues loop with "while True:"
> > Now I want to use "raw_input" and when I press "s" on the keybord that it
> > wi
On Wed, Nov 4, 2015 at 4:44 PM, wrote:
> I have an continues loop with "while True:"
> Now I want to use "raw_input" and when I press "s" on the keybord that it
> will
> "break" the continues loop.
>
> I tried:
> choices = raw_input
&g
On Wed, Nov 4, 2015 at 2:44 PM, wrote:
> I have an continues loop with "while True:"
> Now I want to use "raw_input" and when I press "s" on the keybord that it will
> "break" the continues loop.
>
> I tried:
> choices = raw_inpu
I have an continues loop with "while True:"
Now I want to use "raw_input" and when I press "s" on the keybord that it will
"break" the continues loop.
I tried:
choices = raw_input
if choises == s:
break
But even when I not press "s" it "
On Mon, 10 Mar 2014 17:57:19 +0100, Peter Otten wrote:
> Steven D'Aprano wrote:
>> what are my options for *automatically* supplying input to raw_input?
>
> https://pypi.python.org/pypi/mock
>
> In Python 3 this is part of the standard library:
Nice!
Thanks
Steven D'Aprano writes:
> Does anyone have any good hints for testing interactive code that uses
> raw_input, or input in Python 3?
Are you testing the behaviour of the ‘input’ function?
If not, then it is an external dependency; and, since you're not
interested in testing it
On 03/10/2014 08:59 AM, Steven D'Aprano wrote:
With an
automated test, I can provide the arguments, and check the result, but
what are my options for *automatically* supplying input to raw_input?
pexpect?
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
Steven D'Aprano wrote:
> Does anyone have any good hints for testing interactive code that uses
> raw_input, or input in Python 3?
>
> A simple technique would be to factor out the interactive part, e.g. like
> this:
>
> # Before
> def spam():
> answer = raw
Steven D'Aprano Wrote in
message:
> Does anyone have any good hints for testing interactive code that uses
> raw_input, or input in Python 3?
>
> A simple technique would be to factor out the interactive part, e.g. like
> this:
>
> # Before
> def spam():
&g
On 10 March 2014 15:59, Steven D'Aprano
wrote:
> Does anyone have any good hints for testing interactive code that uses
> raw_input, or input in Python 3?
>
> A simple technique would be to factor out the interactive part, e.g. like
> this:
>
> # Before
> def spa
Does anyone have any good hints for testing interactive code that uses
raw_input, or input in Python 3?
A simple technique would be to factor out the interactive part, e.g. like
this:
# Before
def spam():
answer = raw_input(prompt)
return eggs(answer) + cheese(answer) + toast(answer
On Sun, Jan 19, 2014 at 1:12 PM, Gene Heskett wrote:
> On Sunday 19 January 2014 15:11:52 Larry Martell did opine:
>
>> On Sun, Jan 19, 2014 at 12:17 PM, Mark Lawrence
> wrote:
>> > On 19/01/2014 18:15, Grant Edwards wrote:
>> >> On 2014-01-19, Mark Lawrence wrote:
>> >>> Actually, to go off at
On Sunday 19 January 2014 15:08:31 Roy Smith did opine:
> In article ,
>
> Grant Edwards wrote:
> > I can still remember the point in my first trip to the UK when I
> > accidentally stumbled across darts on TV. Given the endless variety
> > (and quantity) of pointless crap that people watch her
On Sunday 19 January 2014 15:11:52 Larry Martell did opine:
> On Sun, Jan 19, 2014 at 12:17 PM, Mark Lawrence
wrote:
> > On 19/01/2014 18:15, Grant Edwards wrote:
> >> On 2014-01-19, Mark Lawrence wrote:
> >>> Actually, to go off at a tangent, I'm just getting into GUIs via
> >>> wxPython. I'v
On 01/19/2014 10:41 AM, Chris Angelico wrote:
On Mon, Jan 20, 2014 at 4:50 AM, Ethan Furman wrote:
The difference I was thinking of is:
"%h" % 3.14 # this works
vs.
hex(3.14) # this raises
In 3.5 both will raise.
Now you have me *thoroughly* intrigued. It's not %h (incomplete form
On 19/01/2014 19:24, Larry Martell wrote:
On Sun, Jan 19, 2014 at 12:17 PM, Mark Lawrence wrote:
On 19/01/2014 18:15, Grant Edwards wrote:
On 2014-01-19, Mark Lawrence wrote:
Actually, to go off at a tangent, I'm just getting into GUIs via
wxPython. I've discovered there are distinct advan
On Sun, Jan 19, 2014 at 12:17 PM, Mark Lawrence wrote:
> On 19/01/2014 18:15, Grant Edwards wrote:
>>
>> On 2014-01-19, Mark Lawrence wrote:
>>> Actually, to go off at a tangent, I'm just getting into GUIs via
>>> wxPython. I've discovered there are distinct advantages having to
>>> write endles
On 19/01/2014 18:15, Grant Edwards wrote:
On 2014-01-19, Mark Lawrence wrote:
On 18/01/2014 18:41, Mark Lawrence wrote:
On 18/01/2014 18:30, Roy Smith wrote:
Pardon me for being cynical, but in the entire history of the universe,
has anybody ever used input()/raw_input() for anything other
On 2014-01-19, Roy Smith wrote:
> In article ,
> Grant Edwards wrote:
>
>> I can still remember the point in my first trip to the UK when I
>> accidentally stumbled across darts on TV. Given the endless variety
>> (and quantity) of pointless crap that people watch here in the US, I
>> can't real
On Mon, Jan 20, 2014 at 5:37 AM, Roy Smith wrote:
> What's so complicated?
>
> points = 501
> for dart in throws():
>if points - dart == 0 and dart.is_double():
> raise YouWin
>if points - dart < 0:
> continue
>points -= dart
>beer.drink()
assert victory
raise beer
Ch
On Mon, Jan 20, 2014 at 4:50 AM, Ethan Furman wrote:
> The difference I was thinking of is:
>
> "%h" % 3.14 # this works
>
> vs.
>
> hex(3.14) # this raises
>
> In 3.5 both will raise.
Now you have me *thoroughly* intrigued. It's not %h (incomplete format
- h is a modifier), nor %H (unsuppo
In article ,
Grant Edwards wrote:
> I can still remember the point in my first trip to the UK when I
> accidentally stumbled across darts on TV. Given the endless variety
> (and quantity) of pointless crap that people watch here in the US, I
> can't really explain why I was so baffled and amused
On 01/19/2014 08:38 AM, Chris Angelico wrote:
On Mon, Jan 20, 2014 at 3:14 AM, Ethan Furman wrote:
--> def quux1(x): return str(x+1)
--> quux1(2.3)
'3.3'
(Will be) fixed in 3.5 [1] :)
[1] Which is to say, both will raise an exception.
Why would that raise?
Sorry, should have read that c
On 2014-01-19, Mark Lawrence wrote:
> On 18/01/2014 18:41, Mark Lawrence wrote:
>> On 18/01/2014 18:30, Roy Smith wrote:
>>> Pardon me for being cynical, but in the entire history of the universe,
>>> has anybody ever used input()/raw_input() for anything other
On 18/01/2014 18:41, Mark Lawrence wrote:
On 18/01/2014 18:30, Roy Smith wrote:
Pardon me for being cynical, but in the entire history of the universe,
has anybody ever used input()/raw_input() for anything other than a
homework problem?
Not me personally. I guess raw_input must have been
On Mon, Jan 20, 2014 at 4:42 AM, Grant Edwards wrote:
> 2) I didn't claim that sys.stdin.readline() was as simple as using
>input. I didn't claim it was preferable. I merely presented it as
>a refutation to the argument that if you don't use input/raw_input
>
re history of the universe,
>>>> has anybody ever used input()/raw_input() for anything other than a
>>>> homework problem?
>>>
>>> Homework problems (and 'toy' programs, such as hangman), whether in a
>>> programming class or elsewhere, are o
On Mon, Jan 20, 2014 at 3:14 AM, Ethan Furman wrote:
>>> --> def quux1(x): return str(x+1)
>> --> quux1(2.3)
>> '3.3'
>
> (Will be) fixed in 3.5 [1] :)
> [1] Which is to say, both will raise an exception.
Why would that raise?
ChrisA
--
https://mail.python.org/mailman/listinfo/python-list
On 01/19/2014 12:26 AM, Rustom Mody wrote:
On Sunday, January 19, 2014 10:29:58 AM UTC+5:30, Chris Angelico wrote:
On Sun, Jan 19, 2014 at 3:43 PM, Rustom Mody wrote:
As do these pieces of code:
--> def quux1(x): return str(x+1)
--> def quux2(x): return hex(x+1)[2:]
They do?
--> quux1(2.3
On 2014-01-18, Terry Reedy wrote:
> On 1/18/2014 1:30 PM, Roy Smith wrote:
>> Pardon me for being cynical, but in the entire history of the universe,
>> has anybody ever used input()/raw_input() for anything other than a
>> homework problem?
>
> Homework problems (
On Sun, Jan 19, 2014 at 7:26 PM, Rustom Mody wrote:
> If you want to give an irrelevant example at least give a correct one :D
> the difference between str and hex is an arcane difference (Ive never used
> hex)
> the difference between functions and procedures is absolutely basic.
They don't giv
On Sunday, January 19, 2014 10:29:58 AM UTC+5:30, Chris Angelico wrote:
> On Sun, Jan 19, 2014 at 3:43 PM, Rustom Mody wrote:
> > Because these two pieces of code
> def foo(x): print x+1
> def bar(x): return x+1
> > look identical (to a beginner at least)
> foo(3)
> > 4
> bar(3)
On Sat, 18 Jan 2014 13:30:20 -0500, Roy Smith wrote:
> Pardon me for being cynical, but in the entire history of the universe,
> has anybody ever used input()/raw_input() for anything other than a
> homework problem?
Yes. They are excellent for interactive command line tools.
-
On Sun, Jan 19, 2014 at 3:43 PM, Rustom Mody wrote:
> Because these two pieces of code
>
def foo(x): print x+1
>
def bar(x): return x+1
>
> look identical (to a beginner at least)
>
foo(3)
> 4
bar(3)
> 4
As do these pieces of code:
>>> def quux(x): return str(x+1)
>>> de
; >> has anybody ever used input()/raw_input() for anything other than a
> >> homework problem?
> > Similar 'cynicism' regarding print would be salutary for producing better
> > programmers
> > [If youve taught programming and had to deal with code str
On Sun, Jan 19, 2014 at 3:15 PM, Rustom Mody wrote:
> On Sunday, January 19, 2014 12:00:20 AM UTC+5:30, Roy Smith wrote:
>> Pardon me for being cynical, but in the entire history of the universe,
>> has anybody ever used input()/raw_input() for anything other than a
>
On Sunday, January 19, 2014 12:00:20 AM UTC+5:30, Roy Smith wrote:
> Pardon me for being cynical, but in the entire history of the universe,
> has anybody ever used input()/raw_input() for anything other than a
> homework problem?
Similar 'cynicism' regarding print wo
On Sun, Jan 19, 2014 at 8:33 AM, Terry Reedy wrote:
> On 1/18/2014 1:30 PM, Roy Smith wrote:
>>
>> Pardon me for being cynical, but in the entire history of the universe,
>> has anybody ever used input()/raw_input() for anything other than a
>> homework problem?
>
&
On 1/18/2014 1:30 PM, Roy Smith wrote:
Pardon me for being cynical, but in the entire history of the universe,
has anybody ever used input()/raw_input() for anything other than a
homework problem?
Homework problems (and 'toy' programs, such as hangman), whether in a
programmin
Roy Smith wrote:
> Pardon me for being cynical, but in the entire history of the universe,
> has anybody ever used input()/raw_input() for anything other than a
> homework problem?
I use it for pointless throwaway tools, sometimes via the cmd module,
sometimes directly.
I like tha
On 01/18/2014 10:30 AM, Roy Smith wrote:
Pardon me for being cynical, but in the entire history of the universe,
has anybody ever used input()/raw_input() for anything other than a
homework problem?
Yes - routinely.
Emile
--
https://mail.python.org/mailman/listinfo/python-list
On 18/01/2014 18:30, Roy Smith wrote:
Pardon me for being cynical, but in the entire history of the universe,
has anybody ever used input()/raw_input() for anything other than a
homework problem?
Not me personally. I guess raw_input must have been used somewhere at
some time for something
Pardon me for being cynical, but in the entire history of the universe,
has anybody ever used input()/raw_input() for anything other than a
homework problem?
--
https://mail.python.org/mailman/listinfo/python-list
search):
> 1. Creates ssh port forward via the subprocess module
> (http://unix.stackexchange.com/questions/4740/screen-remote-login-failure-an
> d-disappearing-text)
> 2. Using the getpass module (raw_input?)
> Calling "$ reset" brings back the disappearing text, so I
e.com/questions/4740/screen-remote-login-failure-an
d-disappearing-text)
2. Using the getpass module (raw_input?)
Calling "$ reset" brings back the disappearing text, so I'm just wondering
if this issue has been addressed and if so, what should I be doing that I'm
not.
Thank you,
On 25 May 2013 19:37, "Chris Angelico" wrote:
> Ah, who am I kidding. Be as rude as you like. I have to work with PHP all
week.
>
> ChrisA
> --
> http://mail.python.org/mailman/listinfo/python-list
I have cried.
--
http://mail.python.org/mailman/listinfo/python-list
On Sun, May 26, 2013 at 4:27 AM, Nobody wrote:
> On Thu, 23 May 2013 17:20:19 +1000, Chris Angelico wrote:
>
>> Aside: Why was PHP's /e regexp option ever implemented?
>
> Because it's a stupid idea, and that's the only requirement for a feature
> to be implemented in PHP.
Hey, don't be rude. I m
On Thu, 23 May 2013 17:20:19 +1000, Chris Angelico wrote:
> Aside: Why was PHP's /e regexp option ever implemented?
Because it's a stupid idea, and that's the only requirement for a feature
to be implemented in PHP.
--
http://mail.python.org/mailman/listinfo/python-list
On Thu, May 23, 2013 at 5:11 PM, Terry Jan Reedy wrote:
> On 5/23/2013 12:47 AM, Steven D'Aprano wrote:
>>
>> On Wed, 22 May 2013 22:31:04 +, Alister wrote:
>>
>>> Please write out 1000 time (without using any form of loop)
>>>
>>> "NEVER use input in python <3.0 it is EVIL"*
>
>
>> But all jo
On 5/23/2013 12:47 AM, Steven D'Aprano wrote:
On Wed, 22 May 2013 22:31:04 +, Alister wrote:
Please write out 1000 time (without using any form of loop)
"NEVER use input in python <3.0 it is EVIL"*
But all joking aside, eval is dangerous, yes, but it is not "evil".
He put that label o
:-)
No need to be irrational about eval(), but I do agree that input()
should never be used. Especially now that Py3 has changed the meaning
of input(), it's potentially very confusing to call the old function;
be explicit and use eval(raw_input()) if you actually want that.
Quite apart fro
On Wed, 22 May 2013 22:31:04 +, Alister wrote:
> Please write out 1000 time (without using any form of loop)
>
> "NEVER use input in python <3.0 it is EVIL"*
>
> as Chris A point out it executes user input an can cause major damage
> (reformatting the hard disk is not impossible!)
Is he all
Oh yes, you guys are right. Thank you very much for warning me that.
On Thursday, May 23, 2013 6:31:04 AM UTC+8, Alister wrote:
>
> as Chris A point out it executes user input an can cause major damage
>
> (reformatting the hard disk is not impossible!)
>
It definitely can cause major damage
ause major damage
> (reformatting the hard disk is not impossible!)
>
Indeed! input is eval(raw_input())! lol
--
http://mail.python.org/mailman/listinfo/python-list
;>
>> Can anyone point me to what I am doing wrong? Many thanks in advance.
>>
>>
>>
>> age=raw_input('Enter your age: ')
>>
>> if age > 18:
>>
>> print ('Wow, %s. You can buy cigarettes.' % age)
>>
>&
On Wed, May 22, 2013 at 4:52 PM, Kevin Xi wrote:
> On Wednesday, May 22, 2013 2:23:15 PM UTC+8, C. N. Desrosiers wrote:
>> age=raw_input('Enter your age: ')
>> if age > 18:
>
> You can either use `raw_input` to read data and convert it to right type, or
> u
quot; -- even if I enter a value below 18.
>
>
>
> Can anyone point me to what I am doing wrong? Many thanks in advance.
>
>
>
> age=raw_input('Enter your age: ')
>
> if age > 18:
>
> print ('Wow, %s. You can buy cigarettes.
http://docs.python.org
>
> When I run the below code, it always ends up printing response to "if age >
> 18:" -- even if I enter a value below 18.
>
>
>
> Can anyone point me to what I am doing wrong? Many thanks in advance.
>
>
>
> age=raw_inpu
> script that can have a simple conversation with the user.
>
> When I run the below code, it always ends up printing response to "if age
> > 18:" -- even if I enter a value below 18.
>
> Can anyone point me to what I am doing wrong? Many thanks in advance.
>
> age=r
to what I am doing wrong? Many thanks in advance.
age=raw_input('Enter your age: ')
if age > 18:
print ('Wow, %s. You can buy cigarettes.' % age)
else:
print ('You are a young grasshopper.')
--
http://mail.python.org/mailman/listinfo/python-list
nd: f
Command: a Michael Palin
Invalid Command: a Michael Palin
Command: a John Cleese, Cheese Shop, 5552233, 5 May
John Cleese is already a friend
Command: a Michael Palin, Cheese Shop, 5552233, 5 May
Command: f Michael Palin
Michael Palin: Cheese Shop, 5552233, 5 May
Command: e
Saving changes...
Now you've saved the data in a different file. How does the next run of
the program find it?
What user? In what environment can a user enter function calls into
your code?
-The user will call the function out from IDLE
Why is the command invalid?
-Because the user need to type out a name
not know how do i
apply it into interact()
my rough idea is :
def interact(*arg):
open('friends.csv', 'rU')
d = load_friends('friends.csv')
print "Friends File: friends.csv"
s = raw_input()
command = s.split(" ", 1)
if &q
t I do not know how do i
apply it into interact()
my rough idea is :
def interact(*arg):
open('friends.csv', 'rU')
d = load_friends('friends.csv')
print "Friends File: friends.csv"
s = raw_input()
command = s.split(" ", 1)
May
Command: e
Saving changes...
Exiting...
my code so far for interact:
#interact function
def interact(*arg):
open('friends.csv', 'rU')
d = load_friends('friends.csv')
print "Friends File: friends.csv"
s = raw_input("Please inpu
...
Exiting...
my code so far for interact:
#interact function
def interact(*arg):
open('friends.csv', 'rU')
d = load_friends('friends.csv')
print "Friends File: friends.csv"
s = raw_input("Please input something: ")
command = s.split(&quo
On May 9, 10:13 pm, ander2_1...@hotmail.com wrote:
> I'm using Console module (doc:http://effbot.org/zone/console-handbook.htm,
> like nCurses) on Windows, but I don't know how to call a keyboard
> input like input() or raw_input().
> What to do?
Maybe read the docs, sp
I'm using Console module (doc: http://effbot.org/zone/console-handbook.htm,
like nCurses) on Windows, but I don't know how to call a keyboard
input like input() or raw_input().
What to do?
--
http://mail.python.org/mailman/listinfo/python-list
Thank You
--
http://mail.python.org/mailman/listinfo/python-list
Abigail wrote:
> Yesterday I downloaded and installed Python 3.1 and working through some
> examples but I have hit a problem
>
>>>> a = raw_input("Enter a number" )
> Traceback (most recent call last):
> File "", line 1, in
> a = raw_inp
On 2/24/2010 12:39 PM, Abigail wrote:
Yesterday I downloaded and installed Python 3.1 and working through some
examples but I have hit a problem
a = raw_input("Enter a number" )
Traceback (most recent call last):
File "", line 1, in
a = raw_input("Enter a
On 2010-02-24 11:39 AM, Abigail wrote:
Yesterday I downloaded and installed Python 3.1 and working through some
examples but I have hit a problem
a = raw_input("Enter a number" )
Traceback (most recent call last):
File "", line 1, in
a = raw_input("Enter a
On Wed, Feb 24, 2010 at 9:39 AM, Abigail wrote:
> Yesterday I downloaded and installed Python 3.1 and working through some
> examples but I have hit a problem
>
>>>> a = raw_input("Enter a number" )
> Traceback (most recent call last):
> File "",
Yesterday I downloaded and installed Python 3.1 and working through some
examples but I have hit a problem
>>> a = raw_input("Enter a number" )
Traceback (most recent call last):
File "", line 1, in
a = raw_input("Enter a number" )
NameErr
Shashwat Anand wrote:
> raw_input uses sys.stderr I guess ?
I had a look at the C code, but it's a bit confusing.
If I'm reading it correctly the prompt is written to the "real" stderr if
and only if sys.stdin and sys.stdout are attached to a terminal.
$ python -c&q
raw_input uses sys.stderr I guess ?
On Mon, Feb 15, 2010 at 5:35 PM, Peter Otten <__pete...@web.de> wrote:
> Joan Miller wrote:
>
> >> > Does `raw_input` uses internally `sys.stdout.write`?
>
> > It was to display the output inside a GUI app. overriding
> >
Joan Miller wrote:
>> > Does `raw_input` uses internally `sys.stdout.write`?
> It was to display the output inside a GUI app. overriding
> `sys.stdout`. And as `print` also uses internally `sys.stdout.write`
> then can be used `print` the shell script and get the output too in
On 15 feb, 10:11, Peter Otten <__pete...@web.de> wrote:
> Joan Miller wrote:
> > Does `raw_input` uses internally `sys.stdout.write`?
>
> You can test this yourself without reading the C source:
>
> Python 2.6.4 (r264:75706, Dec 7 2009, 18:43:55)
> [GCC 4.4.1] on li
Joan Miller wrote:
> Does `raw_input` uses internally `sys.stdout.write`?
You can test this yourself without reading the C source:
Python 2.6.4 (r264:75706, Dec 7 2009, 18:43:55)
[GCC 4.4.1] on linux2
Type "help", "copyright", "credits" or "license
Does `raw_input` uses internally `sys.stdout.write`?
--
http://mail.python.org/mailman/listinfo/python-list
On Dec 5, 3:42 pm, Maxim Khitrov wrote:
> I'm not talking about the Timer, I'm talking about the original
> question. There's nothing (that I know of) you can do with a Timer on
> Windows to interrupt a raw_input call.
That is true. But if the issue here is to prese
Here's what I came up with, though it only asks once question then
quits depending on the answer or lack thereof. And while, yes, you
can't interrupt a raw_input call from a timer, providing for a blank
line (user hitting enter) is a way around it:
import threading import Timer
f
Try using the function timelimited from this recipe
<http://code.activestate.com/recipes/576780/>
An (untested) example with a 60 second timeout would be:
try:
r = timelimited(60, raw_input, 'enter right or wrong: ')
except TimeLimitExpired:
except K
def hello():
> print "hello, world"
>
> t = Timer(30.0, hello)
> t.start() # after 30 seconds, "hello, world" will be printed
I'm not talking about the Timer, I'm talking about the original
question. There's nothing (that I know of) you can do with a
On Dec 5, 3:07 pm, Maxim Khitrov wrote:
>
> Doesn't work on Windows.
>
> - Max
Yes, it does. I've used it a lot, also in Py2Exe apps. Try the
documentation example yourself
def hello():
print "hello, world"
t = Timer(30.0, hello)
t.start() # after 30 seconds, "hello, world" will be printed
On Sat, Dec 5, 2009 at 9:01 AM, Rune Strand wrote:
> The easiest wasy is to use the Timer object in the threading module.
>
>
> from threading import Timer
Doesn't work on Windows.
- Max
--
http://mail.python.org/mailman/listinfo/python-list
The easiest wasy is to use the Timer object in the threading module.
from threading import Timer
--
http://mail.python.org/mailman/listinfo/python-list
1 - 100 of 304 matches
Mail list logo