On Fri, Jun 17, 2011 at 11:34 PM, Victor <vicp...@yahoo.com> wrote:

> I am in the process of building a script but I do not know if what I am
> trying to do is possible. So, long story short, I need help.
>
> The concept:
> I am want to be able to ask the user a series of questions in the program
> window.
>
> But here is the action I want to appear on the screen.
>
> 0. Question pops up
> 1. User inputs answer
> 2. User press enter
> 3. The first question and answer is replaced with a new question on the
> screen
> 4. User answers the second question
> 5. User press enter
> 6. Question and answer disappears
> 7. etc.
>
> All user inputs are placed in a variable.
>
> Please help. :-)
>

One way I read this (not sure if this is what you meant, if so, skip down to
the bottom): Very possible, and very easy. Sounds a bit too much like a
homework question for me to give you complete help ;), however -

Look up raw_input.

>>> a_variable = raw_input('Is this a question?')
Is this a question?Yes
>>> print a_variable
Yes

Make a program, or attempt to, and post back here with any questions.


Of course, if you mean *completely in-place replace* the question, then you
will need something like ncurses (if on Linux)  -
http://docs.python.org/library/curses.html

If on Windows, have a look at - http://effbot.org/zone/console-index.htm

HTH.
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to