Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #28968
| Received | by 10.224.42.68 with SMTP id r4mr9550954qae.4.1347459889302; Wed, 12 Sep 2012 07:24:49 -0700 (PDT) |
|---|---|
| Received | by 10.52.92.207 with SMTP id co15mr2362843vdb.9.1347459888459; Wed, 12 Sep 2012 07:24:48 -0700 (PDT) |
| Path | csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!npeer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!v8no3373649qap.0!news-out.google.com!da15ni3445qab.0!nntp.google.com!v8no2109479qap.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail |
| Newsgroups | comp.lang.python |
| Date | Wed, 12 Sep 2012 07:24:46 -0700 (PDT) |
| Complaints-To | groups-abuse@google.com |
| Injection-Info | glegroupsg2000goo.googlegroups.com; posting-host=85.65.169.174; posting-account=_vepBgoAAAD3Jx-8VUeoi33AOFj3T9H8 |
| NNTP-Posting-Host | 85.65.169.174 |
| User-Agent | G2/1.0 |
| MIME-Version | 1.0 |
| Message-ID | <e4e100d1-bdf9-45d0-a137-615b1e820cfb@googlegroups.com> (permalink) |
| Subject | using text file to get ip address from hostname |
| From | dkatorza@gmail.com |
| Injection-Date | Wed, 12 Sep 2012 14:24:49 +0000 |
| Content-Type | text/plain; charset=ISO-8859-1 |
| X-Received-Bytes | 1571 |
| Xref | csiph.com comp.lang.python:28968 |
Show key headers only | View raw
hello , i'm new to Python and i searched the web and could not find an answer for my issue. i need to get an ip address from list of hostnames which are in a textfile. this is what i have so far -------------------------------------------------------------------------- #!/usr/bin/env python #Get the IP Address import socket hostname = 'need it to read from a text file' addr = socket.gethostbyname(hostname) print 'The address of ', hostname, 'is', addr --------------------------------------------------------------------------- any idea ? sorry for my english thanks.
Back to comp.lang.python | Previous | Next — Next in thread | Find similar | Unroll thread
using text file to get ip address from hostname dkatorza@gmail.com - 2012-09-12 07:24 -0700
Re: using text file to get ip address from hostname Chris Angelico <rosuav@gmail.com> - 2012-09-13 00:35 +1000
Re: using text file to get ip address from hostname dkatorza@gmail.com - 2012-09-12 07:41 -0700
Re: using text file to get ip address from hostname Alister <alister.ware@ntlworld.com> - 2012-09-12 17:51 +0000
Re: using text file to get ip address from hostname Terry Reedy <tjreedy@udel.edu> - 2012-09-12 17:04 -0400
Re: using text file to get ip address from hostname Jason Friedman <jason@powerpull.net> - 2012-09-12 21:12 -0600
Re: using text file to get ip address from hostname Dan Katorza <dkatorza@gmail.com> - 2012-09-15 09:20 -0700
Re: using text file to get ip address from hostname Hans Mulder <hansmu@xs4all.nl> - 2012-09-15 20:52 +0200
Re: using text file to get ip address from hostname Thomas Rachel <nutznetz-0c1b6768-bfa9-48d5-a470-7603bd3aa915@spamschutz.glglgl.de> - 2012-09-17 22:37 +0200
Re: using text file to get ip address from hostname Dan Katorza <dkatorza@gmail.com> - 2012-09-15 15:43 -0700
Re: using text file to get ip address from hostname Dan Katorza <dkatorza@gmail.com> - 2012-09-19 00:41 -0700
Re: using text file to get ip address from hostname Chris Angelico <rosuav@gmail.com> - 2012-09-19 18:14 +1000
Re: using text file to get ip address from hostname Dan Katorza <dkatorza@gmail.com> - 2012-09-19 01:50 -0700
Re: using text file to get ip address from hostname Chris Angelico <rosuav@gmail.com> - 2012-09-19 18:59 +1000
Re: using text file to get ip address from hostname Dan Katorza <dkatorza@gmail.com> - 2012-09-19 01:50 -0700
Re: using text file to get ip address from hostname Dan Katorza <dkatorza@gmail.com> - 2012-09-19 02:10 -0700
Re: using text file to get ip address from hostname Dan Katorza <dkatorza@gmail.com> - 2012-09-19 02:10 -0700
Re: using text file to get ip address from hostname Dan Katorza <dkatorza@gmail.com> - 2012-09-19 05:28 -0700
Re: using text file to get ip address from hostname Dave Angel <d@davea.name> - 2012-09-19 14:22 -0400
Re: using text file to get ip address from hostname Dan Katorza <dkatorza@gmail.com> - 2012-09-19 05:28 -0700
Re: using text file to get ip address from hostname Dan Katorza <dkatorza@gmail.com> - 2012-09-19 22:13 -0700
Re: using text file to get ip address from hostname Dan Katorza <dkatorza@gmail.com> - 2012-09-19 22:13 -0700
csiph-web