On Wed, 15 Aug 2007 10:42:02 -0700, mfglinux wrote:

> I would like to know how to declare in python a "variable name" that
> it is in turn a variable
> In bash shell I would wrote sthg like:
> 
> for x in `seq 1 3`
> do
>   M$i=Material(x)  #Material is a python class
> done

You want a dictionary.

M = dict()
for x in xrange(1, 4):
    M[x] = Material(x)

Ciao,
        Marc 'BlackJack' Rintsch
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to