The raw input API provides a stable and robust way for applications to accept raw input from any HID (Human Interface Devices), including the keyboard and mouse.
Questions tagged [raw-input]
623 questions
-3
votes
2 answers
Type error: 'int' object has no attribute. python int(raw_input())
I am utilizing python 2.7 and arcpy do do some data management.
I'm trying to create a script to ask the user what year the data is from, for the file paths to be generated.
while True:
try:
year = int(raw_input("What state fiscal year…

Moldy Mushroom
- 51
- 2
- 9
-3
votes
2 answers
Strange vanishing of CR in strings coming from a copy of a file's content passed to raw_input()
Trying to clear up the reasons of what seemed to be a bug, I finally bumped into a weird behaviour of the raw_input() function in Python 2.7:
it removes the CR characters of pairs CR LF from only the strings that result from a manual copy (via the…

eyquem
- 26,771
- 7
- 38
- 46
-3
votes
1 answer
Python dynamic dictionary size with user input for key
Input can be up to (but not always) 20 values between 1-99 separated by 'or' that need to be associated with a string. User input will supply both the value and the "label" that should replace that value in a print-to-text-file output. I also can…

chrisstaton
- 3
- 1
-3
votes
1 answer
Raw_input in Python not returning (Sublime Text 3)
I am using Sublime Text 3. This is my code:
a = raw_input("Test raw: ")
It correctly asks for Test raw: but does not do anything after entering a letter. This line, however, works in command prompt.
Basically, after Test raw: displays and I enter a…

Shivani
- 105
- 1
- 9
-3
votes
4 answers
python, please tell me whats wrong
python,please help. I want this code to ask someone if they are ok with the grade. if they say yes, it prints good! if they say no, it says oh well! if they dont say yes or no, i want it to print " please enter yes or no" and keep asking them that…

Evan Westphal
- 21
- 1
-3
votes
2 answers
SyntaxError: 'break' outside loop in python code
When running this code I keep getting the error SyntaxError: 'break' outside loop in python code after I enter any number (the first raw-input). I am trying to break the while-loop not the if-else loop which I think might be what's happening.
…

Ryan Bradley-Evans
- 11
- 1
- 2
-3
votes
1 answer
understanding python strings and "raw_input()"
I'm sure this is kind of silly but I'm having trouble understanding strings, and the raw_input object.
So, example
print "How much money do I have?",
checking balance = raw_input()
savings balance = raw_input()
print "I have %r and %r in my…

user3466180
- 19
- 3
-4
votes
2 answers
In Python, How do I skip to a specific line in a script?
I am making a script that opens programs, in this case, Google Chrome and iTunes. Google Chrome comes first, and in the script it asks if you want to enter the password to launch Google Chrome. If the user types 'Yes' then it asks for the password,…

Ryan Werner
- 65
- 3
- 6
-4
votes
1 answer
why does a part of my code that is he same as another working part not work
im using python script 2.7.15 and it says "there is an error in your program:invalid syntax" and then it highlight a : in red on the line 21 and i dont understand why that : would be wrong since it didnt have a problem with any of the code before…

Ovis Aries
- 3
- 1
-4
votes
2 answers
How to reprint the
How cab I repeat the raw_input sentence because every time I or the user answers the question written the python say press any key to continue but I want to repeat the question to know if the user want to do any thing else using the programme I wish…

zedo ghoneim
- 3
- 2
-4
votes
1 answer
How to prevent a keyboard from writing to other applications
I am using a simple Hookup to record the keys from a BarcodeScanner which is a connect via Usb as a Keyboard. I am using this example that I found online:
using System.Windows.Forms;
namespace RawInput
{
public partial class Form1 : Form
{
…

Leo.S
- 21
- 5
-4
votes
1 answer
Raw Input Inside If-statement?
Is there a way to use raw input inside an if-statement? I would like to ask the user a question and if they type "yes" I want to code to continue working after the if-statement. If they type "no" I want the code to say "Thank you for your time" and…

Zach Erickson
- 1
- 1
-4
votes
1 answer
when defining functions in python program crashes
as apparent by my obvious lack of programming experience im fairly new and a slow learner can someone please explain this to me? the rest of the program runs fine independent from this section but i can't even run this section by itself.
I have four…

benjamin riley
- 1
- 1
-4
votes
2 answers
Getting raw input from user
I am getting input from users via raw_input (using a for loop).
What code can I use to ensure that if a user presses only Enter it keeps the default values (i.e. raw_input returns an empty string '' when no value has been entered)?
So for the…

TRex
- 9
- 1
-4
votes
2 answers
What is wrong in the code?
I am very newbie to programming and stack overflow. I choose python as my first language. Today as I was writing some code to refresh and to improve my skills I wrote a little program. But with complete errors.
Here is the Program
a = [1 , 2,…

Rahul Khanna
- 316
- 3
- 12