On 7 Αύγ, 22:52, Thomas Jollans wrote:
> On 08/07/2010 09:36 PM, Νίκος wrote:
>
> > cookie.has_key('visitor') != 'nikos'
>
> This is always True. has_key returns a bool, which is never equal to any
> string, even 'nikos'.
if cookie.has_key('visitor') or re.search('cyta', host) is None:
adresses
Thomas Jollans wrote:
On 08/07/2010 09:36 PM, Νίκος wrote:
cookie.has_key('visitor') != 'nikos'
This is always True. has_key returns a bool, which is never equal to any
string, even 'nikos'.
I missed that bit! :-)
Anyway, the OP said "the 'stuff' never gets executed". Kinda puzzling...
--
h
On 08/07/2010 09:36 PM, Νίκος wrote:
> cookie.has_key('visitor') != 'nikos'
This is always True. has_key returns a bool, which is never equal to any
string, even 'nikos'.
--
http://mail.python.org/mailman/listinfo/python-list
On 7 Αύγ, 22:17, MRAB wrote:
> Νίκος wrote:
> > On 7 Αύγ, 21:24, MRAB wrote:
>
> >> Use group capture:
>
> >> found = re.match(r'', firstline).group(1)
> >> print(page_id)
>
> > Worked like a charm! Thanks a lot!
>
> > So match method here not only searched for the string representation
On 7 Αύγ, 22:07, MRAB wrote:
> re.search('cyta', host) will return None if there's no match, but you
> said "Yes it does contain it", so there _is_ a match, therefore:
>
> hostmatch is None
>
> is False.
The code block inside the if structure must be executes ONLY if the
'visitor' cookie is
Νίκος wrote:
On 7 Αύγ, 21:24, MRAB wrote:
Use group capture:
found = re.match(r'', firstline).group(1)
print(page_id)
Worked like a charm! Thanks a lot!
So match method here not only searched for the string representation
of the number but also convert it to integer as well?
r s
Νίκος wrote:
On 7 Αύγ, 21:27, MRAB wrote:
Νίκος wrote:
i also dont know what wrong with this line:
host = socket.gethostbyaddr( os.environ['REMOTE_ADDR'] )[0]
hostmatch = re.search('cyta', host)
if cookie.has_key('visitor') != 'nikos' or hostmatch is None:
# do stuff
the 'stuff' never get
On 08/07/2010 08:51 PM, Νίκος wrote:
> On 7 Αύγ, 21:24, MRAB wrote:
>
>> Use group capture:
>>
>> found = re.match(r'', firstline).group(1)
>> print(page_id)
>
> Worked like a charm! Thanks a lot!
>
> So match method here not only searched for the string representation
> of the number
On 7 Αύγ, 21:24, MRAB wrote:
> Use group capture:
>
> found = re.match(r'', firstline).group(1)
> print(page_id)
Worked like a charm! Thanks a lot!
So match method here not only searched for the string representation
of the number but also convert it to integer as well?
r stand for r
On 7 Αύγ, 21:27, MRAB wrote:
> Νίκος wrote:
> > i also dont know what wrong with this line:
>
> > host = socket.gethostbyaddr( os.environ['REMOTE_ADDR'] )[0]
>
> > hostmatch = re.search('cyta', host)
>
> > if cookie.has_key('visitor') != 'nikos' or hostmatch is None:
> > # do stuff
>
> > the
Νίκος wrote:
i also dont know what wrong with this line:
host = socket.gethostbyaddr( os.environ['REMOTE_ADDR'] )[0]
hostmatch = re.search('cyta', host)
if cookie.has_key('visitor') != 'nikos' or hostmatch is None:
# do stuff
the 'stuff' never gets executed, while i ant them to be as lon
Νίκος wrote:
Hello guys! Need your precious help again!
In every html file i have in the very first line a page_id fro counetr
countign purpsoes like in a format of a comment like this:
and so on. every html file has its one page_id
How can i grab that string representaion of a number from
i also dont know what wrong with this line:
host = socket.gethostbyaddr( os.environ['REMOTE_ADDR'] )[0]
hostmatch = re.search('cyta', host)
if cookie.has_key('visitor') != 'nikos' or hostmatch is None:
# do stuff
the 'stuff' never gets executed, while i ant them to be as long as i
dont hav
Hello guys! Need your precious help again!
In every html file i have in the very first line a page_id fro counetr
countign purpsoes like in a format of a comment like this:
and so on. every html file has its one page_id
How can i grab that string representaion of a number from inside
the .ht
14 matches
Mail list logo