Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!news-out.readnews.com!transit4.readnews.com!panix!gordon From: John Gordon Newsgroups: comp.lang.python Subject: Re: Referrer key missing form os.environ dictionary? Date: Wed, 25 Sep 2013 14:30:59 +0000 (UTC) Organization: PANIX Public Access Internet and UNIX, NYC Lines: 26 Message-ID: References: NNTP-Posting-Host: panix2.panix.com X-Trace: reader1.panix.com 1380119459 29658 166.84.1.2 (25 Sep 2013 14:30:59 GMT) X-Complaints-To: abuse@panix.com NNTP-Posting-Date: Wed, 25 Sep 2013 14:30:59 +0000 (UTC) User-Agent: nn/6.7.3 Xref: csiph.com comp.lang.python:54737 In =?UTF-8?B?zp3Or866zr/Pgg==?= writes: > But one other problem appeared too: > nikos@superhost.gr [~/www/cgi-bin]# python metrites.py > File "metrites.py", line 27 > host = socket.gethostbyaddr( os.environ['REMOTE_ADDR'] )[0] or > 'UnKnown Host' > ^ > SyntaxError: invalid syntax > i dont see anything wrong with that line, and the carret is actually > pointing to the "host". Your post has the code broken up into two separate lines. Is that how the code actually appears? If so, then that's the problem. You can't arbitrarily break a statement into separate lines. If not, then you'll have to post more of the code; the problem isn't on this line. -- John Gordon A is for Amy, who fell down the stairs gordon@panix.com B is for Basil, assaulted by bears -- Edward Gorey, "The Gashlycrumb Tinies"