An interesting question about "print '\a'"

Erik Max Francis max at alcyone.com
Mon Oct 24 06:44:48 CEST 2005


Anthony Liu wrote:

> We know that if we do
> 
> print '\a'
> 
> the bell will sound.
> 
> Now, why do I hear the sound on my local machine when
> I run a python script on a remote host?

Because print '\a' just prints the BEL ASCII character, which most 
terminals respond by beeping.  Since, when you're logged into a remote 
machine, it's your terminal that's displaying the output of your remote 
session, that's why you hear the beep on your local machine.

-- 
Erik Max Francis && max at alcyone.com && http://www.alcyone.com/max/
San Jose, CA, USA && 37 20 N 121 53 W && AIM erikmaxfrancis
   Maybe soul mates exist / After all
   -- Des'ree



More information about the Python-list mailing list