On 27/12/12 12:07, Randy WhiteWolf wrote:

Phthon Programming for the Absolute Beginner by Michael Dawson. I have
copied the code verbatim below.
# Sound the system bell
print "\a"
> ...
raw_input ("\n\nPress the enter key to exit.")
My problem is I hear no system bell; the enter doesn't respond by
quitting the program;

How are you running the code?
I suspect you are using IDLE or Pythonwin or some other IDE?
These generally don't obey the standard escape character
conventions. And in fact not all terminals do either!

If you put the code in a text file called screen.py (or
whatever you prefer) and run it from the command line with

C:\Windows> python screens.py

You might see something more like the expected result.
But a lot depends on your OS and terminal software.
My Linux terminal doesn't ring a bell (or flash) for example.
Lesson: don't rely on terminal escape characters unless you know exactly what terminal your users will be using.

--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/

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

Reply via email to