Trying to set a cookie within a python script

Steven D'Aprano steve-REMOVE-THIS at
Mon Aug 2 11:44:35 CEST 2010

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:

I'll do this just once, but next time, don't expect others to track down 
the error message for you. We're volunteers, we don't owe you anything, 
so if you want us to help, you make it easy for us. Some people have 
access to email, but not web. If you can't be bothered to copy and paste 
the error message into an email or news post, why should we be bothered 
to help you?

The error you are getting is:

NameError: name 'time' is not defined 

That tells you that you don't have a function called time() defined 
anywhere. You need to import the time module first:

import time

and then use the fully qualified function name time.time(), or do:

from time import time

and then use the function alone time().

> As for the encoding why when i print greek characters they dont appear
> correctly in chrome in runtime?

What encoding does the web page claim to be?

You need to check the document encoding, and see that it matches the 
document encoding you are actually using.


More information about the Python-list mailing list