[Python] Proprio IP

2009-06-11 Thread castor91
Ciao..ragazzi, se io volesssi scoprire il mio IP come posso fare?? sono
interno ad una LAN quindi non voglio sapere il mio indirizzo Ip privato ma
quello pubblicoqualcuno sa aiutarmi??

-- 
castor91
___
Python mailing list
Python@lists.python.it
http://lists.python.it/mailman/listinfo/python


Re: [Python] Proprio IP

2009-06-11 Thread Giorgio Zoppi
Il giorno 11 giugno 2009 11.52, castor91 ha scritto:
> Ciao..ragazzi, se io volesssi scoprire il mio IP come posso fare?? sono
> interno ad una LAN quindi non voglio sapere il mio indirizzo Ip privato ma
> quello pubblicoqualcuno sa aiutarmi??
La prima idea che mi viene in mente e' quella di fare un server tcp
fuori dalla tua rete
privata e con getpeername

--
Quiero ser el rayo de sol que cada día te despierta
para hacerte respirar y vivir en me.
"Favola -Moda".
___
Python mailing list
Python@lists.python.it
http://lists.python.it/mailman/listinfo/python


Re: [Python] Proprio IP

2009-06-11 Thread castor91
non ho capito.. ;( un esempio??
___
Python mailing list
Python@lists.python.it
http://lists.python.it/mailman/listinfo/python


Re: [Python] Proprio IP

2009-06-11 Thread Giorgio Zoppi
oppure usa stun.

http://code.google.com/p/pystun/

In pratica crei un piccolo server con apre una socket, fa una accept e
lo lanci da un host fuori
dalla tua lan. Poi crei un client dentro la tua lan e ti connetti al
server. Il server dopo la accept stampera chiamara getpeername. E'
tutto nel package socket.


-- 
Quiero ser el rayo de sol que cada día te despierta
para hacerte respirar y vivir en me.
"Favola -Moda".
___
Python mailing list
Python@lists.python.it
http://lists.python.it/mailman/listinfo/python


Re: [Python] Proprio IP

2009-06-11 Thread Gian Mario Tagliaretti
2009/6/11 castor91 :
> non ho capito.. ;( un esempio??

http://alastairs-place.net/netifaces/

ciao
-- 
Gian Mario Tagliaretti
GNOME Foundation member
gia...@gnome.org
___
Python mailing list
Python@lists.python.it
http://lists.python.it/mailman/listinfo/python


Re: [Python] Proprio IP

2009-06-11 Thread Giorgio Zoppi
2009/6/11 Gian Mario Tagliaretti :
> 2009/6/11 castor91 :
>> non ho capito.. ;( un esempio??
>
> http://alastairs-place.net/netifaces/

Si, ma se e' sotto NAT cambia.

-- 
Quiero ser el rayo de sol que cada día te despierta
para hacerte respirar y vivir en me.
"Favola -Moda".
___
Python mailing list
Python@lists.python.it
http://lists.python.it/mailman/listinfo/python


Re: [Python] Proprio IP

2009-06-11 Thread Gian Mario Tagliaretti
2009/6/11 Giorgio Zoppi :
> 2009/6/11 Gian Mario Tagliaretti :

>> http://alastairs-place.net/netifaces/

> Si, ma se e' sotto NAT cambia.

vero, lui è sotto NAT?

ciao
-- 
Gian Mario Tagliaretti
GNOME Foundation member
gia...@gnome.org
___
Python mailing list
Python@lists.python.it
http://lists.python.it/mailman/listinfo/python


Re: [Python] Proprio IP

2009-06-11 Thread Raffaele Salmaso
castor91 wrote:
> Ciao..ragazzi, se io volesssi scoprire il mio IP come posso fare??
 >>> import urllib
 >>> ip = urllib.urlopen('http://whatismyip.org').read()
 >>> print ip
___
Python mailing list
Python@lists.python.it
http://lists.python.it/mailman/listinfo/python


Re: [Python] Proprio IP

2009-06-11 Thread Giorgio Zoppi
2009/6/11 Raffaele Salmaso :
> castor91 wrote:
>> Ciao..ragazzi, se io volesssi scoprire il mio IP come posso fare??
>  >>> import urllib
>  >>> ip = urllib.urlopen('http://whatismyip.org').read()
>  >>> print ip
Ganzo...mica lo sapevo che esiteva un sito cosi.
-- 
Quiero ser el rayo de sol que cada día te despierta
para hacerte respirar y vivir en me.
"Favola -Moda".
___
Python mailing list
Python@lists.python.it
http://lists.python.it/mailman/listinfo/python


Re: [Python] Proprio IP

2009-06-11 Thread Manlio Perillo
Gian Mario Tagliaretti ha scritto:
> 2009/6/11 castor91 :
>> non ho capito.. ;( un esempio??
> 
> http://alastairs-place.net/netifaces/
>

Non credo funzioni chiedere il proprio indirizzo alle interfacce di rete
locali.

Se sei una LAN, l'indirizzo IP pubblico lo conosce solo il (o i) router
collegato all'esterno.



Ciao  Manlio
___
Python mailing list
Python@lists.python.it
http://lists.python.it/mailman/listinfo/python


Re: [Python] Proprio IP

2009-06-11 Thread castor91
sembra abbastanza complicato ;) non c'è già una funzione?? ci sono per
tutto ;)
___
Python mailing list
Python@lists.python.it
http://lists.python.it/mailman/listinfo/python


Re: [Python] Proprio IP

2009-06-11 Thread Francesco Benincasa
* Thursday 11 June 2009, alle 12:14, Giorgio Zoppi scrive:
> 2009/6/11 Raffaele Salmaso :
> > castor91 wrote:
> >> Ciao..ragazzi, se io volesssi scoprire il mio IP come posso fare??
> >  >>> import urllib
> >  >>> ip = urllib.urlopen('http://whatismyip.org').read()
> >  >>> print ip
> Ganzo...mica lo sapevo che esiteva un sito cosi.

E c'e' anche:
http://www.myip.it/
http://www.ip-adress.com/

nonche' basta fare un "traceroute www.python.it" e al passo 2 della lista (se
hai solo un router davanti a te, altrimenti al 3 e cosi' via) ti becchi
l'IP pubblico.

Ciao.

-- 
| Francesco Benincasa - http://ciccio2000.altervista.org/
| EcoSCIENZE Societa' Cooperativa - http://www.ecoscienze.org/
| Ingegneria Senza Frontiere Bologna - http://isf.ing.unibo.it/
| Bologna Free Software Forum - http://www.bfsf.it/

Noise proves nothing.  Often a hen who has merely laid an egg cackles
as if she laid an asteroid.
-- Mark Twain
___
Python mailing list
Python@lists.python.it
http://lists.python.it/mailman/listinfo/python


Re: [Python] Proprio IP

2009-06-11 Thread Leonardo M. Millefiori
Giorgio Zoppi ha scritto:
> Il giorno 11 giugno 2009 11.52, castor91 ha scritto:
>   
>> Ciao..ragazzi, se io volesssi scoprire il mio IP come posso fare?? sono
>> interno ad una LAN quindi non voglio sapere il mio indirizzo Ip privato ma
>> quello pubblicoqualcuno sa aiutarmi??
>> 
> La prima idea che mi viene in mente e' quella di fare un server tcp
> fuori dalla tua rete
> privata e con getpeername
>
> --
> Quiero ser el rayo de sol que cada día te despierta
> para hacerte respirar y vivir en me.
> "Favola -Moda".
> ___
> Python mailing list
> Python@lists.python.it
> http://lists.python.it/mailman/listinfo/python
>   
La prima cosa che viene in mente a me invece è: 
http://whatismyipaddress.com/

Ciaoo
___
Python mailing list
Python@lists.python.it
http://lists.python.it/mailman/listinfo/python


Re: [Python] Proprio IP

2009-06-11 Thread Daniele Varrazzo
On Thu, 11 Jun 2009 12:25:02 +0200, castor91  wrote:
> sembra abbastanza complicato ;) non c'è già una funzione?? ci sono
> per
> tutto ;)

La soluzione di Raffaele è perfetta: è una sola riga.

Anche se ci sono altri siti che pubblicano l'ip, lo fanno in una pagina da
parsare. Leggere www.whatismyip.org è uno scherzo.

-- 
Daniele Varrazzo - Develer S.r.l. 
http://www.develer.com
___
Python mailing list
Python@lists.python.it
http://lists.python.it/mailman/listinfo/python


Re: [Python] Proprio IP

2009-06-11 Thread Alessandro
From: castor91 

> Ciao..ragazzi, se io volesssi scoprire il mio IP come posso fare?? 
> sono interno ad una LAN quindi non voglio sapere il mio indirizzo Ip 
> privato ma quello pubblicoqualcuno sa aiutarmi??

Fai uno script che va sul sito http://www.whatismyip.org/  (o un altro 
che offra lo stesso servizio) e legge il contenuto della pagina

Alessandro

___
Python mailing list
Python@lists.python.it
http://lists.python.it/mailman/listinfo/python


Re: [Python] Proprio IP

2009-06-11 Thread Gian Mario Tagliaretti
2009/6/11 Gian Mario Tagliaretti :
> 2009/6/11 Giorgio Zoppi :
>> 2009/6/11 Gian Mario Tagliaretti :
>
>>> http://alastairs-place.net/netifaces/
>
>> Si, ma se e' sotto NAT cambia.
>
> vero, lui è sotto NAT?

minchia che bestia che sono, l'aveva anche scritto :)

-- 
Gian Mario Tagliaretti
GNOME Foundation member
gia...@gnome.org
___
Python mailing list
Python@lists.python.it
http://lists.python.it/mailman/listinfo/python