How to create a global variable?
Hi! I've a python script which creates a dictionnary each time it's called. This dictionnary is always the same. I would increase the performance if I could generate and cache the dictionnary once, then reuse it. I'm looking for a space like REQUEST.SESSION that is the same for each user of my website (other solutions are welcome). Do you know how to do that? Thank you.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 jerome prudent wrote:
Hi! I've a python script which creates a dictionnary each time it's called. This dictionnary is always the same. I would increase the performance if I could generate and cache the dictionnary once, then reuse it. I'm looking for a space like REQUEST.SESSION that is the same for each user of my website (other solutions are welcome).
Do you know how to do that? Thank you.
http://www.zope.org/Documentation/Books/ZopeBook/2_6Edition/ZopeServices.stx... Tres. - -- =================================================================== Tres Seaver +1 540-429-0999 tseaver@palladion.com Palladion Software "Excellence by Design" http://palladion.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.2 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFF3Y5Q+gerLs4ltQ4RAp1aAKDQovh4Kw6k8rDsuZSfXVGerzQadQCdGv5t xf7N1mTtG0CIU59Y193DXuw= =/rpy -----END PGP SIGNATURE-----
<snip> ----- Original Message ----- From: jerome prudent To: zope@zope.org Sent: Thursday, February 22, 2007 5:50 AM Subject: [Zope] How to create a global variable? Hi! I've a python script which creates a dictionnary each time it's called. This dictionnary is always the same. I would increase the performance if I could generate and cache the dictionnary once, then reuse it. I'm looking for a space like REQUEST.SESSION that is the same for each user of my website (other solutions are welcome). </snip> You could easily create a property field on a folder that contains the 'global' information. Any script or method that has access to that folder can access that property field. Jonathan _______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Ok, Thank you! 2007/2/22, Jonathan <dev101@magma.ca>:
<snip> ----- Original Message ----- From: jerome prudent To: zope@zope.org Sent: Thursday, February 22, 2007 5:50 AM Subject: [Zope] How to create a global variable? Hi! I've a python script which creates a dictionnary each time it's called. This dictionnary is always the same. I would increase the performance if I could generate and cache the dictionnary once, then reuse it. I'm looking for a space like REQUEST.SESSION that is the same for each user of my website (other solutions are welcome). </snip>
You could easily create a property field on a folder that contains the 'global' information. Any script or method that has access to that folder can access that property field.
Jonathan
_______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
On Thu, Feb 22, 2007 at 11:50:51AM +0100, jerome prudent wrote:
Hi! I've a python script which creates a dictionnary each time it's called. This dictionnary is always the same. I would increase the performance if I could generate and cache the dictionnary once, then reuse it. I'm looking for a space like REQUEST.SESSION that is the same for each user of my website (other solutions are welcome).
Do you know how to do that?
RAM Cache Manager. -- Paul Winkler http://www.slinkp.com
participants (4)
-
jerome prudent -
Jonathan -
Paul Winkler -
Tres Seaver