ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> python-list
python-list
Re: Assignments and Variable Substitution
by Srage other posts by this author
Aug 13 2007 12:15PM messages near this date
Re: Assignments and Variable Substitution | ?ENJOY free satellite tv on your pc?
On Aug 13, 1:00 pm, brad <byte8b...@[...].com>  wrote:
>  I'd like to do something like this:
> 
>  var = '123'
>  %s = [], %var
> 
>  So that, in the end, var is '123' and an empty list is named '123' as
>  well. The list assignments are created during a loop.
> 
>  Thanks,
>  Brad

You probably want to use a dictionary to store your lists... code
like:

variableDict = {}
variableDict[var] = ['value1', 'value2', 'value3']

-- 
http://mail.python.org/mailman/listinfo/python-list
Thread:
Brad
Evan Klitzke
Srage

Privacy Policy | Email Opt-out | Feedback | Syndication
© 2004 ActiveState, a division of Sophos All rights reserved