Think of it as saving file 'hello.txt' in /usr/bin/some_random_folder
_you_made
Then in the terminal, you try to open the file by typing 'gedit hello.txt'. It has no idea where to look.
[I'm a noob too, so if I got it wrong don't flame me too bad ;) ]
Then in the terminal, you try to open the file by typing 'gedit hello.txt'. It has no idea where to look.
[I'm a noob too, so if I got it wrong don't flame me too bad ;) ]
On 9/17/06, Alan Gauld <[EMAIL PROTECTED]
> wrote:
> When i try this it works
>
> #!/usr/bin/python
>
> import Cookie
> C = Cookie.SimpleCookie()
> C['adminuser'] = 'fedekiller'
> C['adminuser']['max-age'] = 60*60*24*7
> print C
> print "Content-Type: text/html\n\n"
> print "Bienvenido",C['adminuser'].value,'!'
>
>
> but when i try this it doesnt
Can you explain why you think it should work?
What do yopu think it is doing?
The code below is very obviously completely different to
the code above, so what makes you think it should work?
> #!/usr/bin/python
>
> import Cookie
> print "Content-Type: text/html\n\n"
> print "Bienvenido",C['adminuser'].value,'!'
What is C? Where is it defined?
> i know the cookie exists because firefox display it where
> all the cookies of that domains are.
Cookies exist as small files on your PC. A Python program
needs to be given a clue as to which cookie you are interested
in so that it can access that file. That's what the Cookie module
helps you to do, but it needs to be more than simply imported.
That just makes the tools available, it doesn't actually turn
them on.
HTH,
Alan G.
_______________________________________________
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
--
-Ivan
_______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor