473,387 Members | 1,404 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Help: low level user input

Ok, I have a little tiny problem, a beginner problem, that I am overlooking.
I am writing a Information Gathering Program, that takes user input from
scripted questions and prints them in a handy list in the end. As of now,
when one of my questions is asked, the only possible way to enter text is to
type ( "John" ) minus the parenthesis. You do need the qoutation marks
though. I just want to be able to type ( John ) without the unneeded
quotation marks. I know someone has the answer, sorry for the inexperienced
question, but it's ticking me off.

This is my program:

from time import sleep

##INTRODUCTION
print "Personal Information Program"
print "----------------------------"
print
sleep(3)
print "Please input the requested information... "
sleep(1)

##INPUT NAME
print "ID: "
sleep(2)
print "What is your first name?"
fname = input ("> ")
sleep(1)
print "What is your middle initial?"
mname = input ("> ")
sleep(1)
print "What is your last name?"
lname = input ("> ")
sleep(1)

##INPUT ADDRESS
print "Location: "
sleep(2)
print "What is your street address?"
saddy = input ("> ")
sleep(1)
print "What city do you live in?"
city = input ("> ")
sleep(1)
print "What state do you live in?"
state = input ("> ")
sleep(1)
print "What is your zipcode?"
zip = input ("> ")
sleep(1)
print "Do you have a P.O. Box?"
poan = input ("> ")
if poan == yes:
print "What is your P.O. Box number?"
pobox = input ("> ")
Jul 18 '05 #1
2 2367
Kyle E wrote:
Ok, I have a little tiny problem, a beginner problem, that I am
overlooking. I am writing a Information Gathering Program, that takes user
input from scripted questions and prints them in a handy list in the end.
As of now, when one of my questions is asked, the only possible way to
enter text is to
type ( "John" ) minus the parenthesis. You do need the qoutation marks
though. I just want to be able to type ( John ) without the unneeded
quotation marks. I know someone has the answer, sorry for the
inexperienced question, but it's ticking me off.


Use raw_input() instead of input() to get the string as typed by the user.
input() evaluates the user input what is definitely not what you want in
your little program, e. g:
Peter = "John"
input() Peter
'John'

or most likely:
input("First name ") First name John
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "<string>", line 0, in ?
NameError: name 'John' is not defined


HTH,
Peter

Jul 18 '05 #2
> Kyle E wrote:
Ok, I have a little tiny problem, a beginner problem, that I am
overlooking. I am writing a Information Gathering Program, that takes user
input from scripted questions and prints them in a handy list in the end. As of now, when one of my questions is asked, the only possible way to
enter text is to
type ( "John" ) minus the parenthesis. You do need the qoutation marks though. I just want to be able to type ( John ) without the unneeded
quotation marks. I know someone has the answer, sorry for the
inexperienced question, but it's ticking me off.

Peter Wrote:
Use raw_input() instead of input() to get the string as typed by the user.
input() evaluates the user input what is definitely not what you want in
your little program, e. g:
Peter = "John"
input() Peter
'John'

or most likely:
input("First name ") First name John
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "<string>", line 0, in ?
NameError: name 'John' is not defined


HTH,
Peter


Kyle Wrote:

I forgot about using raw_input, now I can finish writing my program, Thanks
a lot Peter
Jul 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: PerritoPerron | last post by:
//I need a little help with this program, it runs but the output is not correct. //Can i get some help here please u fellas??? // This Program asks for user input like 1 && 0 and prints if it is...
8
by: baustin75 | last post by:
Posted: Mon Oct 03, 2005 1:41 pm Post subject: cannot mail() in ie only when debugging in php designer 2005 -------------------------------------------------------------------------------- ...
5
by: Simon Mansfield | last post by:
Im trying to read in a list of employee's from a file, in the format: 01:SJM:Programmer:481 (<- £4.81 an hr) 02:AMG:Python Scripter:512 : : etc. When assigning to the "new" pointer it...
1
by: aredo3604gif | last post by:
On Sun, 10 Apr 2005 19:46:32 GMT, aredo3604gif@yahoo.com wrote: >The user can dynamically enter and change the rule connection between >objects. The rule is a "<" and so given two objects: >a <...
7
by: Novice Computer User | last post by:
Hi. Can somebody PLEASE help. I have spent hours on this.. but I am a total novice and can't seem to figure it out. Here is a .php script. Right now, the minimum amount of time (i.e. duration)...
4
by: lsu420luv | last post by:
'i have been working on this assignment for like 45 hours. the file reads from Piano.data and outputs into report.out. I have everything working, except for the fact that it will not repeat until...
0
by: Chuck36963 | last post by:
Hi all, I've been working on a listing problem and I can't figure out how to work it out. I have looked far and wide on the web to find answers, but I'd like other peoples input on my project in...
0
by: gunimpi | last post by:
http://www.vbforums.com/showthread.php?p=2745431#post2745431 ******************************************************** VB6 OR VBA & Webbrowser DOM Tiny $50 Mini Project Programmer help wanted...
0
by: thinboy | last post by:
Im having trouble with a Java Home work. I have found the following classes are their anymore This system is intended to provide the school timetabler with information to support his/her...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.