Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #18713
| Path | csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <dbinks@codeaurora.org> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.164 |
| X-Spam-Level | * |
| X-Spam-Evidence | '*H*': 0.69; '*S*': 0.02; '[0]': 0.09; 'subject:error': 0.09; 'name)': 0.16; 'wrote:': 0.18; 'header:In- Reply-To:1': 0.22; 'code': 0.25; '(and': 0.28; 'received:199': 0.29; 'pm,': 0.29; 'host': 0.30; 'usually': 0.31; 'does': 0.32; 'list': 0.32; 'header:User-Agent:1': 0.33; 'to:addr:python-list': 0.34; 'explain': 0.36; 'skip:\xce 10': 0.38; 'skip:o 20': 0.38; 'being': 0.39; 'why': 0.39; 'to:addr:python.org': 0.40; 'address': 0.61; 'forum': 0.64; '8bit%:100': 0.69; 'subject:( ': 0.84; 'canonical': 0.91; 'subject:skip:s 20': 0.91 |
| X-IronPort-AV | E=McAfee;i="5400,1158,6584"; a="151244873" |
| Date | Mon, 09 Jan 2012 14:35:42 -0800 |
| From | Dominic Binks <dbinks@codeaurora.org> |
| User-Agent | Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0) Gecko/20111105 Thunderbird/8.0 |
| MIME-Version | 1.0 |
| To | python-list@python.org |
| Subject | Re: socket.gethostbyaddr( os.environ['REMOTE_ADDR'] error |
| References | <d3865134-491c-45ea-a033-a394e64701db@z19g2000vbe.googlegroups.com> <jdsjld$mau$1@r03.glglgl.gl> <bacea15d-fae0-4b1f-8a8e-a8b06b561fc0@t30g2000vbx.googlegroups.com> <roy-F4BA5C.13424802012012@news.panix.com> <24123dfe-b2fc-4f4c-8dfe-23bfef19b205@m10g2000vbc.googlegroups.com> <roy-4CE54B.15314102012012@news.panix.com> <f683b8f4-3a59-4c9f-94ef-82a9017dcd31@m20g2000vbf.googlegroups.com> |
| In-Reply-To | <f683b8f4-3a59-4c9f-94ef-82a9017dcd31@m20g2000vbf.googlegroups.com> |
| Content-Type | text/plain; charset=UTF-8; format=flowed |
| Content-Transfer-Encoding | 8bit |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.12 |
| Precedence | list |
| List-Id | General discussion list for the Python programming language <python-list.python.org> |
| List-Unsubscribe | <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe> |
| List-Archive | <http://mail.python.org/pipermail/python-list> |
| List-Post | <mailto:python-list@python.org> |
| List-Help | <mailto:python-list-request@python.org?subject=help> |
| List-Subscribe | <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.4552.1326148616.27778.python-list@python.org> (permalink) |
| Lines | 15 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1326148616 news.xs4all.nl 6853 [2001:888:2000:d::a6]:39870 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | x330-a1.tempe.blueboxinc.net comp.lang.python:18713 |
Show key headers only | View raw
On 1/9/2012 2:19 PM, Νικόλαος Κούρας wrote: > Can you please explain me what the [0] in host = > socket.gethostbyaddr( os.environ['REMOTE_ADDR'] )[0] does at the end? > > Why not just host = socket.gethostbyaddr( os.environ['REMOTE_ADDR'] ) > instead? what is the need of [0] ? The address database can have multiple names for the same IP address so gethostbyaddr returns a list - [0] being the first item in the list (and usually considered the canonical name) -- Dominic Binks: dbinks@codeaurora.org Employee of Qualcomm Innovation Center, Inc. Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Re: socket.gethostbyaddr( os.environ['REMOTE_ADDR'] error Thomas Rachel <nutznetz-0c1b6768-bfa9-48d5-a470-7603bd3aa915@spamschutz.glglgl.de> - 2012-01-02 16:49 +0100
Re: socket.gethostbyaddr( os.environ['REMOTE_ADDR'] error Νικόλαος Κούρας <nikos.kouras@gmail.com> - 2012-01-02 10:18 -0800
Re: socket.gethostbyaddr( os.environ['REMOTE_ADDR'] error Roy Smith <roy@panix.com> - 2012-01-02 13:42 -0500
Re: socket.gethostbyaddr( os.environ['REMOTE_ADDR'] error Νικόλαος Κούρας <nikos.kouras@gmail.com> - 2012-01-02 11:51 -0800
Re: socket.gethostbyaddr( os.environ['REMOTE_ADDR'] error Roy Smith <roy@panix.com> - 2012-01-02 15:31 -0500
Re: socket.gethostbyaddr( os.environ['REMOTE_ADDR'] error Νικόλαος Κούρας <nikos.kouras@gmail.com> - 2012-01-09 14:19 -0800
Re: socket.gethostbyaddr( os.environ['REMOTE_ADDR'] error Dominic Binks <dbinks@codeaurora.org> - 2012-01-09 14:35 -0800
Re: socket.gethostbyaddr( os.environ['REMOTE_ADDR'] error Νικόλαος Κούρας <nikos.kouras@gmail.com> - 2012-01-09 15:04 -0800
Re: socket.gethostbyaddr( os.environ['REMOTE_ADDR'] error Thomas Rachel <nutznetz-0c1b6768-bfa9-48d5-a470-7603bd3aa915@spamschutz.glglgl.de> - 2012-01-10 07:42 +0100
Re: socket.gethostbyaddr( os.environ['REMOTE_ADDR'] error Chris Angelico <rosuav@gmail.com> - 2012-01-10 18:29 +1100
Re: socket.gethostbyaddr( os.environ['REMOTE_ADDR'] error Chris Angelico <rosuav@gmail.com> - 2012-01-10 10:14 +1100
Re: socket.gethostbyaddr( os.environ['REMOTE_ADDR'] error Nick Dokos <nicholas.dokos@hp.com> - 2012-01-09 18:32 -0500
Re: socket.gethostbyaddr( os.environ['REMOTE_ADDR'] error Chris Angelico <rosuav@gmail.com> - 2012-01-10 13:08 +1100
Re: socket.gethostbyaddr( os.environ['REMOTE_ADDR'] error Νικόλαος Κούρας <nikos.kouras@gmail.com> - 2012-01-02 11:54 -0800
csiph-web