Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #80182

Re: generating unique variable name via loops

Path csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <python-python-list@m.gmane.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.004
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'python.': 0.02; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'message- id:@4ax.com': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'subject:variable': 0.16; 'them...': 0.16; 'wrote:': 0.18; 'code.': 0.18; 'variable': 0.18; '>>>': 0.22; 'url:home': 0.24; 'header:X-Complaints-To:1': 0.27; 'them?': 0.31; 'list': 0.37; 'nov': 0.38; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'name': 0.63; 'subject:via': 0.84; 'received:108': 0.93
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From Dennis Lee Bieber <wlfraed@ix.netcom.com>
Subject Re: generating unique variable name via loops
Date Tue, 04 Nov 2014 09:00:25 -0500
Organization IISS Elusive Unicorn
References <8d3d202f-3bb8-4683-8dd7-b065fab06c34@googlegroups.com> <8df0b347-0569-4505-95f8-12baf44a1743@googlegroups.com> <m3ajo4$kit$1@dont-email.me>
Mime-Version 1.0
Content-Type text/plain; charset=ISO-8859-1
Content-Transfer-Encoding 8bit
X-Gmane-NNTP-Posting-Host adsl-108-73-119-167.dsl.klmzmi.sbcglobal.net
X-Newsreader Forte Agent 6.00/32.1186
X-No-Archive YES
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.15446.1415109642.18130.python-list@python.org> (permalink)
Lines 22
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1415109642 news.xs4all.nl 2892 [2001:888:2000:d::a6]:57681
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:80182

Show key headers only | View raw


On Tue, 04 Nov 2014 18:49:14 +0630, Veek M <vek.m1234@gmail.com> declaimed
the following:

>Fatih Güven wrote:
>
>> 4 Kas?m 2014 Sal? 13:29:34 UTC+2 tarihinde Fatih Güven yazd?:
>>> I want to generate a unique variable name for list using python.
>>> 
>>> list1=...
>>> list2=...
>
>for x in range(1,10):
>    exec("list%d = []" % x)

	Of course, now that you have them... what can you do with them? Without
scattering exec() calls all over the code.


-- 
	Wulfraed                 Dennis Lee Bieber         AF6VN
    wlfraed@ix.netcom.com    HTTP://wlfraed.home.netcom.com/

Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

generating unique variable name via loops Fatih Güven <mfthguven@gmail.com> - 2014-11-04 03:29 -0800
  Re: generating unique variable name via loops Fatih Güven <mfthguven@gmail.com> - 2014-11-04 04:48 -0800
    Re: generating unique variable name via loops Veek M <vek.m1234@gmail.com> - 2014-11-04 18:49 +0630
      Re: generating unique variable name via loops Peter Otten <__peter__@web.de> - 2014-11-04 14:37 +0100
        Re: generating unique variable name via loops Fatih Güven <mfthguven@gmail.com> - 2014-11-04 05:53 -0800
          Re: generating unique variable name via loops Peter Otten <__peter__@web.de> - 2014-11-04 16:00 +0100
            Re: generating unique variable name via loops Fatih Güven <mfthguven@gmail.com> - 2014-11-04 07:36 -0800
              Re: generating unique variable name via loops Peter Otten <__peter__@web.de> - 2014-11-04 17:06 +0100
          Re: generating unique variable name via loops Denis McMahon <denismfmcmahon@gmail.com> - 2014-11-04 17:15 +0000
          Re: generating unique variable name via loops Tim Chase <python.list@tim.thechases.com> - 2014-11-04 09:05 -0600
      Re: generating unique variable name via loops Fatih Güven <mfthguven@gmail.com> - 2014-11-04 05:45 -0800
        Re: generating unique variable name via loops Veek M <vek.m1234@gmail.com> - 2014-11-04 19:20 +0630
        Re: generating unique variable name via loops Denis McMahon <denismfmcmahon@gmail.com> - 2014-11-04 17:14 +0000
      Re: generating unique variable name via loops Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2014-11-04 09:00 -0500
  Re: generating unique variable name via loops Peter Otten <__peter__@web.de> - 2014-11-04 14:09 +0100
  Re: generating unique variable name via loops Matthew Ruffalo <mmr15@case.edu> - 2014-11-04 10:04 -0500

csiph-web