Re: Trying to set a cookie within a python script

2010-08-04 Thread donn
On 04/08/2010 20:09, Dotan Cohen wrote: Don't forget that the Euro symbol is outside the Greek character set. I could make some kind of economic joke here, but I'm also broke :D \d -- http://mail.python.org/mailman/listinfo/python-list

Re: Trying to set a cookie within a python script

2010-08-04 Thread Dotan Cohen
On Wed, Aug 4, 2010 at 18:30, Dave Angel wrote: > Depends on how sure you are that your program will never need characters > outside your greek character set. Remember Y2K? > Don't forget that the Euro symbol is outside the Greek character set. -- Dotan Cohen http://gibberish.co.il http://what

Re: Trying to set a cookie within a python script

2010-08-04 Thread Dave Angel
¯º¿Â wrote: On 3 Αύγ, 21:00, Dave Angel wrote: A string is an object containing characters. A string literal is one of the ways you create such an object. When you create it that way, you need to make sure the compiler knows the correct encoding, by using the encoding: line at begi

Re: Trying to set a cookie within a python script

2010-08-04 Thread Steven D'Aprano
On Tue, 03 Aug 2010 20:08:46 -0700, Νίκος wrote: > i tried in IDLE enviroment as well and for some reason even with a > single number isnated of time() function the cookie is never set, > because the print of > print os.environ.get('HTTP_COOKIE') > > result to > > None What happens if you

Re: Trying to set a cookie within a python script

2010-08-04 Thread Dotan Cohen
2010/8/4 Νίκος : > Encodings still give me headaches. I try to understand them as > different ways to store data in a media. > > Tell me something. What encoding should i pick for my scripts knowing > that only contain english + greek chars?? > iso-8859-7 or utf-8 and why? > Always use UTF-8, ever

Re: Trying to set a cookie within a python script

2010-08-03 Thread Νίκος
For the cookie problem iam tryign houts now and even this aint working: cookie = Cookie.SimpleCookie() if os.environ.get('HTTP_COOKIE') and cookie.has_key('visitor') == 'nikos':#if visitor cookie exist print "Cookie Unset" c

Re: Trying to set a cookie within a python script

2010-08-03 Thread MRAB
Νίκος wrote: On 3 Αύγ, 21:00, Dave Angel wrote: A string is an object containing characters. A string literal is one of the ways you create such an object. When you create it that way, you need to make sure the compiler knows the correct encoding, by using the encoding: line at beginning of f

Re: Trying to set a cookie within a python script

2010-08-03 Thread Benjamin Kaplan
2010/8/3 Νίκος : >>On 3 Αύγ, 21:00, Dave Angel wrote: > >> A string is an object containing characters. A string literal is one of >> the ways you create such an object. When you create it that way, you >> need to make sure the compiler knows the correct encoding, by using the >> encoding: line at

Re: Trying to set a cookie within a python script

2010-08-03 Thread Νίκος
>On 3 Αύγ, 21:00, Dave Angel wrote: > A string is an object containing characters. A string literal is one of > the ways you create such an object. When you create it that way, you > need to make sure the compiler knows the correct encoding, by using the > encoding: line at beginning of file. m

Re: Trying to set a cookie within a python script

2010-08-03 Thread Dave Angel
MRAB wrote: Dave Angel wrote: ¯º¿Â wrote: On 3 Αύγ, 18:41, Dave Angel wrote: Different encodings equal different ways of storing the data to the media, correct? Exactly. The file is a stream of bytes, and Unicode has more than 256 possible characters. Further, even the subset of character

Re: Trying to set a cookie within a python script

2010-08-03 Thread MRAB
Dave Angel wrote: ¯º¿Â wrote: On 3 Αύγ, 18:41, Dave Angel wrote: Different encodings equal different ways of storing the data to the media, correct? Exactly. The file is a stream of bytes, and Unicode has more than 256 possible characters. Further, even the subset of characters th

Re: Trying to set a cookie within a python script

2010-08-03 Thread Dotan Cohen
On Tue, Aug 3, 2010 at 18:41, Dave Angel wrote: > I don't understand your wording. Certainly the server launches the python > script, and captures stdout. It then sends that stream of bytes out over > tcp/ip to the waiting browser. You ask when does it become html ? I don't > think the question ha

Re: Trying to set a cookie within a python script

2010-08-03 Thread Dave Angel
¯º¿Â wrote: On 3 Αύγ, 18:41, Dave Angel wrote: Different encodings equal different ways of storing the data to the media, correct? Exactly. The file is a stream of bytes, and Unicode has more than 256 possible characters. Further, even the subset of characters that *do* take one b

Re: Trying to set a cookie within a python script

2010-08-03 Thread Νίκος
>On 3 Αύγ, 18:41, Dave Angel wrote: > > Different encodings equal different ways of storing the data to the > > media, correct? > > Exactly. The file is a stream of bytes, and Unicode has more than 256 > possible characters. Further, even the subset of characters that *do* > take one byte are diff

Re: Trying to set a cookie within a python script

2010-08-03 Thread Dave Angel
¯º¿Â wrote: On 3 Αύγ, 11:10, Dave Angel wrote: a) a text editor takes keystrokes and cut/paste info and other data, and produces a stream of (unicode) characters. It then encodes each of those character into one or more bytes and saves it to a file. You have to tell Notepad++ ho

Re: Trying to set a cookie within a python script

2010-08-03 Thread Νίκος
> On 3 Αύγ, 11:10, Dave Angel wrote: > a) a text editor takes keystrokes and cut/paste info and other data, and > produces a stream of (unicode) characters.  It then encodes each of   > those character into one or more bytes and saves it to a file.  You have > to tell Notepad++ how to do that enc

Re: Trying to set a cookie within a python script

2010-08-03 Thread Nik Gr
Στις 3/8/2010 10:39 πμ, ο/η Chris Rebert έγραψε: Please tell me the difference between 3 things. a) Asking Notepad++(my editor) to save all my python scripts as UTF-8 without BOM. That affects what encoding the text file comprising the source code itself is in. What does this practically mea

Re: Trying to set a cookie within a python script

2010-08-03 Thread Dave Angel
� wrote: On 2 Αύγ, 23:57, Thomas Jollans wrote: So: tripple-check that * your file is * Python knows that * the web browser knows that Thank you! i used print ''' Content-Type: text/html; charset=F-8 / n''' and it worked. I'am still pretty c

Re: Trying to set a cookie within a python script

2010-08-03 Thread Chris Rebert
2010/8/2 Νίκος : >>On 2 Αύγ, 23:57, Thomas Jollans wrote: > >> So: tripple-check that >> >>  * your file is >>  * Python knows that >>  * the web browser knows that > > Thank you! i used print ''' Content-Type: text/html; charset=UTF-8 / > n''' and it worked. > I'am still pretty confused about th

Re: Trying to set a cookie within a python script

2010-08-02 Thread Νίκος
>On 2 Αύγ, 23:57, Thomas Jollans wrote: > So: tripple-check that > >  * your file is >  * Python knows that >  * the web browser knows that Thank you! i used print ''' Content-Type: text/html; charset=UTF-8 / n''' and it worked. I'am still pretty confused about the encodings. Please tell me th

Re: Trying to set a cookie within a python script

2010-08-02 Thread Thomas Jollans
On 08/02/2010 10:13 PM, Νίκος wrote: > Hello, any ideas?! That's no way to treat a friendly volunteer mailing list like this one! On 08/02/2010 02:32 PM, Νίκος wrote: > As for the encoding Notepad++, which is what i use for an editor say > its UTF-8 without BOM. > > Isn't this what i'm supposed

Re: Trying to set a cookie within a python script

2010-08-02 Thread Thomas Jollans
On 08/02/2010 04:20 AM, Νίκος wrote: > Also my greek print appear in funny encoding although i do use # -*- > coding: utf-8 -*- That's because you never told the web browser which encoding you're using. Content-Type: text/html; charset=UTF-8 -- http://mail.python.org/mailman/listinfo/python-list

Re: Trying to set a cookie within a python script

2010-08-02 Thread Νίκος
Hello, any ideas?! -- http://mail.python.org/mailman/listinfo/python-list

Re: Trying to set a cookie within a python script

2010-08-02 Thread Νίκος
Steven, First of all thank you for your response. I cant beleive i neglected to import the time module! The only reason that i asked you guys to follow the link was for you to see the actualt coding and error report as python produces it by itself with all the relative characteristics. Of course

Re: Trying to set a cookie within a python script

2010-08-02 Thread Steven D'Aprano
On Sun, 01 Aug 2010 23:39:34 -0700, Νίκος wrote: > If you just click in my web page to see the script run in action due to > the cgitb module i use it will provide you both the source code that the > error appears and the error as well. > > All you have to do is click here: > http://www.webville.

Re: Trying to set a cookie within a python script

2010-08-01 Thread Νίκος
If you just click in my web page to see the script run in action due to the cgitb module i use it will provide you both the source code that the error appears and the error as well. All you have to do is click here: http://www.webville.gr/cgi-bin/koukos.py As for the encoding why when i print gre

Re: Trying to set a cookie within a python script

2010-08-01 Thread Steven D'Aprano
On Sun, 01 Aug 2010 19:16:29 -0700, Νίκος wrote: >>On 2 Αύγ, 03:52, Steven D'Aprano >>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 t

Re: Trying to set a cookie within a python script

2010-08-01 Thread MRAB
Νίκος 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. -- http://mail.python.org/mailman/listinfo/python-list

Re: Trying to set a cookie within a python script

2010-08-01 Thread Νίκος
Also my greek print appear in funny encoding although i do use # -*- coding: utf-8 -*- -- http://mail.python.org/mailman/listinfo/python-list

Re: Trying to set a cookie within a python script

2010-08-01 Thread Νίκος
>On 2 Αύγ, 03:52, Steven D'Aprano 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 whe

Re: Trying to set a cookie within a python script

2010-08-01 Thread Steven D'Aprano
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? Pl