Global array in python

Jean-Michel Pichavant jeanmichel at sequans.com
Tue Sep 29 05:24:05 EDT 2009


Rudolf wrote:
> How can i declare a global array in python?
>   
import __builtin__
__builtin__.myList = []

Now you can use myList everywhere in your code.

Note that modifying __builtin__ is **not** recommended at all. I don't 
have time to detail that point, google it if you want the answer. I 
warned you :o)

JM



More information about the Python-list mailing list