An interesting question about "print '\a'"

A

Anthony Liu

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?

I understand if I hear it when I do

print '\a'

on my local machine.

Does the command get sent back to the client machine?

Thanks.

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
 
C

Chris F.A. Johnson

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?

I understand if I hear it when I do

print '\a'

on my local machine.

Does the command get sent back to the client machine?

The code is printed to stdout, which is your terminal. Your
terminal interprets ^G as a beep.
 
E

Erik Max Francis

Anthony said:
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.
 
B

bonono

I thought that is just a "terminal" thing(extend ASCII that interpreted
by the terminal)? If you have a terminal attached to a host, shouldn't
this be making sound on the terminal rather than the server ? This not
alsa or output to the server device, but straightly sending '\a' back
to the client machine I believe.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top