Questions tagged [user-input]

User Input is data that the user inputs into the program. It generally takes the form of a String, but may also be an integer, floating-point number, etc.

5580 questions
11
votes
1 answer

Python - Read User Input while Printing Output

I'm trying to write a (command line) python program that will accept input from the user while still printing data above it. I am trying to make a chat program. Example: [stuff prints here] hello warning: the time is 27:64 Please enter your input:…
baum
  • 959
  • 13
  • 27
11
votes
4 answers

How do I create an input box with Python?

I want to create an on-screen input box that a user can interact with. The user would see a window with an input field they can click with the mouse. The user could type or erase text in the field, then press OK once they have finished adding text.…
Lev
  • 673
  • 1
  • 12
  • 29
11
votes
7 answers

Python - Infinite while loop, break on user input

I have an infinite while loop that I want to break out of when the user presses a key. Usually I use raw_input to get the user's response; however, I need raw_input to not wait for the response. I want something like this: print 'Press enter to…
James Mnatzaganian
  • 1,255
  • 1
  • 17
  • 32
11
votes
1 answer

How to add a wait timer on an input field keyup event?

I have an input field, and it has a keyup event: $(document).ready(function() { $('#SearchInputBox').keyup(function() { DoSearch($(this).val()); }); }); How can I add a delay time, so that only when the user stopped typing for 1…
omega
  • 40,311
  • 81
  • 251
  • 474
11
votes
3 answers

What is the correct way to make web form input safe for a variety of contexts?

What do you all think is the correct (read: most flexible, loosely coupled, most robust, etc.) way to make user input from the web safe for use in various parts of a web application? Obviously we can just use the respective sanitization functions…
Anonymous
  • 3,334
  • 3
  • 35
  • 50
10
votes
1 answer

Standard format for yes/no questions in the terminal?

Over the years I've seen many different ways of solving the problem of asking the user a simple yes/no question with a default value in the terminal. But in the interest of standardization, does any kind of standard for doing this exist ? Some of…
CSkau
  • 625
  • 6
  • 10
10
votes
3 answers

How to use InputConnectionWrapper?

I have an EditText. Now I want to get all changes made by the user to this EditText and work with them before manually inserting them into the EditText. I don't want the user to directly change the text in the EditText. This should only be done by…
ubuntudroid
  • 3,680
  • 6
  • 36
  • 60
10
votes
3 answers

Storing API keys and secrets in Google AppScript user property

I'm quite new to Google AppScript, trying to code a connector to a custom REST API. For that API I need an API key (or secret), that is per user. Since storing a secret in plain text inside the script is not the best idea, I was thinking to store it…
Matthias
  • 5,574
  • 8
  • 61
  • 121
10
votes
2 answers

Shrinking font-size at a user types to fit in an input using Javascript

Apple's MobileMe uses Javascript to change the font size in the email login on its homepage as the user types so that the text always fits in the available space without overflow scrolling. While I can see how how to execute a function on each…
Andrew De Andrade
  • 3,606
  • 5
  • 32
  • 37
10
votes
3 answers

Jupyter notebook: let a user inputs a drawing

Simple question but I'm not able to find something out there... Is there a simple and user friendly tool that can be used within a jupyter-notebook to let the user draw something in black on a white space (let say of size (x,y) pixels) after running…
swiss_knight
  • 5,787
  • 8
  • 50
  • 92
10
votes
7 answers

How to capitalize first letter of first word in a sentence?

I am trying to write a function to clean up user input. I am not trying to make it perfect. I would rather have a few names and acronyms in lowercase than a full paragraph in uppercase. I think the function should use regular expressions but I'm…
Enkay
  • 1,898
  • 6
  • 24
  • 35
10
votes
1 answer

Manual Build Step in Jenkins Declarative Pipeline?

This is a follow-up question to this previous post that doesn't seem like it was ever truly answered with more than a "this looks promising": Jenkins how to create pipeline manual step. This is a major functionality gap for CICD pipelines. The…
10
votes
4 answers

How do I do simple user input in python?

I'm just playing with input and variables. I'm trying to run a simple function: slope = (y2-y1)/(x2-x1) I'd like to prompt the user to enter y2, y1, x2 and x1. What is the simplest, cleanest way to do this?
Zack Shapiro
  • 371
  • 4
  • 5
  • 14
10
votes
2 answers

Prevent "input" function from calling functions or accessing variables

Considering the following code x = input('Input an array: '); If the user types [1 2 3], variable x will be assigned that numeric vector. Similarly, if they type {1, [2 3], 'abc'}, variable x will be a cell array containing those values. Fine. Now,…
Luis Mendo
  • 110,752
  • 13
  • 76
  • 147
10
votes
7 answers

Doctesting functions that receive and display user input - Python (tearing my hair out)

I am currently writing a small application with Python (3.1), and like a good little boy, I am doctesting as I go. However, I've come across a method that I can't seem to doctest. It contains an input(), an because of that, I'm not entirely sure…
GlenCrawford
  • 3,359
  • 3
  • 26
  • 34