sockets, gethostname() changing

half.italian at gmail.com half.italian at gmail.com
Fri May 25 03:05:39 EDT 2007


On May 24, 8:50 pm, 7stud <bbxx789_0... at yahoo.com> wrote:
> Thanks for the response.
>
> On May 24, 9:24 pm, half.ital... at gmail.com wrote:
>
> > I can't imagine why your hostname would be changing, unless you
> > installed some of their proprietary software thats messing around with
> > things.  
>
> When I first started using Terminal, I noticed that the prompt in
> Terminal changed when I was connected to the internet.
>
> > What is the hostname set to in Sys Prefs->Sharing?  
>
> My Name's Computer
>
> > Try
> > setting it there.  What are the before and after connection names you
> > get?
>
> If I add the line:
>
> host = socket.gethostname()
> print host   #<----------
>
> and I'm not connected to the internet and I run the program, I get:
>
> my-names-computer.local
>
> When I'm connected to the internet, I get:
>
> dialup-9.999.999.999.dial9.xxxxxxx.level9.net

That would bug me to high hell.  A router in the middle would probably
stop that.





More information about the Python-list mailing list