By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,922 Members | 1,689 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,922 IT Pros & Developers. It's quick & easy.

An interesting question about "print '\a'"

P: n/a
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
Oct 24 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
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 && ma*@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
Oct 24 '05 #2

P: n/a
On 2005-10-24, 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?

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.

--
Chris F.A. Johnson <http://cfaj.freeshell.org>
================================================== ================
Shell Scripting Recipes: A Problem-Solution Approach, 2005, Apress
<http://www.torfree.net/~chris/books/cfaj/ssr.html>
Oct 24 '05 #3

P: n/a
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.

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?

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


Oct 24 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.