On Apr 22, 4:55 pm, joamag joa...@gmail.com wrote:
Does anybody know a cross platform way to retrieve the default DNS
server IP address in python ?
Thanks !
João
import os,urllib2,re
def getIpAddr():
Function for parsing external ip adress by pinging dyndns.com
Does anybody know a cross platform way to retrieve the default DNS
server IP address in python ?
Thanks !
João
--
http://mail.python.org/mailman/listinfo/python-list
Antoine Pitrou pit...@free.fr added the comment:
It seems to break at least one buildbot:
==
ERROR: testSourceAddress (test.test_socket.NetworkConnectionAttributesTest)
R. David Murray rdmur...@bitdance.com added the comment:
Ah, and I was even the one that suggested the bind to 127.0.0.1 strategy for
the test :(
My buildbots run in linux-vserver virtual hosts, and they way they handle
localhost (127.0.0.1) is to alias it to the IP address assigned
Gregory P. Smith g...@krypto.org added the comment:
I took the easy route and remove the test of the hostname all together. The
fact that the source port was used is sufficient indication that the bind call
was made.
--
___
Python tracker
Gregory P. Smith g...@krypto.org added the comment:
trunk r77263 and r77264 add this feature, including documentation and tests.
--
resolution: - fixed
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue3972
Greg greg.helli...@gmail.com added the comment:
Did this ever happen? It seems like overkill in the non-Python sort of
way to continue pointing people to over-riding classes and extending
objects when such a small patch adds so powerful and useful a
functionality to the library.
--
R. David Murray rdmur...@bitdance.com added the comment:
Since Gregory didn't update the ticket, it seems likely that it hasn't
happened yet. If you'd care to try the patch and report on your
results, that would help the process. We'll also need unit tests and
documentation updates, so patches
Greg greg.helli...@gmail.com added the comment:
Just looking at the indicated file in the 2.6.4 release tarball, it does
not seem that it would apply cleanly. The line numbers do not apply
properly anymore, though the edited lines themselves still appear to be
unaffected. Without context
Antoine Pitrou pit...@free.fr added the comment:
I'm not sure why this is needed in httplib. Isn't it a matter of
configuring the machine's routing tables properly?
--
nosy: +pitrou
___
Python tracker rep...@bugs.python.org
Greg greg.helli...@gmail.com added the comment:
For my own case, I have a machine with 50 IP addresses set and I need to
run a script to grab data that will randomly select one of those IP
addresses to use for its outgoing connection. That's something which
needs to be selected at the socket
Antoine Pitrou pit...@free.fr added the comment:
For my own case, I have a machine with 50 IP addresses set and I need to
run a script to grab data that will randomly select one of those IP
addresses to use for its outgoing connection. That's something which
needs to be selected at the
one or something), and some other server it talks
to is using IP based security in its .htaccess file. So the client
machine needs to bind to the IP address that the server machine has
authorized to access the web service. This is why, for example, the ssh
command has a '-b' option to specify
Giampaolo Rodola' billiej...@users.sourceforge.net added the comment:
In case it helps, a guy recently reported the same issue for pyftpdlib:
http://code.google.com/p/pyftpdlib/issues/detail?id=123
--
___
Python tracker rep...@bugs.python.org
Eldon Ziegler eld...@atlanticdb.com added the comment:
The patch files for Python 2.6 and a test file are in the attached tar
file. Both httplib.py and socket.py need to be patched now.
httplib.HTTPConnection(host[, port[, strict[, timeout]]])
becomes
httplib.HTTPConnection(host[, port[,
R. David Murray rdmur...@bitdance.com added the comment:
If you want the maximum chance for this to get applied, it would be best
to have one or a set of patch files in 'svn diff' format against trunk
(see http://python.org/dev for information on how to produce such a
patch, specifically section
Gregory P. Smith g...@krypto.org added the comment:
yes its a real need and yes we should support this in the standard
library. no i have not had time to look at it since my comment a 14
months ago.
Thanks for the updated patch Eldon!
--
___
Fred Atkinson wrote:
What is the function to obtain the client browser's IP
address?
Do you mean the external public IP to the Internet? When I wanted to log the
dynamic IP that my ADSL connection gets, I used whatismyip.com like this:
import urllib2
QUERY_URL = 'http
Fred Atkinson fatkin...@mishmash.com (FA) wrote:
FAWhat is the function to obtain the client browser's IP
FA address?
You mean in a web server?
The following should work (and was posted by me not long ago):
from os import getenv
ip = (getenv(HTTP_CLIENT_IP) or
What is the function to obtain the client browser's IP
address?
Fred
--
http://mail.python.org/mailman/listinfo/python-list
Fred Atkinson fatkin...@mishmash.com (FA) wrote:
FA On Wed, 08 Jul 2009 12:29:54 +0200, Piet van Oostrum p...@cs.uu.nl
FA wrote:
Something like:
#! /usr/bin/env python
import cgi
from os import getenv
print Content-type: text/html
print
ipaddr = (getenv(HTTP_CLIENT_IP) or
Fred Atkinson fatkin...@mishmash.com wrote:
I wonder why they don't just have a function to return it instead of
putting you through all of that?
In CGI, EVERYTHING gets communicated through environment variables. That
(and the stdin stream) is really the only option, since you get a new
On Tue, 07 Jul 2009 22:54:03 -0300, Gabriel Genellina
gagsl-...@yahoo.com.ar wrote:
En Tue, 07 Jul 2009 22:45:24 -0300, Fred Atkinson fatkin...@mishmash.com
escribió:
Is there a Python function I can use to get the user's IP
address so I can display it on his browser?
There is a long
Fred Atkinson fatkin...@mishmash.com (FA) wrote:
FA On Tue, 07 Jul 2009 22:54:03 -0300, Gabriel Genellina
FA gagsl-...@yahoo.com.ar wrote:
En Tue, 07 Jul 2009 22:45:24 -0300, Fred Atkinson fatkin...@mishmash.com
escribió:
Is there a Python function I can use to get the user's IP
address
On Wed, 08 Jul 2009 12:29:54 +0200, Piet van Oostrum p...@cs.uu.nl
wrote:
Something like:
#! /usr/bin/env python
import cgi
from os import getenv
print Content-type: text/html
print
ipaddr = (getenv(HTTP_CLIENT_IP) or
getenv(HTTP_X_FORWARDED_FOR) or
getenv(HTTP_X_FORWARDED_FOR) or
to return it instead of
putting you through all of that?
There's no unambiguous definition of client IP, so you have to choose
which definition you want.
REMOTE_ADDR is set to the actual IP address from which the connection
originated (from getpeername()). If the connection was made via a proxy
Is there a Python function I can use to get the user's IP
address so I can display it on his browser?
Regards,
Fred
--
http://mail.python.org/mailman/listinfo/python-list
On 2009-07-08, Fred Atkinson fatkin...@mishmash.com wrote:
Is there a Python function I can use to get the user's IP
address so I can display it on his browser?
If you are using CGI you can get it from the REMOTE_ADDR environmental
variable.
--
http://mail.python.org/mailman/listinfo
On Tue, Jul 7, 2009 at 6:45 PM, Fred Atkinsonfatkin...@mishmash.com wrote:
Is there a Python function I can use to get the user's IP
address so I can display it on his browser?
from socket import gethostname, gethostbyname
ip = gethostbyname(gethostname())
Cheers,
Chris
--
http
En Tue, 07 Jul 2009 22:45:24 -0300, Fred Atkinson fatkin...@mishmash.com
escribió:
Is there a Python function I can use to get the user's IP
address so I can display it on his browser?
There is a long distance between Python and browser - you'll have to
tell us what is in between
Hi,
I am using pylons web framework for my server. I need to get the ip address
of the client machine which made a request to the server in my python code.
How can I do that, I am new to pylons and the existing server has so many
applications. looking forward to get some solutions from the kind
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA512
Hi Dave,
I've solved this now using ipaddr. ipaddr will be in the stdlib as soon
as its developers realize there are actually not one, but two proposals
to fix the remaining issues waiting for their input.
Anyway, since ipaddr:r68, you can do the
erikcw wrote:
Python seems to default to the main system IP for outbound connections
(such as urllib), but I want to bind to one of my other IPs for
outbound connections.
Any ideas?
Just use the .bind method of a socket to bind it to a specific address.
If you then want to continue to use
Python seems to default to the main system IP for outbound connections
(such as urllib), but I want to bind to one of my other IPs for
outbound connections.
Any ideas?
Thanks!
--
http://mail.python.org/mailman/listinfo/python-list
Gregory P. Smith [EMAIL PROTECTED] added the comment:
This is useful but as its a feature we won't be able to add it until
2.7/3.1. Assigning to me to make sure it happens.
Until then, the approach I suggest is to subclass httplib.HTTPConnection
and HTTPSConnection to add your own variants
Eldon Ziegler [EMAIL PROTECTED] added the comment:
Sounds good. Let me know if there is anything I can do to help.
Eldon
On Thu, 2008-10-02 at 18:17 +, Gregory P. Smith wrote:
Gregory P. Smith [EMAIL PROTECTED] added the comment:
This is useful but as its a feature we won't be able to
Changes by Giampaolo Rodola' [EMAIL PROTECTED]:
--
nosy: +giampaolo.rodola
___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue3972
___
___
Python-bugs-list
New submission from Eldon Ziegler [EMAIL PROTECTED]:
I updated httplib.py, python 2.4, to be able to bind to a specific IP
address when connecting to a remote site.
conn = httplib.HTTPConnection('82.94.237.218', 80)
will connect to '82.94.237.218' using one of the local IP addresses
Does anybody know how to find the real IP address (e.g.: address visible to
internet) of a machine via Python? In other words I have a machine with an
IP address something like 192.168.1.5, an address given to me by a router.
The router's address (and thus my machine's address) to the outside
On Tue, Aug 5, 2008 at 2:50 PM, David York [EMAIL PROTECTED] wrote:
Does anybody know how to find the real IP address (e.g.: address visible to
internet) of a machine via Python? In other words I have a machine with an
IP address something like 192.168.1.5, an address given to me by a router
Timothy Grant schrieb:
On Tue, Aug 5, 2008 at 2:50 PM, David York [EMAIL PROTECTED] wrote:
Does anybody know how to find the real IP address (e.g.: address visible to
internet) of a machine via Python? In other words I have a machine with an
IP address something like 192.168.1.5, an address
David York wrote:
How do I find out my machine's IP address as visible to the outside world?
Thanks a lot.
Most modern routers home routers support the IGD part of UPnP
(http://en.wikipedia.org/wiki/Internet_Gateway_Device_Protocol). You can
use an UPnP client software to query the router
IP address (e.g.: address
visible to internet) of a machine via Python? In other words I have a
machine with an IP address something like 192.168.1.5, an address given
to me by a router. The router's address (and thus my machine's address)
to the outside world is something realistic
Steven D'Aprano wrote:
The only way I know of is to query an external server that will tell you.
There's a few of them out there. Here's a few:
http://checkip.dyndns.org/
http://www.showmyip.com
http://www.showmyip.com/simple/
http://whatismyip.org/
all four of these show my internal IP
On Aug 6, 9:51 am, Emile van Sebille [EMAIL PROTECTED] wrote:
Steven D'Aprano wrote:
The only way I know of is to query an external server that will tell you.
There's a few of them out there. Here's a few:
http://checkip.dyndns.org/
http://www.showmyip.com
http://www.showmyip.com/simple/
I'm going to look into the Internet Gateway Device protocol and see what it
has to offer. If it is more work than it is work I'm going with Steven's
suggestion (nice code BTW).
And yes, you guys understood what I was asking - I wanted the internet IP
address of my machine, not the local subnet
, David York [EMAIL PROTECTED] wrote:
Does anybody know how to find the real IP address (e.g.: address
visible to internet) of a machine via Python? In other words I have a
machine with an IP address something like 192.168.1.5, an address given
to me by a router. The router's address (and thus my
Hai,
I am working with python 2.4. I am new to python, I need to
collect all the ipaddress of the systems connected in the network for my
project.
While browsing I come accross Ur link. I think U peoples can help
me. Can U please send me the code and guide me to get it. I am
hai everybody,
I am working in python 2.4. I am in need to get the ip
address of all the devices connected in the network. Is its possible in
python, can anyone help me please. If its possible, can U give me the code.
Mani.
--
http://mail.python.org/mailman/listinfo/python
socket.gethostbyname, but this relies on what's in
/etc/hosts, and I'd rather have a more independent solution.
I might be missing something in your question, but on a Windows XP
machine, I can get the IP address of my machine using:
from socket import gethostname, gethostbyname
gethostbyname(gethostname
On Sat, 24 Nov 2007 00:05:13 +, Steven D'Aprano wrote:
... you're absolutely write ...
Okay, I now officially have no more credibility left. Time for me to get
a Hotmail email address and open a MySpace page and spend all my time
writing OMG LOL LOL LOL did u c teh thing on Ausrtalia Idle
On Nov 21, 9:15 am, Gilles Ganault [EMAIL PROTECTED] wrote:
Hello
I need to get the local computer's IP address, ie. what's displayed
when running ifconfig in Linux:
# ifconfig
eth0 Link encap:Ethernet HWaddr 00:15:58:A1:D5:6F
inet addr:192.168.0.79 Bcast:192.168.0.255
On Fri, 23 Nov 2007 15:58:06 -0800, Dennis Lee Bieber wrote:
On Fri, 23 Nov 2007 22:56:41 -, Steven D'Aprano
[EMAIL PROTECTED] declaimed the following in
comp.lang.python:
I'm not surprised. Windows XP usually stores the hosts file here:
C:\system32\drivers\etc\hosts
Steven D'Aprano ste..HIS-cybersource.com.au wrote:
On Sat, 24 Nov 2007 00:05:13 +, Steven D'Aprano wrote:
... you're absolutely write ...
Okay, I now officially have no more credibility left. Time for me to get
a Hotmail email address and open a MySpace page and spend all my time
have a more independent solution.
I might be missing something in your question, but on a Windows XP
machine, I can get the IP address of my machine using:
from socket import gethostname, gethostbyname
gethostbyname(gethostname())
'192.168.0.11'
Just out of curiosity, what part
Gilles Ganault [EMAIL PROTECTED] writes:
I need to get the local computer's IP address, ie. what's displayed
when running ifconfig in Linux:
# ifconfig
eth0 Link encap:Ethernet HWaddr 00:15:58:A1:D5:6F
inet addr:192.168.0.79 Bcast:192.168.0.255
Mask:255.255.255.0
I
Hello
I need to get the local computer's IP address, ie. what's displayed
when running ifconfig in Linux:
# ifconfig
eth0 Link encap:Ethernet HWaddr 00:15:58:A1:D5:6F
inet addr:192.168.0.79 Bcast:192.168.0.255
Mask:255.255.255.0
I know about socket.gethostbyname
On Nov 21, 9:15 am, Gilles Ganault [EMAIL PROTECTED] wrote:
Hello
I need to get the local computer's IP address, ie. what's displayed
when running ifconfig in Linux:
# ifconfig
eth0 Link encap:Ethernet HWaddr 00:15:58:A1:D5:6F
inet addr:192.168.0.79 Bcast:192.168.0.255
On Wed, 21 Nov 2007 07:20:45 -0800 (PST), Paul McGuire
[EMAIL PROTECTED] wrote:
Be aware that it is very possible to have multiple IP addresses from
which to choose
Yup, but this is the local host, and it only has a single interface.
Should I look into os.environ() or something like that?
--
On Nov 21, 2007 10:15 AM, Gilles Ganault [EMAIL PROTECTED] wrote:
I know about socket.gethostbyname, but this relies on what's in
/etc/hosts, and I'd rather have a more independent solution.
I might be missing something in your question, but on a Windows XP
machine, I can get the IP address
On Wed, 21 Nov 2007 16:15:43 +0100, Gilles Ganault [EMAIL PROTECTED] wrote:
Hello
I need to get the local computer's IP address, ie. what's displayed
when running ifconfig in Linux:
# ifconfig
eth0 Link encap:Ethernet HWaddr 00:15:58:A1:D5:6F
inet addr:192.168.0.79 Bcast
around and around on
this, and ended up with that being the best solution. For us, anyway.
Your mileage may vary.
As others have pointed out, it's entirely possible to have multiple IP
addresses. In addition, your IP address(es) can change as connections come
up and down, especially
What would be a good way to do this?
using 'netifaces'?
see http://pypi.python.org/pypi/netifaces/0.3
--
http://mail.python.org/mailman/listinfo/python-list
, but on a Windows XP
machine, I can get the IP address of my machine using:
from socket import gethostname, gethostbyname
gethostbyname(gethostname())
'192.168.0.11'
Just out of curiosity, what part of the Original Poster's comment that he
already knew about socket.gethostbyname did you
Why aren't these spammers having their IP addresses blocked (or something
like that)? People making these posts should not be allowed to post ever
again. Is there not someone administering this mailing list?
I agree!
On Nov 13, 2007 1:26 PM, Martin Marcher [EMAIL PROTECTED] wrote:
Peter J. Bismuti [EMAIL PROTECTED] writes:
Why aren't these spammers having their IP addresses blocked (or
something like that)? People making these posts should not be
allowed to post ever again. Is there not someone administering this
mailing list?
This mailing list is actually a mail
Hello,
I have a network on same subnet. I have an ip address of a machine.
but i need to get its MAC Adress.
Sendingf ARP request is the way i am taking.
IS there any other way to get this MAC Adress in python.??
Also does python go down to level 2 of TCP/IP model??
Sorry if i am to naive
On Oct 30, 1:57 pm, [EMAIL PROTECTED] wrote:
Hello,
I have a network on same subnet. I have an ip address of a machine.
but i need to get its MAC Adress.
Sendingf ARP request is the way i am taking.
IS there any other way to get this MAC Adress in python.??
Also does python go down
[EMAIL PROTECTED] wrote:
Hello,
I have a network on same subnet. I have an ip address of a machine.
but i need to get its MAC Adress.
Sendingf ARP request is the way i am taking.
IS there any other way to get this MAC Adress in python.??
Also does python go down to level 2 of TCP/IP
is there software available to change or hide my ip add?
__
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com --
http://mail.python.org/mailman/listinfo/python-list
In article [EMAIL PROTECTED],
John Nagle [EMAIL PROTECTED] wrote:
The documentation for Python's CGI module doesn't seem to say how to get
the IP address of the client. Don't see an obvious way to get that info
from reading the source, either. Ideas
The documentation for Python's CGI module doesn't seem to say how to get
the IP address of the client. Don't see an obvious way to get that info
from reading the source, either. Ideas?
John Nagle
--
http://mail.python.org/mailman/listinfo/python-list
On Apr 11, 12:22 pm, John Nagle [EMAIL PROTECTED] wrote:
The documentation for Python's CGI module doesn't seem to say how to get
the IP address of the client. Don't see an obvious way to get that info
from reading the source, either. Ideas?
John
On Mon, 05 Mar 2007 09:02:44 +, Duncan Booth wrote:
Try running it interactively and looking at the data you receive:
conn = HTTPConnection('xml.showmyip.com')
conn.request('GET', '/')
resp = conn.getresponse()
print resp
httplib.HTTPResponse instance at 0x00C58350
data =
Steven D'Aprano [EMAIL PROTECTED] wrote:
I have a PC behind a firewall, and I'm trying to programmatically
determine the IP address visible from outside the firewall.
[ ... ]
Can anyone help me fix that code snippet, or suggest another (better) way
to get the externally visible IP address
I have a PC behind a firewall, and I'm trying to programmatically
determine the IP address visible from outside the firewall.
Steven
Following is another alternative that might at least
be worth consideration
I use the lynx command shown as a command-line alias
no parsing is necessary
Best,
Sergio
On 3/6/07, Cousin Stanley [EMAIL PROTECTED] wrote:
I have a PC behind a firewall, and I'm trying to programmatically
determine the IP address visible from outside the firewall.
Steven
Following is another alternative that might at least
On Tue, 06 Mar 2007 14:40:37 -0500, Sergio Correia wrote:
The above suggestions seem nice, but I find this one easier:
[snip]
Thanks to everybody who replied, that's great.
--
Steven.
--
http://mail.python.org/mailman/listinfo/python-list
I have a PC behind a firewall, and I'm trying to programmatically
determine the IP address visible from outside the firewall.
If I do this:
import socket
socket.gethostbyname(socket.gethostname())
'127.0.0.1'
socket.gethostbyname_ex(socket.gethostname())
('localhost.localdomain', ['localhost
fix that code snippet, or suggest another (better)
way
to get the externally visible IP address?
Try running it interactively and looking at the data you receive:
conn = HTTPConnection('xml.showmyip.com')
conn.request('GET', '/')
resp = conn.getresponse()
print resp
httplib.HTTPResponse
Duncan Booth [EMAIL PROTECTED] writes:
If you try connecting to 'www.showmyip.com' and requesting '/xml/' it
should work.
If the firewall is really obnoxious, it can bounce consecutive queries
around between multiple originating IP addresses. That is uncommon
but it's been done from time to
Paul Rubin http://[EMAIL PROTECTED] wrote:
Duncan Booth [EMAIL PROTECTED] writes:
If you try connecting to 'www.showmyip.com' and requesting '/xml/' it
should work.
If the firewall is really obnoxious, it can bounce consecutive queries
around between multiple originating IP addresses.
Beej skrev:
On Jan 28, 2:26 am, Klaus Alexander Seistrup [EMAIL PROTECTED] wrote:
Scripter47 wrote:
How do i get my ip address?
in cmd.exe i just type ipconfig then it prints:
...
IP-address . . . . . . . . . . . . . . . . . : 192.168.1.10
...
how can i do that in python
Toby A Inkster wrote:
Steve Holden wrote:
There is absolutely no need to know the IP address of your router to
communicate with Internet devices. Either your IP layer is configured to
know the addresses of one or more routers, or it has discovered those
address by dynamic means, or you
How do i get my ip address?
in cmd.exe i just type ipconfig then it prints:
...
IP-address . . . . . . . . . . . . . . . . . : 192.168.1.10
...
how can i do that in python??
--
http://mail.python.org/mailman/listinfo/python-list
Scripter47 wrote:
How do i get my ip address?
in cmd.exe i just type ipconfig then it prints:
...
IP-address . . . . . . . . . . . . . . . . . : 192.168.1.10
...
how can i do that in python??
#v+
python -c 'import re, urllib; print re.findall(titleYour IP: (.+?)/title
Klaus Alexander Seistrup skrev:
Scripter47 wrote:
How do i get my ip address?
in cmd.exe i just type ipconfig then it prints:
...
IP-address . . . . . . . . . . . . . . . . . : 192.168.1.10
...
how can i do that in python??
#v+
python -c 'import re, urllib; print
Scripter47 wrote:
python -c 'import re, urllib; print re.findall(titleYour IP:
(.+?)/title, urllib.urlopen(http://myip.dk/;).read())[0]'
Hmm then you need Internet connecting.
That's what IP adresses are for...
can i do it without that?
Perhaps you could use the method mentioned in
Hey,
This will get your IP address:
###Code
print socket.gethostbyaddr(socket.gethostname())
('compname', [], ['192.168.1.2'])
End Code
If you are wanting to to communicate over the internet you will have
to get the IP of you rounter. So you will have to either find
Klaus Alexander Seistrup wrote:
Scripter47 wrote:
How do i get my ip address?
in cmd.exe i just type ipconfig then it prints:
...
IP-address . . . . . . . . . . . . . . . . . : 192.168.1.10
...
how can i do that in python??
#v+
python -c 'import re, urllib; print
Adam wrote:
This will get your IP address:
###Code
print socket.gethostbyaddr(socket.gethostname())
('compname', [], ['192.168.1.2'])
End Code
It will return an IP address, but not necessarily the one you want:
#v+
[EMAIL PROTECTED]:~ $ python -c 'import
Colin J. Williams wrote:
Your one-liner doesn't work for me, with Windows XP, but the
following does, within Python.
Could it be due to shell-escaping issues? I don't know anything
about Windows...
Cheers,
--
Klaus Alexander Seistrup
http://klaus.seistrup.dk/
--
Adam wrote:
Hey,
This will get your IP address:
###Code
print socket.gethostbyaddr(socket.gethostname())
('compname', [], ['192.168.1.2'])
End Code
If you are wanting to to communicate over the internet you will have
to get the IP of you rounter. So you
Steve Holden wrote:
There is absolutely no need to know the IP address of your router to
communicate with Internet devices. Either your IP layer is configured to
know the addresses of one or more routers, or it has discovered those
address by dynamic means, or you can't get off-net because
Scripter47 wrote:
How do i get my ip address?
Which IP address. One computer might have many IP addresses. (Indeed a
typical network-connected computer will tend to have at least one for each
connected network device, plus the special address 127.0.0.1 for the
loopback network.) How is Python
At Sunday 28/1/2007 10:28, Colin J. Williams wrote:
Klaus Alexander Seistrup wrote:
python -c 'import re, urllib; print re.findall(titleYour IP:
(.+?)/title, urllib.urlopen(http://myip.dk/;).read())[0]'
Your one-liner doesn't work for me, with Windows XP, but the following
On XP you
Klaus Alexander Seistrup wrote:
urllib.urlopen(http://myip.dk/;)
http://whatismyip.org gives it to you in a more usable format. But, as
others have pointed out, it might return your router's IP.
--
Garry Knight
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
On Jan 28, 2:26 am, Klaus Alexander Seistrup [EMAIL PROTECTED] wrote:
Scripter47 wrote:
How do i get my ip address?
in cmd.exe i just type ipconfig then it prints:
...
IP-address . . . . . . . . . . . . . . . . . : 192.168.1.10
...
how can i do that in python??#v
Scripter47 wrote:
How do i get my ip address?
in cmd.exe i just type ipconfig then it prints:
...
IP-address . . . . . . . . . . . . . . . . . : 192.168.1.10
...
how can i do that in python??
If you want to get your external IP you can do:
import urllib
checkIP
How can I find server's IP address?
From console I can use ping, for example:
C:\RobotP\cgi-binping www.google.com
Pinging www.google.com [209.85.129.147] with 32 bytes of data:
Reply from 209.85.129.147: bytes=32 time=30ms TTL=244
Reply from 209.85.129.147: bytes=32 time=30ms TTL=244
..
..
So
201 - 300 of 376 matches
Mail list logo