Re: Sanitise user input for a script

2024-08-30 Thread Simon Connah via Python-list
On Friday, 30 August 2024 at 21:23, Peter J. Holzer via Python-list wrote: > > > On 2024-08-30 19:18:29 +, Simon Connah via Python-list wrote: > > > I need to write a script that will take some user input (supplied on a > > website) and then execute a Python

Re: Sanitise user input for a script

2024-08-30 Thread Simon Connah via Python-list
On Friday, 30 August 2024 at 23:35, Thomas Passin via Python-list wrote: > > > On 8/30/2024 3:18 PM, Simon Connah via Python-list wrote: > > > I need to write a script that will take some user input (supplied on a > > website) and then execute a Python scrip

Re: Sanitise user input for a script

2024-08-30 Thread Thomas Passin via Python-list
On 8/30/2024 3:18 PM, Simon Connah via Python-list wrote: I need to write a script that will take some user input (supplied on a website) and then execute a Python script on a host via SSH. I'm curious what the best options are for protecting against malicious input in much the smae way a

Re: Sanitise user input for a script

2024-08-30 Thread Peter J. Holzer via Python-list
On 2024-08-30 19:18:29 +, Simon Connah via Python-list wrote: > I need to write a script that will take some user input (supplied on a > website) and then execute a Python script on a host via SSH. I'm > curious what the best options are for protecting against malicious >

Sanitise user input for a script

2024-08-30 Thread Simon Connah via Python-list
I need to write a script that will take some user input (supplied on a website) and then execute a Python script on a host via SSH. I'm curious what the best options are for protecting against malicious input in much the smae way as you sanitise SQL to protect against SQL injections. I

Re: setting user input equal to target language in Google Translator

2021-04-16 Thread Peter Otten
On 16/04/2021 19:11, Quentin Bock wrote: is it possible to set the target language of a translation to be the input from a user? I have tried inputting specific abbreviations that would normally be accepted as the target language but it remains in Icelandic and I would like to change the target l

setting user input equal to target language in Google Translator

2021-04-16 Thread Quentin Bock
is it possible to set the target language of a translation to be the input from a user? I have tried inputting specific abbreviations that would normally be accepted as the target language but it remains in Icelandic and I would like to change the target language based on the user's input without c

Re: GUI user input to function

2017-12-29 Thread Nico Vogeli
nput('function 2 ')) > >> > > >> > >> What are you typing as input? It's hard to grok your code without knowing > >> that. > >> > >> ChrisA > > > > I'm sorry! User input would look like this for example: x**2 + 3*x or x**

Re: GUI user input to function

2017-12-28 Thread Chris Angelico
;> > from sympy import symbols >> > >> > x = symbols('x') >> > f1 = eval(input('function 1 ')) >> > f2 = eval(input('function 2 ')) >> > >> >> What are you typing as input? It's hard to grok your code without

Re: GUI user input to function

2017-12-28 Thread Nico Vogeli
> > f1 = eval(input('function 1 ')) > > f2 = eval(input('function 2 ')) > > > > What are you typing as input? It's hard to grok your code without knowing > that. > > ChrisA I'm sorry! User input would look like this for example: x**2 + 3*x or x**3 Regards Nicco -- https://mail.python.org/mailman/listinfo/python-list

Re: GUI user input to function

2017-12-28 Thread Chris Angelico
On Thu, Dec 28, 2017 at 8:38 PM, Nico Vogeli wrote: > Withs test, this return a correct value for the two x functions: > > from sympy import symbols > > x = symbols('x') > f1 = eval(input('function 1 ')) > f2 = eval(input('function 2 ')) > What are you typing as input? It's hard to grok your code

GUI user input to function

2017-12-28 Thread Nico Vogeli
Hello again I think my question got lost in all the others raised, so here I am again :P So, I tried my best, was looking into the eval and exec function, but still no succsess.. Maybe it helps when I provide the code I want to implement: def newton_verfahren(self): if self.cB_1.

Re: user input string to function

2017-12-25 Thread Nico Vogeli
t, I think that's how you're doing things. Inside the nested > >> >> functions, you use 'a', but outside, you use 'x'. Are those > >> >> representing the same concept? If so, the lambda functions given here > >> >> will have

Re: user input string to function

2017-12-25 Thread Chris Angelico
at's how you're doing things. Inside the nested >> >> functions, you use 'a', but outside, you use 'x'. Are those >> >> representing the same concept? If so, the lambda functions given here >> >> will have the same effect. >>

Re: user input string to function

2017-12-25 Thread Nico Vogeli
>> will have the same effect. > >> > >> Hope that helps! > >> > >> ChrisA > > > > Hi Chris > > > > Thanks very much for your quick response! > > I was in a bit of a rush, so I confused the variables (don't worry, I just &g

Re: user input string to function

2017-12-25 Thread Chris Angelico
tions given here >> will have the same effect. >> >> Hope that helps! >> >> ChrisA > > Hi Chris > > Thanks very much for your quick response! > I was in a bit of a rush, so I confused the variables (don't worry, I just > messed arround to try differe

Re: user input string to function

2017-12-25 Thread Nico Vogeli
, I just messed arround to try different things, the original code was al tidy with the variable). I tried your input, but now I get another error: File "C:/Users/Nicco ZHAW/Desktop/Test GUI/Test Projekt.py", line 42, in newton b = x - f(x)/fx(x) TypeError: unsupported operand type(s) for /: 'function' and 'function' This did not occure befor I tried to implement the user input.. Thank you very much! Nicco -- https://mail.python.org/mailman/listinfo/python-list

Re: user input string to function

2017-12-25 Thread Chris Angelico
On Tue, Dec 26, 2017 at 12:36 AM, Nico Vogeli wrote: > Hi everybody. First ad foremost, happy Christmas! Same to you! > I want to let the use input a function (like x**2) and parse it after that > through code (for my numeric class) > > def newton(x0, s, s2, tol, n = 2): > ''' > Näh

user input string to function

2017-12-25 Thread Nico Vogeli
Hi everybody. First ad foremost, happy Christmas! I want to let the use input a function (like x**2) and parse it after that through code (for my numeric class) import numpy as np import matplotlib.pyplot as plt import scipy.linalg from sympy.abc import o, h import sympy from sympy import symbol

Unusual reactions (Was: .Re: Using Loops to track user input)

2017-04-20 Thread Jan van den Broek
On 2017-04-20, Robert L. wrote: Two things: - There's a '.' in front of "Re". - There's no "References"-header in your messages, this may confuse some newsreaders. -- Jan v/d Broek balgl...@dds.nl -- https://mail.python.org/mailman/listinfo/python-list

Re: Program prints questions for user input, but won't show the answer output

2016-05-18 Thread Larry Hudson via Python-list
On 05/18/2016 06:50 PM, Jake Kobs wrote: MRAB, I am not quite sure how to return the print statements so I thought that returning the displayInfo def would help.. Im so lost. Why do you think you want to _return_ a print statement? The print statement _DOES_ the printing, there is nothing th

Re: Program prints questions for user input, but won't show the answer output

2016-05-18 Thread MRAB
On 2016-05-19 02:50, Jake Kobs wrote: MRAB, I am not quite sure how to return the print statements so I thought that returning the displayInfo def would help.. Im so lost. "return the print statements"? The print statements ... print! Have a search for Python tutorials online and pick one t

Re: Program prints questions for user input, but won't show the answer output

2016-05-18 Thread Steven D'Aprano
On Thu, 19 May 2016 11:50 am, Jake Kobs wrote: > MRAB, > > I am not quite sure how to return the print statements so I thought that > returning the displayInfo def would help.. Im so lost. There's no need to return the text that you printed. You printed it, the job is done. Here is some genera

Re: Program prints questions for user input, but won't show the answer output

2016-05-18 Thread Jake Kobs
MRAB, I am not quite sure how to return the print statements so I thought that returning the displayInfo def would help.. Im so lost. -- https://mail.python.org/mailman/listinfo/python-list

Re: Program prints questions for user input, but won't show the answer output

2016-05-18 Thread MRAB
On 2016-05-19 02:04, Jake Kobs wrote: Here is the code: #Lab 9-4 Blood Drive #the main function def main(): endProgram = 'no' while endProgram == 'no': print # declare variables pints = [0] * 7 totalPints = 0 averagePints = 0 highPints = 0 lowPints = 0

Re: Program prints questions for user input, but won't show the answer output

2016-05-18 Thread John Gordon
In <1cc14787-7061-45c9-a70e-1b16e3f5e...@googlegroups.com> Jake Kobs writes: > Here is the code: > def getHigh(pints, highPints): > highPints = pints[0] > counter = 1 > while counter < 7: > if (pints[counter] > highPints): > highPints = pints[counter] >

Program prints questions for user input, but won't show the answer output

2016-05-18 Thread Jake Kobs
Here is the code: #Lab 9-4 Blood Drive #the main function def main(): endProgram = 'no' while endProgram == 'no': print # declare variables pints = [0] * 7 totalPints = 0 averagePints = 0 highPints = 0 lowPints = 0

Re: User Input

2013-06-12 Thread Dave Angel
On 05/30/2013 10:03 AM, Eternaltheft wrote: do you think ti would be better if i call drawBoard? Better is meaningless without context. Are you being charged per keystroke? -- DaveA -- http://mail.python.org/mailman/listinfo/python-list

Re: User Input

2013-05-30 Thread Joshua Landau
On 30 May 2013 15:47, Eternaltheft wrote: >> And perhaps you meant for your function to CALL drawBoard(), rather than >> returning the function object drawBoard. >> >> DaveA > > do you think it would be better if i call drawBoard? Please read http://www.catb.org/esr/faqs/smart-questions.html, or

Re: User Input

2013-05-30 Thread Eternaltheft
> And perhaps you meant for your function to CALL drawBoard(), rather than > returning the function object drawBoard. > DaveA do you think it would be better if i call drawBoard? -- http://mail.python.org/mailman/listinfo/python-list

Re: User Input

2013-05-30 Thread Eternaltheft
> And perhaps you meant for your function to CALL drawBoard(), rather than > > returning the function object drawBoard. > > DaveA do you think it would be better if i call drawBoard? -- http://mail.python.org/mailman/listinfo/python-list

Re: User Input

2013-05-30 Thread Mark Lawrence
On 30/05/2013 15:03, Eternaltheft wrote: do you think ti would be better if i call drawBoard? How would I know if you don't quote any context? -- If you're using GoogleCrap™ please read this http://wiki.python.org/moin/GoogleGroupsPython. Mark Lawrence -- http://mail.python.org/mailman/li

Re: User Input

2013-05-30 Thread Eternaltheft
do you think ti would be better if i call drawBoard? -- http://mail.python.org/mailman/listinfo/python-list

Re: User Input

2013-05-30 Thread Dave Angel
On 05/30/2013 09:10 AM, Eternaltheft wrote: yeah i found out why it wasn't defined before because i tried to put it into a function. That's not a sentence, and it doesn't make sense in any permutation I can do on it. this is my drawBoard function: import turtle as Turtle Turtle.title("Ch

Re: User Input

2013-05-30 Thread Chris Angelico
On Thu, May 30, 2013 at 10:37 PM, Eternaltheft wrote: > sorry about that, i got confused xD. yeah it works good now. > what i meant to say was can i return a function that i made, if the user > inputs nothing? Sure! Anything you want to do, you can do :) ChrisA -- http://mail.python.org/mailma

Re: User Input

2013-05-30 Thread Eternaltheft
yeah i found out why it wasn't defined before because i tried to put it into a function. this is my drawBoard function: import turtle as Turtle Turtle.title("Checkers") b = 75 def drawBoard(b): Turtle.speed(0) Turtle.up() Turtle.goto(-4 * b, 4 * b) Turtle.down() for i

Re: User Input

2013-05-30 Thread Dave Angel
On 05/30/2013 08:37 AM, Eternaltheft wrote: sorry about that, i got confused xD. yeah it works good now. what i meant to say was can i return a function that i made, if the user inputs nothing? There wouldn't be anything to stop you. However, if you have multiple returns from the same funct

Re: User Input

2013-05-30 Thread Eternaltheft
sorry about that, i got confused xD. yeah it works good now. what i meant to say was can i return a function that i made, if the user inputs nothing? -- http://mail.python.org/mailman/listinfo/python-list

Re: User Input

2013-05-30 Thread Chris Angelico
On Thu, May 30, 2013 at 10:19 PM, Eternaltheft wrote: > Ok thanks guys. but when i use > > filename = input('file name: ') > if not filename: #i get filename is not defined > return(drawBoard) #possible to return function when no file input from > user? Do you really want to return ther

Re: User Input

2013-05-30 Thread Fábio Santos
On 30 May 2013 13:24, "Eternaltheft" wrote: > > Ok thanks guys. but when i use > > filename = input('file name: ') > if not filename: #i get filename is not defined > return(drawBoard) #possible to return function when no file input from user? I don't really understand what you mean. Do

Re: User Input

2013-05-30 Thread Eternaltheft
Ok thanks guys. but when i use filename = input('file name: ') if not filename: #i get filename is not defined return(drawBoard) #possible to return function when no file input from user? -- http://mail.python.org/mailman/listinfo/python-list

Re: User Input

2013-05-30 Thread Fábio Santos
On 30 May 2013 12:58, "Eternaltheft" wrote: > > On Thursday, May 30, 2013 7:33:41 PM UTC+8, Eternaltheft wrote: > > Hi, I'm having trouble oh how prompt the user to enter a file name and how to set up conditions. For example, if there's no file name input by the user, a default is returned > > Tha

Re: User Input

2013-05-30 Thread MRAB
On 30/05/2013 12:48, Eternaltheft wrote: On Thursday, May 30, 2013 7:33:41 PM UTC+8, Eternaltheft wrote: Hi, I'm having trouble oh how prompt the user to enter a file name and how to set up conditions. For example, if there's no file name input by the user, a default is returned Thanks for suc

Re: User Input

2013-05-30 Thread Chris Angelico
On Thu, May 30, 2013 at 9:48 PM, Eternaltheft wrote: > On Thursday, May 30, 2013 7:33:41 PM UTC+8, Eternaltheft wrote: >> Hi, I'm having trouble oh how prompt the user to enter a file name and how >> to set up conditions. For example, if there's no file name input by the >> user, a default is re

Re: User Input

2013-05-30 Thread Eternaltheft
On Thursday, May 30, 2013 7:33:41 PM UTC+8, Eternaltheft wrote: > Hi, I'm having trouble oh how prompt the user to enter a file name and how to > set up conditions. For example, if there's no file name input by the user, a > default is returned Thanks for such a fast reply! and no im not using r

Re: User Input

2013-05-30 Thread Fábio Santos
On 30 May 2013 12:42, "Eternaltheft" wrote: > > Hi, I'm having trouble oh how prompt the user to enter a file name and how to set up conditions. For example, if there's no file name input by the user, a default is returned Are you using raw_input? It returns an empty string if the user enters not

User Input

2013-05-30 Thread Eternaltheft
Hi, I'm having trouble oh how prompt the user to enter a file name and how to set up conditions. For example, if there's no file name input by the user, a default is returned -- http://mail.python.org/mailman/listinfo/python-list

Re: Processing user input as it's entered

2013-03-26 Thread Sven
On 26 March 2013 14:41, Arnaud Delobelle wrote: > On 26 March 2013 10:07, Sven wrote: > > Hello, > > > > Is there a way (ideally cross platform but a *nix OS solution would be > > great) to process user input as they type? > > What I aim to achieve is to coun

Re: Processing user input as it's entered

2013-03-26 Thread Arnaud Delobelle
On 26 March 2013 10:07, Sven wrote: > Hello, > > Is there a way (ideally cross platform but a *nix OS solution would be > great) to process user input as they type? > What I aim to achieve is to count the number of characters a user has > entered and display it while they are t

Processing user input as it's entered

2013-03-26 Thread Sven
Hello, Is there a way (ideally cross platform but a *nix OS solution would be great) to process user input as they type? What I aim to achieve is to count the number of characters a user has entered and display it while they are typing. The entered text will also need to be captured once the user

Re: NEED HELP- read file contents, while loop to accept user input, and enter to exit

2011-05-24 Thread Jean-Michel Pichavant
Cathy James wrote: f = open ('c:/testing.txt'', 'r') replace the double quote by a single quote. JM -- http://mail.python.org/mailman/listinfo/python-list

Re: NEED HELP- read file contents, while loop to accept user input, and enter to exit

2011-05-24 Thread Chris Rebert
27;', 'r') > f.readlines() > #2)  and 3) use while loop  to write user input to file, save to file, close > when press enter: > while True: >     s = input ('enter name: ').strip() >     f = open ('c:/testing.txt', 'a') >     if f.w

Re: NEED HELP- read file contents, while loop to accept user input, and enter to exit

2011-05-24 Thread Chris Angelico
On Tue, May 24, 2011 at 6:31 PM, Cathy James wrote: >     s = input ('enter name: ').strip() Are you using Python 2 or Python 3? If it's Python 2, this should be raw_input(). >     f = open ('c:/testing.txt', 'a') > ... >     f = open ('c:/testing.txt', 'r') You may be having trouble here a

Re: NEED HELP- read file contents, while loop to accept user input, and enter to exit

2011-05-24 Thread Tim Golden
On 24/05/2011 09:31, Cathy James wrote: dear mentor, I need help with my code: 1) my program won't display file contents upon opening #1) open file and display current file contents: f = open ('c:/testing.txt'', 'r') f.readlines() If you're running this in an interactive interpreter, I would

NEED HELP- read file contents, while loop to accept user input, and enter to exit

2011-05-24 Thread Cathy James
rrent file contents: f = open ('c:/testing.txt'', 'r') f.readlines() #2) and 3) use while loop to write user input to file, save to file, close when press enter: while True: s = input ('enter name: ').strip() f = open ('c:/testing.txt', 'a&

Re: python 3 - instantiating class from user input

2011-04-07 Thread Steven D'Aprano
On Wed, 06 Apr 2011 21:04:44 -0700, Brad Bailey wrote: > I dont understand why this is such a big deal. Nor do i understand why > google can't find a reasonable answer. If one can't figure out from the > title what I'm trying to do, then a look at code should firmly plant the > intent. The general

Re: python 3 - instantiating class from user input

2011-04-06 Thread Chris Rebert
On Wed, Apr 6, 2011 at 9:41 PM, Chris Rebert wrote: > On Wed, Apr 6, 2011 at 9:04 PM, Brad Bailey wrote: >> I dont understand why this is such a big deal. Nor do i understand why >> google can't find a reasonable answer. If one can't figure out from the >> title what I'm trying to do, then a lo

Re: python 3 - instantiating class from user input

2011-04-06 Thread Chris Rebert
InventoryItem = namedtuple('InventoryItem', "description vendor cost markup quantity".split()) # See http://docs.python.org/library/collections.html#collections.namedtuple You would make a new instance of InventoryItem based on console user input like so (ignoring input validation / error c

python 3 - instantiating class from user input

2011-04-06 Thread Brad Bailey
I dont understand why this is such a big deal. Nor do i understand why google can't find a reasonable answer. If one can't figure out from the title what I'm trying to do, then a look at code should firmly plant the intent. The general idea of the code is, in my opinion, very basic. I notice,

Re: User input masks - Access Style

2011-01-01 Thread flebber
On Jan 1, 11:13 am, Tim Harig wrote: > On 2010-12-31, flebber wrote: > > > On Dec 28 2010, 12:21 am, Adam Tauno Williams > > wrote: > >> On Sun, 2010-12-26 at 20:37 -0800, flebber wrote: > >> > Is there anyay to use input masks in python? Similar to the function > >> > found in access where a us

Re: User input masks - Access Style

2010-12-31 Thread Tim Harig
On 2010-12-31, flebber wrote: > On Dec 28 2010, 12:21 am, Adam Tauno Williams > wrote: >> On Sun, 2010-12-26 at 20:37 -0800, flebber wrote: >> > Is there anyay to use input masks in python? Similar to the function >> > found in access where a users input is limited to a type, length and >> > form

Re: User input masks - Access Style

2010-12-31 Thread flebber
On Dec 28 2010, 12:21 am, Adam Tauno Williams wrote: > On Sun, 2010-12-26 at 20:37 -0800, flebber wrote: > > Is there anyay to use input masks in python? Similar to the function > > found in access where a users input is limited to a type, length and > > format. > >

Re: User input masks - Access Style

2010-12-31 Thread flebber
On Dec 28 2010, 12:21 am, Adam Tauno Williams wrote: > On Sun, 2010-12-26 at 20:37 -0800, flebber wrote: > > Is there anyay to use input masks in python? Similar to the function > > found in access where a users input is limited to a type, length and > > format. > >

Re: User input masks - Access Style

2010-12-27 Thread Adam Tauno Williams
On Sun, 2010-12-26 at 20:37 -0800, flebber wrote: > Is there anyay to use input masks in python? Similar to the function > found in access where a users input is limited to a type, length and > format. Typically this is handled by a call

Re: Fw: Re: User input masks - Access Style

2010-12-27 Thread flebber
> ... seconds = int(componets[1]) > > ... microseconds = int(componets[2]) > > ... > > ... # output the time > > ... print("Your time is: " + "%02d" % minutes + ":" + "%02d" % seconds + > > ":" + > > ... ??&q

Fw: Re: User input masks - Access Style

2010-12-27 Thread linmq
;:" + "%02d" % seconds + ":" + > ... ??"%02d" % microseconds) > > Currency works the same way using validating it against: > r'''[0-9]+\.[0-9]{2}''' > > > For sports times that is time duration not a system or d

Re: User input masks - Access Style

2010-12-26 Thread flebber
uot; + "%02d" % minutes + ":" + "%02d" % seconds + ":" + > ...     "%02d" % microseconds) > > Currency works the same way using validating it against: > r'''[0-9]+\.[0-9]{2}''' > > > For sports time

Re: User input masks - Access Style

2010-12-26 Thread Tim Harig
On 2010-12-27, Tim Harig wrote: > ... if re.match(r'''^[0-9]{2}:[0-9]{2}:[0-9]{2}$''', timeInput) == None: [SNIP] > Currency works the same way using validating it against: > r'''[0-9]+\.[0-9]{2}''' Sorry, you need to check to make sure that there are no trailing characters as in the example abov

Re: User input masks - Access Style

2010-12-26 Thread Tim Harig
nds = int(componets[2]) ... ... # output the time ... print("Your time is: " + "%02d" % minutes + ":" + "%02d" % seconds + ":" + ... "%02d" % microseconds) Currency works the same way using validating it against: r'''[0-9]+\.[0-9]{

User input masks - Access Style

2010-12-26 Thread flebber
times that is time duration not a system or date times should I assume that I would need to calculate a user input to a decimal number and then recalculate it to present it to user? So an example, sorry. import time #not sure if this is any use minute = input("How many minutes: ") secon

Safely decoding user input

2010-09-02 Thread Tom Miller
Hello everyone, Before I pose my question, I should mention that I'm still pretty unfamiliar with proper terminology for string encoding, so I might get some of it wrong. Please bear with me. I'm writing a program that accepts arguments from the command line. Some of my users are using Windows wi

Re: Trying To Catch Invalid User Input

2009-08-24 Thread Victor Subervi
That's nice. Thanks! V On Sun, Aug 23, 2009 at 5:02 PM, Dennis Lee Bieber wrote: > On Sun, 23 Aug 2009 10:04:57 -0500, Victor Subervi > declaimed the following in > gmane.comp.python.general: > > > Hi; > > I have the following: > > > > style = raw_input('What style is this? (1 = short, 2 = long)

Re: Trying To Catch Invalid User Input

2009-08-23 Thread Victor Subervi
Really slick! Thanks! V On Sun, Aug 23, 2009 at 11:08 AM, Albert Hopkins wrote: > On Sun, 2009-08-23 at 16:36 +0100, MRAB wrote: > > Victor Subervi wrote: > > > Hi; > > > I have the following: > > > > > > style = raw_input('What style is this? (1 = short, 2 = long): ') > > > flag = 0 > > > while

Re: Trying To Catch Invalid User Input

2009-08-23 Thread Albert Hopkins
On Sun, 2009-08-23 at 16:36 +0100, MRAB wrote: > Victor Subervi wrote: > > Hi; > > I have the following: > > > > style = raw_input('What style is this? (1 = short, 2 = long): ') > > flag = 0 > > while flag == 0: > > if (style != 1) or (style != 2): > > style = raw_input('There was a mistake.

Re: Trying To Catch Invalid User Input

2009-08-23 Thread Gary Herron
Victor Subervi wrote: Hi; I have the following: style = raw_input('What style is this? (1 = short, 2 = long): ') flag = 0 while flag == 0: if (style != 1) or (style != 2): style = raw_input('There was a mistake. What style is this? (1 = short, 2 = long): ') else: flag = 1 I would

Re: Trying To Catch Invalid User Input

2009-08-23 Thread MRAB
Victor Subervi wrote: Hi; I have the following: style = raw_input('What style is this? (1 = short, 2 = long): ') flag = 0 while flag == 0: if (style != 1) or (style != 2): style = raw_input('There was a mistake. What style is this? (1 = short, 2 = long): ') else: flag = 1 I would

Trying To Catch Invalid User Input

2009-08-23 Thread Victor Subervi
Hi; I have the following: style = raw_input('What style is this? (1 = short, 2 = long): ') flag = 0 while flag == 0: if (style != 1) or (style != 2): style = raw_input('There was a mistake. What style is this? (1 = short, 2 = long): ') else: flag = 1 I would think this would catch err

BaseHTTPRequestHandler delays server response after "Popen"ing a program that waits for user input? (getline, fgets, etc.)

2009-04-16 Thread gburde...@gmail.com
ot;POpen"ed C++ program (test1.cpp below) waits for some user input (via "getline()"; same thing happens with gets(), fgets()). In this case, the "good morning" message stills get printed on the server side, but the client doesn't get back "HELLO." If the

Re: Calling a script requiring user input from another script

2009-02-18 Thread Chris Rebert
On Wed, Feb 18, 2009 at 1:00 AM, mzagu...@gmail.com wrote: > I'm kind of new to this so bear with me. > > I have a script made that requires user input (lets call it script A) > while it's running. However, I would like to create another script > (script B) that ca

Calling a script requiring user input from another script

2009-02-18 Thread mzagu...@gmail.com
I'm kind of new to this so bear with me. I have a script made that requires user input (lets call it script A) while it's running. However, I would like to create another script (script B) that can batch process (i.e. run script A over and over with different user inputs based on scri

Re: Printing user input?

2007-11-15 Thread Mohammed_M
Thanks Mike, Lorenzo & Cliff for your replies. I definately will be reading up on namespaces & scopes. Thanks again guys :) -- http://mail.python.org/mailman/listinfo/python-list

Re: Printing user input?

2007-11-15 Thread J. Clifford Dyer
On Thu, Nov 15, 2007 at 09:03:26AM -0800, Mohammed_M wrote regarding Printing user input?: > > Hi, > I'm v.new to Python, so please don't be too harsh :) > I get a NameError with the code below - All I want to do is store some > input taken from the user in a variable

Re: Printing user input?

2007-11-15 Thread kyosohma
On Nov 15, 11:03 am, Mohammed_M <[EMAIL PROTECTED]> wrote: > Hi, > I'm v.new to Python, so please don't be too harsh :) > I get a NameError with the code below - All I want to do is store some > input taken from the user in a variable called name, & then print name > > # START CODE

Re: Printing user input?

2007-11-15 Thread Lorenzo E. Danielsson
On Thu, 2007-11-15 at 09:03 -0800, Mohammed_M wrote: > Hi, > I'm v.new to Python, so please don't be too harsh :) > I get a NameError with the code below - All I want to do is store some > input taken from the user in a variable called name, & then print name > > # START CODE

Printing user input?

2007-11-15 Thread Mohammed_M
Hi, I'm v.new to Python, so please don't be too harsh :) I get a NameError with the code below - All I want to do is store some input taken from the user in a variable called name, & then print name # START CODE == # Print name demo def PersonsDetails():

Re: Entering strings as user input but interpreting as Python input (sort of)

2007-09-17 Thread Gabriel Genellina
En Mon, 17 Sep 2007 21:01:38 -0300, Chris Carlen <[EMAIL PROTECTED]> escribi�: > I'm writing a Python program, a hex line editor, which takes in a line > of input from the user such as: > > >>> cmd = raw_input('-').split() > -e 01 02 "abc def" 03 04 > >>> cmd > ['e', '01', '02', '"abc', 'def"'

Entering strings as user input but interpreting as Python input (sort of)

2007-09-17 Thread Chris Carlen
rthermore, if the user entered: -e 01 02 "abc \"def\"\r\n" 03 04 I would want the quoted part to be interpreted as if I entered it into Python itself (recognize escape sequences, and not split at spaces) as: >>> s = '"abc \"def\"\r\n"'

Re: User input with a default value that can be modified

2007-05-28 Thread half . italian
On May 28, 11:52 am, "Etienne Hilson" <[EMAIL PROTECTED]> wrote: > Hello the list :-) > > I do a little program that permit the user to manage list of sentences. > This program runs into a linux shell. > The user can add, modify and delete the sentences. > > What I want to do is : > > When the user

Re: User input with a default value that can be modified

2007-05-28 Thread half . italian
On May 28, 11:52 am, "Etienne Hilson" <[EMAIL PROTECTED]> wrote: > Hello the list :-) > > I do a little program that permit the user to manage list of sentences. > This program runs into a linux shell. > The user can add, modify and delete the sentences. > > What I want to do is : > > When the user

User input with a default value that can be modified

2007-05-28 Thread Etienne Hilson
Hello the list :-) I do a little program that permit the user to manage list of sentences. This program runs into a linux shell. The user can add, modify and delete the sentences. What I want to do is : When the user want to modify one sentence, I would like to do this : Modify your sentence :

Re: Python Widget to read in user input box in blog

2007-04-24 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: > Hey, > > I am helping to develop a project that displays images based on user > input. One possible way of implementing this is via a widget that > when it is run, would read in the users input from an input text field > (probably from a blog), and r

Re: Python Widget to read in user input box in blog

2007-04-23 Thread half . italian
On Apr 23, 6:57 pm, [EMAIL PROTECTED] wrote: > Hey, > > I am helping to develop a project that displays images based on user > input. One possible way of implementing this is via a widget that > when it is run, would read in the users input from an input text field > (probably

Re: Python Widget to read in user input box in blog

2007-04-23 Thread James Stroud
[EMAIL PROTECTED] wrote: > Hey, > > I am helping to develop a project that displays images based on user > input. One possible way of implementing this is via a widget that > when it is run, would read in the users input from an input text field > (probably from a blog), and r

Python Widget to read in user input box in blog

2007-04-23 Thread ecpbm765
Hey, I am helping to develop a project that displays images based on user input. One possible way of implementing this is via a widget that when it is run, would read in the users input from an input text field (probably from a blog), and replace it with the HTML that would display those images

Re: popen, Pipes with programs that expect user input

2007-01-08 Thread Gabriel Genellina
At Monday 8/1/2007 13:06, Alex wrote: So far everything works fine, but I encounter a problem with commands which require some sort of user input; i.e. they don't return immediately. Could someone point out the cause of this? It seems to me that the interpreter is stuck at this line

popen, Pipes with programs that expect user input

2007-01-08 Thread Alex
Hello everyone, I am writing a terminal server client-server application, that offers the client the ability to run commands on the server and read their output. So far everything works fine, but I encounter a problem with commands which require some sort of user input; i.e. they don't r

Re: command text parsing and hints displaying on user input.

2006-10-17 Thread Kent Johnson
Andy wrote: > Hi guys, > > I'm writing a program with a feature of accepting user input as command > text and parsing it to correct function calls...example: > > "5 minutes later"/"5 min later"/"5 minute later"/"after 5 minutes"..

Re: command text parsing and hints displaying on user input.

2006-10-16 Thread Andy
Anybody have an idea on this?? Does Natural Language Processing help in this case? -- http://mail.python.org/mailman/listinfo/python-list

command text parsing and hints displaying on user input.

2006-10-16 Thread Andy
Hi guys, I'm writing a program with a feature of accepting user input as command text and parsing it to correct function calls...example: "5 minutes later"/"5 min later"/"5 minute later"/"after 5 minutes"... are being parsed as the same rule so the s

Re: is there an easy way to create a database on the fly and let the user input values

2006-10-13 Thread Peter Decker
On 12 Oct 2006 15:50:16 -0700, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > dabo looks intresting but I am just looking for the simplist way and > having to load from thier thing just complicates stuff. I could > probily just use wx.grid but examples are scarce, I have seen some > simple dbm st

  1   2   >