Hi, On Sat, Jun 23, 2012 at 9:48 PM, Michael Barton <[email protected]> wrote: > This is probably simple but I'm missing something somewhere. How can I > dynamically create variable names and then assign values to the variables? I > need to do something along the lines of: > > for i in flist: > 's%_new' % i = 10 > > where flist is a list of strings (e.g., file names) > >
You can find answer here: http://stackoverflow.com/questions/2320945/python-using-vars-to-assign-a-string-to-a-variable example of using function vars is in wxpython/gui_core/toolbars.py, line 130 Anna > Thanks > Michael > > _____________________ > C. Michael Barton > Visiting Scientist, Integrated Science Program > National Center for Atmospheric Research & > University Consortium for Atmospheric Research > 303-497-2889 (voice) > > Director, Center for Social Dynamics & Complexity > Professor of Anthropology, School of Human Evolution & Social Change > Arizona State University > www: http://www.public.asu.edu/~cmbarton, http://csdc.asu.edu > > > > > > > _______________________________________________ > grass-dev mailing list > [email protected] > http://lists.osgeo.org/mailman/listinfo/grass-dev _______________________________________________ grass-dev mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/grass-dev
