From: Νίκος on 1 Aug 2010 12:56 Hello fellow Python Coders! I don't see the error in my attempt to set a a cookie in this test script. Can you help please?! Thank you! [code] #!/usr/bin/python # -*- coding: utf-8 -*- import Cookie print ( "Content-type: text/html\n" ) cookie = Cookie.SimpleCookie() if cookie.has_key('visitor') == "nikos" #if visitor cookie exist print ( "Äåí óå åéäá, äåí óå îåñù, äåí óå áêïõóá. Èá åéóáé ï áïñáóôïò åðéóêåðôçò!!" ) cookie['visitor'] = ( 'nikos', time() - 1 ) #this cookie will expire now else print ( "Áðï äù êáé óôï åîçò äåí èá áõîáíù ôïí ìåôñçôç äéêç óïõ åðéóêåøç!!" ) cookie['visitor'] = ( 'nikos', time() + 60*60*24*365 ) #this cookie will expire in an year [/code]
From: Steven D'Aprano on 1 Aug 2010 20:52 On Sun, 01 Aug 2010 09:56:48 -0700, Νίκος wrote: > Hello fellow Python Coders! > > I don't see the error in my attempt to set a a cookie in this test > script. Neither do I. What makes you think there is an error? What sort of error? Do you get a core dump, an exception, or something else? Please report what you get, and what you expect, and how they are different. -- Steven
From: Νίκος on 1 Aug 2010 22:16 >On 2 ÎÏγ, 03:52, Steven D'Aprano <steve-REMOVE-T...(a)cybersource.com.au> wrote: > Neither do I. What makes you think there is an error? What sort of error? > Do you get a core dump, an exception, or something else? > > Please report what you get, and what you expect, and how they are > different. Hello Steven, Here is the script when it tries to run from my remote web server: http://www.webville.gr/cgi-bin/koukos.py Its seems the error is in this line of code, somwthing with time. 19 cookie['visitor'] = ( 'nikos', time() + 60*60*24*365 ) #this cookie will expire in an year
From: Νίκος on 1 Aug 2010 22:20 Also my greek print appear in funny encoding although i do use # -*- coding: utf-8 -*-
From: MRAB on 1 Aug 2010 22:49 Νίκος wrote: > Also my greek print appear in funny encoding although i do use # -*- > coding: utf-8 -*- That line just tells Python what encoding the source file itself uses. It doesn't affect what the program does or how it runs.
|
Next
|
Last
Pages: 1 2 3 4 5 6 7 Prev: Google job leads Next: exception handling with sqlite db errors |