Re: generating unique variable name via loops

2014-11-04 Thread Tim Chase
On 2014-11-04 05:53, Fatih Güven wrote: > > > for x in range(1,10): > > > exec("list%d = []" % x) > > > > Why would you do this? > > I have a structured and repetitive data. I want to read a .txt file > line by line and classified it to call easily. For example > employee1 has a name, a salar

Re: generating unique variable name via loops

2014-11-04 Thread Denis McMahon
On Tue, 04 Nov 2014 05:53:04 -0800, Fatih Güven wrote: > Call employee1.name or employee2.salary and assign it to a new variable, > something etc. 1) Put the file into a database. 2) database calls -- Denis McMahon, denismfmcma...@gmail.com -- https://mail.python.org/mailman/listinfo/python-li

Re: generating unique variable name via loops

2014-11-04 Thread Denis McMahon
On Tue, 04 Nov 2014 05:45:04 -0800, Fatih Güven wrote: > 4 Kasım 2014 Salı 15:19:20 UTC+2 tarihinde Veek M yazdı: >> 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=.

Re: generating unique variable name via loops

2014-11-04 Thread Peter Otten
Fatih Güven wrote: > 4 Kasım 2014 Salı 17:01:17 UTC+2 tarihinde Peter Otten yazdı: >> Fatih Güven wrote: >> >> > 4 Kasım 2014 Salı 15:37:59 UTC+2 tarihinde Peter Otten yazdı: >> >> Veek M wrote: >> >> >> >> > Fatih Güven wrote: >> >> > >> >> >> 4 Kas?m 2014 Sal? 13:29:34 UTC+2 tarihinde Fatih G

Re: generating unique variable name via loops

2014-11-04 Thread Fatih Güven
4 Kasım 2014 Salı 17:01:17 UTC+2 tarihinde Peter Otten yazdı: > Fatih Güven wrote: > > > 4 Kasım 2014 Salı 15:37:59 UTC+2 tarihinde Peter Otten yazdı: > >> Veek M wrote: > >> > >> > Fatih Güven wrote: > >> > > >> >> 4 Kas?m 2014 Sal? 13:29:34 UTC+2 tarihinde Fatih Güven yazd?: > >> >>> I want to

Re: generating unique variable name via loops

2014-11-04 Thread Matthew Ruffalo
Hi- Questions like this appear so often in various places (mailing lists, forums, sites like Stack Overflow) that I think a very blunt/candid answer is appropriate. This is especially true since there's always someone who responds to the question as-is with some monstrosity of exec() and string fo

Re: generating unique variable name via loops

2014-11-04 Thread Peter Otten
Fatih Güven wrote: > 4 Kasım 2014 Salı 15:37:59 UTC+2 tarihinde Peter Otten yazdı: >> Veek M wrote: >> >> > 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=...

Re: generating unique variable name via loops

2014-11-04 Thread Jean-Michel Pichavant
- Original Message - > From: "Fatih Güven" > I have a structured and repetitive data. I want to read a .txt file > line by line and classified it to call easily. For example employee1 > has a name, a salary, shift, age etc. and employee2 and other 101 > employee have all of it. > > Call e

Re: generating unique variable name via loops

2014-11-04 Thread Veek M
Fatih Güven wrote: > This is okay but i can't use the method ".append" for example > list1.append("abc") works for me -- https://mail.python.org/mailman/listinfo/python-list

Re: generating unique variable name via loops

2014-11-04 Thread Fatih Güven
4 Kasım 2014 Salı 15:37:59 UTC+2 tarihinde Peter Otten yazdı: > Veek M wrote: > > > 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

Re: generating unique variable name via loops

2014-11-04 Thread Fatih Güven
4 Kasım 2014 Salı 15:19:20 UTC+2 tarihinde Veek M yazdı: > 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

Re: generating unique variable name via loops

2014-11-04 Thread Peter Otten
Veek M wrote: > 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) Why would you do this? -- https

Re: generating unique variable name via loops

2014-11-04 Thread Veek M
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) -- https://mail.python.org/mailman/listinfo/python-list

Re: generating unique variable name via loops

2014-11-04 Thread Peter Otten
Fatih Güven wrote: > I want to generate a unique variable name for list using python. > > list1=... > list2=... > . > . > . > listx=... where x is a number. > > You can remember it from saving a file in a directory. If you have already > created a "new file", save dialog sugget that <<"new file

Re: generating unique variable name via loops

2014-11-04 Thread Fatih Güven
4 Kasım 2014 Salı 13:29:34 UTC+2 tarihinde Fatih Güven yazdı: Editted: Grammar revision. > Hi, > > I want to generate a unique variable name for list using python. > > list1=... > list2=... > . > . > . > listx=... where x is a number. > > You can remember it from saving a file in a directory. If

generating unique variable name via loops

2014-11-04 Thread Fatih Güven
Hi, I want to generate a unique variable name for list using python. list1=... list2=... . . . listx=... where x is a number. You can remember it from saving a file in a directory. If you have already created a "new file", save dialog sugget that <<"new file " is already exist, do you want to