Re: raw_input and break

2015-11-06 Thread input/ldompeling
Hi, I tried to define SEQUENCE with: The script is working now, exept that I do'nt get a menu in terminal for "s" to stop. - def SEQUENCE(): while notDone: if mindist > us_dist(15): for (dir

Re: raw_input and break

2015-11-05 Thread input/ldompeling
He, Thank you for making some time for it. Is this your code ? I am also using python 3 I got an error with execute the scipt: --- Enter command> Traceback (most recent call last): File "test06.py", line 44, in for (dir, t

Re: raw_input and break

2015-11-05 Thread input/ldompeling
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

Re: raw_input and break

2015-11-05 Thread Peter Otten
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

Re: raw_input and break

2015-11-05 Thread input/ldompeling
>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 realy appreciate it. Can you also tell me wha

Re: raw_input and break

2015-11-05 Thread Peter Otten
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. Now it is waiting for input when its go >> > further with the script. Beca

Re: raw_input and break

2015-11-05 Thread input/ldompeling
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 script. Because I have an while True: so I want that the

Re: raw_input and break

2015-11-05 Thread Peter Otten
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 only when I press a key then it must sto

Re: raw_input and break

2015-11-05 Thread input/ldompeling
In reply to "Peter Otten" who wrote the following: > input/ldompel...@casema.nl wrote: > > > while True: > > enable_servo() > > servo(90) > > mindist = 80 > > choices = input("letter s to stop:") > > if choices == 's': > > print ("stop") > > break > > if mindis

Re: raw_input and break

2015-11-05 Thread Peter Otten
input/ldompel...@casema.nl wrote: > while True: > enable_servo() > servo(90) > mindist = 80 > choices = input("letter s to stop:") > if choices == 's': > print ("stop") > break > if mindist > us_dist(15): > bwd() > print ("backward 1x") > In this script

Re: raw_input and break

2015-11-05 Thread input/ldompeling
In reply to "tian.su.y...@gmail.com" who wrote the following: > =E5=9C=A8 2015=E5=B9=B411=E6=9C=884=E6=97=A5=E6=98=9F=E6=9C=9F=E4=B8=89 UTC= > -6=E4=B8=8B=E5=8D=883:45:09=EF=BC=8Cinput/ld...@casema.nl=E5=86=99=E9=81=93= > =EF=BC=9A > > I have an continues loop with "while True:" > > Now I want to

Re: raw_input and break

2015-11-04 Thread tian . su . yale
在 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: > choices = raw_input > if choises == s: > break > > But even when

Re: raw_input and break

2015-11-04 Thread Steven D'Aprano
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

Re: raw_input and break

2015-11-04 Thread input/ldompeling
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 > > will > > "break" the continues loop. > > > > I tried: > > choices =

Re: raw_input and break

2015-11-04 Thread Joel Goldstick
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 > if choises == s: > break > > But even when I not press "s" it

Re: raw_input and break

2015-11-04 Thread Ian Kelly
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_input This doesn't call raw_input. For that you need to write raw_input

Re: Raw_input with readline in a daemon thread makes terminal text disappear

2013-08-21 Thread random832
On Wed, Aug 21, 2013, at 12:42, David M. Welch wrote: > Hi all, > > This is an old thread, but I'm having the same behavior in my terminal > when > I run some code but kill the process in the terminal (Ctrl-C). The code > has > two prime suspects (from a simple google search): > 1. Creates ssh p

Re: Raw_input with readline in a daemon thread makes terminal text disappear

2013-08-21 Thread David M. Welch
Hi all, This is an old thread, but I'm having the same behavior in my terminal when I run some code but kill the process in the terminal (Ctrl-C). The code has two prime suspects (from a simple google search): 1. Creates ssh port forward via the subprocess module (http://unix.stackexchange.com/q

Re: raw_input that able to do detect multiple input

2013-04-06 Thread Dave Angel
(You forgot to separate the parts of my comments that you were quoting from your responses. Any decent email program will do that for you automatically, inserting "< " in front of each quoted line. Then you just hit enter a couple of times to type the new stuff right after the part you're quo

Re: raw_input that able to do detect multiple input

2013-04-06 Thread Frank
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

Re: raw_input that able to do detect multiple input

2013-04-06 Thread Dave Angel
On 04/06/2013 11:22 PM, Frank wrote: Hi Dave, Sorry for my unclear question. I didn't use the d = load_friends('friends.csv') now because I'm going use it for other function later on, I should have remove it first to avoid confusion. This is the code for load_friends , add_info ,display_frie

Re: raw_input that able to do detect multiple input

2013-04-06 Thread Frank
Hi Dave, Sorry for my unclear question. I didn't use the d = load_friends('friends.csv') now because I'm going use it for other function later on, I should have remove it first to avoid confusion. This is the code for load_friends , add_info ,display_friends, save_friends function: def load_

Re: raw_input that able to do detect multiple input

2013-04-06 Thread Dave Angel
On 04/06/2013 09:03 PM, Frank wrote: Hi all, I would require advise on this question for function call interact: the desire outcome: interact() Friends File: friends.csv Command: f John Cleese John Cleese: Ministry of Silly Walks, 421, 27 October Command: f Michael Palin Unknown friend Micha

Re: Raw_input with readline in a daemon thread makes terminal text disappear

2009-10-22 Thread Aahz
In article , John O'Hagan wrote: >On Mon, 19 Oct 2009, Aahz wrote: >> In article , >> John O'Hagan wrote: >>> >>>I'm getting input for a program while it's running by using raw_input in a >>>loop in separate thread. This works except for the inconvenience of not >>> having a command history or t

Re: Raw_input with readline in a daemon thread makes terminal text disappear

2009-10-20 Thread John O'Hagan
On Mon, 19 Oct 2009, Aahz wrote: > In article , > > John O'Hagan wrote: > >I'm getting input for a program while it's running by using raw_input in a > >loop in separate thread. This works except for the inconvenience of not > > having a command history or the use of backspace etc. > > > >That ca

Re: Raw_input with readline in a daemon thread makes terminal text disappear

2009-10-19 Thread Aahz
In article , John O'Hagan wrote: > >I'm getting input for a program while it's running by using raw_input in a >loop in separate thread. This works except for the inconvenience of not having >a command history or the use of backspace etc. > >That can be solved by loading the readline module; ho

Re: raw_input with a pre-compiled data

2009-06-22 Thread Peter Otten
Luca wrote: > On Sun, Jun 21, 2009 at 12:51 PM, Peter Otten<__pete...@web.de> wrote: >> import readline > Any one knows is this working also on Windows? I've no Win system > right no to test this... I do not have Windows available, either, but you might try http://ipython.scipy.org/moin/PyRea

Re: raw_input with a pre-compiled data

2009-06-22 Thread Chris Rebert
On Mon, Jun 22, 2009 at 1:19 AM, Luca wrote: > On Sun, Jun 21, 2009 at 12:51 PM, Peter Otten<__pete...@web.de> wrote: >> With "traduced" you stumbled upon another false friend ;) >> >> http://it.wikipedia.org/wiki/Falso_amico > > D'oh!!!   x-) > >> import readline >> >> def input_default(prompt, de

Re: raw_input with a pre-compiled data

2009-06-22 Thread Luca
On Sun, Jun 21, 2009 at 12:51 PM, Peter Otten<__pete...@web.de> wrote: > With "traduced" you stumbled upon another false friend ;) > > http://it.wikipedia.org/wiki/Falso_amico D'oh!!! x-) > import readline > > def input_default(prompt, default): >    def startup_hook(): >        readline.insert

Re: raw_input with a pre-compiled data

2009-06-21 Thread Dave Angel
Peter Otten wrote: Luca wrote: On Sat, Jun 20, 2009 at 6:38 PM, Chris Rebert wrote: On Sat, Jun 20, 2009 at 7:17 AM, Luca wrote: Hi all. I need to use a function like the raw_input to read data from user command line, but I really like to pre-compile the choice and I'm not abl

Re: raw_input with a pre-compiled data

2009-06-21 Thread Peter Otten
Luca wrote: > On Sat, Jun 20, 2009 at 6:38 PM, Chris Rebert wrote: >> On Sat, Jun 20, 2009 at 7:17 AM, Luca wrote: >>> Hi all. >>> >>> I need to use a function like the raw_input to read data from user >>> command line, but I really like to pre-compile the choice and I'm not >>> able to do this. T

Re: raw_input with a pre-compiled data

2009-06-21 Thread Luca
On Sat, Jun 20, 2009 at 6:38 PM, Chris Rebert wrote: > On Sat, Jun 20, 2009 at 7:17 AM, Luca wrote: >> Hi all. >> >> I need to use a function like the raw_input to read data from user >> command line, but I really like to pre-compile the choice and I'm not >> able to do this. There is some other fu

Re: raw_input with a pre-compiled data

2009-06-20 Thread Dave Angel
patx wrote: Could you use if elif statements? Don't understand what you mean really? On Sat, Jun 20, 2009 at 3:01 PM, Dave Angel wrote: Luca wrote: Hi all. I need to use a function like the raw_input to read data from user command line, but I really like to pre-compile the choice a

Re: raw_input with a pre-compiled data

2009-06-20 Thread Dave Angel
Luca wrote: Hi all. I need to use a function like the raw_input to read data from user command line, but I really like to pre-compile the choice and I'm not able to do this. There is some other function/module I can use? I wanna to pre-compile the raw_input input line with the current working pa

Re: raw_input with a pre-compiled data

2009-06-20 Thread Gabriel Genellina
En Sat, 20 Jun 2009 11:17:01 -0300, Luca escribió: I need to use a function like the raw_input to read data from user command line, but I really like to pre-compile the choice and I'm not able to do this. There is some other function/module I can use? I wanna to pre-compile the raw_input input

Re: raw_input with a pre-compiled data

2009-06-20 Thread Chris Rebert
On Sat, Jun 20, 2009 at 7:17 AM, Luca wrote: > Hi all. > > I need to use a function like the raw_input to read data from user > command line, but I really like to pre-compile the choice and I'm not > able to do this. There is some other function/module I can use? > I wanna to pre-compile the raw_in

Re: raw_input can't handle pound sign?

2008-12-26 Thread Jugdish
Ahh ok, tried out your example and it works just fine. Turns out the actual problem is what I was doing with the input. Elsewhere, I call urlparse.urlparse() on the filename past in, which splits up the filename where the # sign is, so that's why it looked to me like the characters after the # were

Re: raw_input can't handle pound sign?

2008-12-26 Thread Steven D'Aprano
On Fri, 26 Dec 2008 20:20:16 -0800, Jugdish wrote: > Hi, I'm having problems getting a pound sign to go through as input sent > to the raw_input() command. I'm running Python 2.5.1 on Windows XP. > Here's my simple little script: > > while True: > response = raw_input("Please enter a file nam

Re: raw_input on several lines

2008-08-02 Thread Raja Baz
On Sat, 02 Aug 2008 21:58:09 +0200, TP wrote: > Hi everybody, > > When using raw_input(), the input of the user ends when he types Return > on his keyboard. > How can I change this behavior, so that another action is needed to stop > the input? For example, CTRL-G. It would allow the user to inpu

Re: raw_input on several lines

2008-08-02 Thread David
TP wrote: Hi everybody, When using raw_input(), the input of the user ends when he types Return on his keyboard. How can I change this behavior, so that another action is needed to stop the input? For example, CTRL-G. It would allow the user to input several lines. Thanks Julien How abou

Re: raw_input on several lines

2008-08-02 Thread Stefaan Himpe
How can I change this behavior, so that another action is needed to stop the input? For example, CTRL-G. It would allow the user to input several lines. I don't think you can change raw_input's behaviour in this respect, but you could build something yourself that's based on interpretation o

Re: raw_input on several lines

2008-08-02 Thread Larry Bates
TP wrote: Hi everybody, When using raw_input(), the input of the user ends when he types Return on his keyboard. How can I change this behavior, so that another action is needed to stop the input? For example, CTRL-G. It would allow the user to input several lines. Thanks Julien Just put raw

Re: raw_input into Tkinter ?

2008-07-01 Thread s0suk3
On Jun 30, 11:55 am, [EMAIL PROTECTED] wrote: > Is there any way to type into a Tkinter frame window? > I want to use raw_input() within a Tkinter frame. import sys import Tkinter import cStringIO class GUIInputMgr(Tkinter.Entry): def __init__(self, parent): Tkinter.Entry.__init__(se

Re: raw_input into Tkinter ?

2008-07-01 Thread Sebastian "lunar" Wiesner
Matimus <[EMAIL PROTECTED]>: > On Jun 30, 9:55 am, [EMAIL PROTECTED] wrote: >> Is there any way to type into a Tkinter frame window? >> I want to use raw_input() within a Tkinter frame. > > `raw_input(prompt)` just calls `sys.stdout.write(prompt)` and returns > `sys.stdin.readline()`. It does mor

Re: raw_input into Tkinter ?

2008-07-01 Thread Python.Arno
On 30 jun 2008, at 18:55, [EMAIL PROTECTED] wrote: Is there any way to type into a Tkinter frame window? I want to use raw_input() within a Tkinter frame. -- http://mail.python.org/mailman/listinfo/python-list You could use the Tkinter.Entry option from dialog windows... http://www.pythonwa

Re: raw_input into Tkinter ?

2008-06-30 Thread Matimus
On Jun 30, 9:55 am, [EMAIL PROTECTED] wrote: > Is there any way to type into a Tkinter frame window? > I want to use raw_input() within a Tkinter frame. `raw_input(prompt)` just calls `sys.stdout.write(prompt)` and returns `sys.stdin.readline()`. So, you can just create file-like objects to replac

Re: raw_input into Tkinter ?

2008-06-30 Thread Sebastian "lunar" Wiesner
[EMAIL PROTECTED] <[EMAIL PROTECTED]>: > Is there any way to type into a Tkinter frame window? Maybe using a proper text/line edit widget? > I want to use raw_input() within a Tkinter frame. The builtin raw_input is for console input only. Of course, one could implement a raw_input using a Tki

Re: raw_input(), STRANGE behaviour

2008-01-28 Thread Dox33
YES! This is what I was looking for. Great! All works fine now. Thank you very much Gabriel. Gabriel Genellina schreef: > Add this on your sitecustomize.py module (or create one) > > import sys > def raw_input(prompt=None): >if prompt: sys.stdout.write(prompt) >return original_raw_input()

Re: raw_input(), STRANGE behaviour

2008-01-27 Thread sevenbark
On Sat, 26 Jan 2008 04:23:36 -0800 (PST), Dox33 <[EMAIL PROTECTED]> wrote: >WHERE IS THE SECOND LINE? >It is in the file stderr_catch.txt!!! > > See the problem? >Please Tell me? Why is the prompt produced by raw_input() printed to >the error channel? It should be stdout, just as the print s

Re: raw_input(), STRANGE behaviour

2008-01-27 Thread Gabriel Genellina
En Sun, 27 Jan 2008 12:51:51 -0200, Dox33 <[EMAIL PROTECTED]> escribi�: > Yes, I know. > There are several ways to work around the problem. > (Look at the innitial code I provided in this discussion start) > Fact is, every time I'm getting a script from somewhere or someone, I > have to search a

Re: raw_input(), STRANGE behaviour

2008-01-27 Thread Dox33
Yes, I know. There are several ways to work around the problem. (Look at the innitial code I provided in this discussion start) Fact is, every time I'm getting a script from somewhere or someone, I have to search and replace all the affected code. Not very conveniant. That's why I rather would have

Re: raw_input(), STRANGE behaviour

2008-01-26 Thread Hrvoje Niksic
Dox33 <[EMAIL PROTECTED]> writes: > Thanks for your reply. Since I momentarily do not have the ability > to build a new python executable, I would like to ask for your help > in this case. Are you able to supply me with a corrected version? You can simply choose not to use raw_input, and use sy

Re: raw_input(), STRANGE behaviour

2008-01-26 Thread Terry Reedy
I believe a workaround to the bug of raw_input sending the prompt to stderr is print 'prompt:', a = raw_input() Not nice, but possibly better that waiting for a corrected binary. -- http://mail.python.org/mailman/listinfo/python-list

Re: raw_input(), STRANGE behaviour

2008-01-26 Thread Dox33
Hello Mike, Thanks for your reply. Since I momentarily do not have the ability to build a new python executable, I would like to ask for your help in this case. Are you able to supply me with a corrected version? Friendly greetings Rens Duijsens On 26 jan, 16:50, Mike Kent <[EMAIL PROTECTED]> w

Re: raw_input(), STRANGE behaviour

2008-01-26 Thread Mike Kent
On Jan 26, 7:23 am, Dox33 <[EMAIL PROTECTED]> wrote: > I ran into a very strange behaviour of raw_input(). > I hope somebody can tell me how to fix this. ===CUT=== > *** Thirst, redirect stderr to file, STRANGE behaviour.. > From the command prompt I run: > python script.py 2> stderr_catch.txt

Re: raw_input() and utf-8 formatted chars

2007-11-02 Thread Marc 'BlackJack' Rintsch
On Thu, 01 Nov 2007 19:21:03 -0700, 7stud wrote: > BeautifulSoup can convert an html entity representing an 'A' with > umlaut, e.g.: > > Ä > > into an without every touching my keyboard. How does BeautifulSoup > do it? It maps the HTML entity names to unicode characters. Take a look at the

Re: raw_input() and utf-8 formatted chars

2007-11-01 Thread 7stud
On Oct 13, 12:42 pm, MRAB <[EMAIL PROTECTED]> wrote: > You can > decode that into the actual UTF-8 string with decode("string_escape"): > > s = raw_input('Enter: ') #A\xcc\x88 > s = s.decode("string_escape") > Ahh. Thanks for that. >On Oct 12, 2:43 pm, Marc 'BlackJack' Rintsch <[EMAIL PROTECT

Re: raw_input() and utf-8 formatted chars

2007-10-13 Thread MRAB
On Oct 13, 3:09 am, 7stud <[EMAIL PROTECTED]> wrote: > On Oct 12, 2:43 pm, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > > > You mean literally!? Then of course I get A\xcc\x88 because that's what I > > entered. In string literals in source code the backslash has a special > > meaning but

Re: raw_input() and utf-8 formatted chars

2007-10-13 Thread Marc 'BlackJack' Rintsch
On Fri, 12 Oct 2007 19:09:46 -0700, 7stud wrote: > On Oct 12, 2:43 pm, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: >> You mean literally!? Then of course I get A\xcc\x88 because that's what I >> entered. In string literals in source code the backslash has a special >> meaning but `raw_in

Re: raw_input() and utf-8 formatted chars

2007-10-12 Thread 7stud
On Oct 12, 2:43 pm, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > You mean literally!? Then of course I get A\xcc\x88 because that's what I > entered. In string literals in source code the backslash has a special > meaning but `raw_input()` does not "interpret" the input in any way. > Th

Re: raw_input() and utf-8 formatted chars

2007-10-12 Thread Marc 'BlackJack' Rintsch
On Fri, 12 Oct 2007 13:18:35 -0700, 7stud wrote: > On Oct 12, 1:18 pm, [EMAIL PROTECTED] wrote: >> On Oct 12, 1:53 pm, 7stud <[EMAIL PROTECTED]> wrote: >> >> > s = 'A\xcc\x88' #capital A with umlaut >> > print s #displays capital A with umlaut >> >> > s = raw_input('Enter: ') #A\xcc\

Re: raw_input() and utf-8 formatted chars

2007-10-12 Thread 7stud
On Oct 12, 1:18 pm, [EMAIL PROTECTED] wrote: > On Oct 12, 1:53 pm, 7stud <[EMAIL PROTECTED]> wrote: > > > s = 'A\xcc\x88' #capital A with umlaut > > print s #displays capital A with umlaut > > > s = raw_input('Enter: ') #A\xcc\x88 > > print s#displays A\xcc\x88 > >

Re: raw_input() and utf-8 formatted chars

2007-10-12 Thread kyosohma
On Oct 12, 1:53 pm, 7stud <[EMAIL PROTECTED]> wrote: > s = 'A\xcc\x88' #capital A with umlaut > print s #displays capital A with umlaut > > s = raw_input('Enter: ') #A\xcc\x88 > print s#displays A\xcc\x88 > > print len(input) #9 > > It looks like every ch

Re: raw_input just continues anyway?

2007-04-03 Thread Steve Holden
[EMAIL PROTECTED] wrote: > How could I resolve this? > Try to keep each answer so it makes sense on its own, please. I presume you are responding to this: > In <[EMAIL PROTECTED]>, > [EMAIL PROTECTED] wrote: > >> > if __name__ == "__main__": >> >bucket_name = raw_input('Name of the bucket y

Re: raw_input just continues anyway?

2007-04-03 Thread [EMAIL PROTECTED]
How could I resolve this? Many thanks, O -- http://mail.python.org/mailman/listinfo/python-list

Re: raw_input just continues anyway?

2007-04-03 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, [EMAIL PROTECTED] wrote: > if __name__ == "__main__": > bucket_name = raw_input('Name of the bucket you wish the files to be > placed into? ') > update_s3() > > > Basically I pipe some files into the script - so would this cause a > linebreak? Yes of course.

Re: raw_input just continues anyway?

2007-04-03 Thread [EMAIL PROTECTED]
Hi There, Here's the full code, if it helps: """ Takes a list of filenames via standard input and uploads them to Amazon S3. Requires S3.py: http://developer.amazonwebservices.com/connect/entry.jspa?externalID=134&categoryID=47 Usage: cd /directory/with/media/files/ fin

Re: raw_input just continues anyway?

2007-04-03 Thread Bjoern Schliessmann
[EMAIL PROTECTED] wrote: > if __name__ == "__main__": > bucket_name = raw_input('Name of the bucket you wish the files to be > placed into? ') > update_s3() > > Basically, it just asks the question and continues anyway? It reads stdin until a line break. Then it continues. Exactly what

Re: raw_input just continues anyway?

2007-04-03 Thread kyosohma
On Apr 3, 8:27 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Hey Everyone, > > This is probably going to sound like a bit of a stupid question - but > why does (in the following code) the script just continue to run past > the raw_input, when the user hasn't entered anything? > > if __name__

Re: raw_input passing to fun

2006-04-27 Thread Gary Wessle
John Machin <[EMAIL PROTECTED]> writes: > On 28/04/2006 2:04 PM, Gary Wessle wrote: > > the output of this code below is not what one would expect, it > > outputs > > all kind of numbers and it never stops, I want to ask the user for a > > number and then print out the multiplication table up to t

Re: raw_input passing to fun

2006-04-27 Thread John Machin
On 28/04/2006 2:04 PM, Gary Wessle wrote: > > the output of this code below is not what one would expect, it outputs > all kind of numbers and it never stops, I want to ask the user for a > number and then print out the multiplication table up to that number. That's what you want, but not what yo

Re: raw_input

2006-03-24 Thread Peter Hansen
Tim Williams (gmail) wrote: > The following will accept any subset of "carmel" in upper, lower or > mixed case > > EG Carmel, carmel, Carm, mel etc > > >>> if raw_input ("hello what's your name? ").lower() in 'carmel': > print "Ahh the boss's wife" It's so powerful, it accepts ev

Re: raw_input

2006-03-23 Thread Tim Williams (gmail)
On 23/03/06, cm012b5105 <[EMAIL PROTECTED]> wrote:     if s = raw_input ("hello what's your name? ") if s=='carmel ': print "Ahh the boss's wife"  What i would like to know is what if she doesn't write carmel she rights say carm short of me writing if s=='carm': on a ne

Re: raw_input (was "no subject")

2006-03-23 Thread Tim Williams (gmail)
On 23/03/06, cm012b5105 <[EMAIL PROTECTED]> wrote: Hi there i am hoping some one could help me out with a small problem i am in the process of learning python. I am trying to write an interactive programme, This is a short example. if s = raw_input ("hello what's your name? ") if

Re: RAW_INPUT

2005-11-07 Thread Fredrik Lundh
"john boy" <[EMAIL PROTECTED]> : >I am having trouble with the following example used in a tutorial: > > print "Halt !" > s = raw_input ("Who Goes there? ") > print "You may pass,", s > > I run this and get the following: > Halt! > Who Goes there? > > --thats itif I hit enter again "You may pa

Re: RAW_INPUT

2005-11-07 Thread Fredrik Lundh
"A D" <[EMAIL PROTECTED]> wrote: >> print "You may pass,", s > > at this print line you need to do > print "you may pass, %s" % s > > this will allow you to enter the string s into the output sentence where did you buy your python license ? >>> s = "josh" >>> print "hello,", s hello,

Re: RAW_INPUT

2005-11-07 Thread jmdeschamps
The raw_input('Who Goes there?') function writes out the arg and then waits for *user input* , and that is considered terminated when you hit return. Since you only hit return without typing 'Josh' first you get an empty string "" which is then printed to screen... ('You may pass,'+"") Type somet

Re: RAW_INPUT

2005-11-07 Thread dataw0lf
john boy wrote: > > > --thats itif I hit enter again "You may pass," > appears... > ... > What am I doing wrong? raw_input accepts, that's right, input. So, when you get the line "Who goes there?" You don't hit enter; you type whatever you want to be printed with "You may pass,". Then y

Re: RAW_INPUT

2005-11-07 Thread Jean-Paul Calderone
On Mon, 07 Nov 2005 12:14:15 -0600, A D <[EMAIL PROTECTED]> wrote: >On Mon, 2005-11-07 at 07:57 -0800, john boy wrote: >> I am having trouble with the following example used in a tutorial: >> >> print "Halt !" >> s = raw_input ("Who Goes there? ") >> print "You may pass,", s > >at this print line y

Re: RAW_INPUT

2005-11-07 Thread A D
On Mon, 2005-11-07 at 07:57 -0800, john boy wrote: > I am having trouble with the following example used in a tutorial: > > print "Halt !" > s = raw_input ("Who Goes there? ") > print "You may pass,", s at this print line you need to do print "you may pass, %s" % s this will allow you to enter