Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > An interesting question about "print '\a'"

Reply
Thread Tools

An interesting question about "print '\a'"

 
 
Anthony Liu
Guest
Posts: n/a
 
      10-24-2005
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
 
Reply With Quote
 
 
 
 
Chris F.A. Johnson
Guest
Posts: n/a
 
      10-24-2005
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>
 
Reply With Quote
 
 
 
 
Erik Max Francis
Guest
Posts: n/a
 
      10-24-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 && http://www.velocityreviews.com/forums/(E-Mail Removed) && 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
 
Reply With Quote
 
bonono@gmail.com
Guest
Posts: n/a
 
      10-24-2005
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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Interesting problem with NAT and VPN (not the usual question) Jim Westwood Cisco 6 10-15-2005 05:07 PM
Interesting Inheritance question with Inner classes Christian Bongiorno Java 2 05-10-2004 10:01 AM
Interesting Casting question =?ISO-8859-1?Q?Andreas_R=F8sdal?= Java 3 03-03-2004 10:22 PM
Interesting VoIP Bandwidth Question Kengie Cisco 2 12-10-2003 08:25 AM
Interesting Database Query Question!! Jay ASP .Net 1 10-02-2003 10:58 PM



Advertisments