On Mon, 22 Dec 2008 22:32:17 -0500
Aaron Stepp stepp.aa...@gmail.com wrote:
Instead of writing a long list of initializations like so:
A = [ ]
B = [ ]
...
Y = [ ]
Z = [ ]
I'd like to save space by more elegantly turning this into a loop. If
Well, if all you want is a loop:
for
D'Arcy J.M. Cain wrote:
On Mon, 22 Dec 2008 22:32:17 -0500
Aaron Stepp stepp.aa...@gmail.com wrote:
Instead of writing a long list of initializations like so:
A = [ ]
B = [ ]
...
Y = [ ]
Z = [ ]
I'd like to save space by more elegantly turning this into a loop. If
Well, if all you
import random
from rtcmix import *
from chimes_source import * # Chime.play()
from rhythmblock import * # rhythmBlock.rhythmTwist() and
rhythmBlock.printStuff()
from pitchblock import * # pitchBlock.pitchTwist() and
pitchBlock.printStuff()
from lenEval import * #greaterThan.sovler()
On Tue, 23 Dec 2008 10:20:59 -0500
Steve Holden st...@holdenweb.com wrote:
D'Arcy J.M. Cain wrote:
Well, if all you want is a loop:
for v in vars:
locals()[v] = []
Note that this isn't guaranteed to work. While locals() will return a
dict containing the names and values
D'Arcy J.M. Cain wrote:
On Tue, 23 Dec 2008 10:20:59 -0500
Steve Holden st...@holdenweb.com wrote:
D'Arcy J.M. Cain wrote:
Well, if all you want is a loop:
for v in vars:
locals()[v] = []
Note that this isn't guaranteed to work. While locals() will return a
dict containing
On Tue, 23 Dec 2008 15:39:52 -, Aaron Stepp stepp.aa...@gmail.com
wrote:
import random
from rtcmix import *
from chimes_source import * # Chime.play()
from rhythmblock import * # rhythmBlock.rhythmTwist() and
rhythmBlock.printStuff()
from pitchblock import * # pitchBlock.pitchTwist()
Hi all:
I'm new to python and trying to save time and code by iterating
through list initializations as well as the assignments. I have the
following code:
import random
from rtcmix import *
from chimes_source import *
from rhythmblock import *
from pitchblock import *
indexrand =
On Mon, Dec 22, 2008 at 2:22 PM, Aaron Stepp stepp.aa...@gmail.com wrote:
Hi all:
I'm new to python and trying to save time and code by iterating through list
initializations as well as the assignments. I have the following code:
import random
from rtcmix import *
from chimes_source
Chris Rebert:
It likely goes without saying, but you ought to read the fine tutorial as
well.
I also suggest to fix the messed up indentations.
Bye,
bearophile
--
http://mail.python.org/mailman/listinfo/python-list
I can't check you code because i don't have these modules but here is
the code with proper indention
import random
from rtcmix import *
from chimes_source import *
from rhythmblock import *
from pitchblock import *
indexrand = random.Random()
indexrand.seed(2)
rhythm = rhythmBlock()
pitch =
I can't check you code because i don't have these modules but here is
the code with proper indention
import random
from rtcmix import *
from chimes_source import *
from rhythmblock import *
from pitchblock import *
indexrand = random.Random()
indexrand.seed(2)
rhythm = rhythmBlock()
pitch =
On Dec 22, 2008, at 10:15 PM, r wrote:
I can't check you code because i don't have these modules but here is
the code with proper indention
import random
from rtcmix import *
from chimes_source import *
from rhythmblock import *
from pitchblock import *
indexrand = random.Random()
class test():
def __init__(self, name):
self.name = 'My name is %d' %name
l = []
for name in range(10):
l.append(test(name))
l
[__main__.test instance at 0x02852E18, __main__.test instance at
0x02852C38, __main__.test instance at 0x028528A0, __main__.test
On Mon, Dec 22, 2008 at 7:32 PM, Aaron Stepp stepp.aa...@gmail.com wrote:
snip
Thanks for the help so far, I think I'm starting to get a hang of the
syntax.
I think I need to state my goal more clearly.
Instead of writing a long list of initializations like so:
A = [ ]
B = [ ]
...
Y =
On Dec 22, 2008, at 10:43 PM, Chris Rebert wrote:
On Mon, Dec 22, 2008 at 7:32 PM, Aaron Stepp stepp.aa...@gmail.com
wrote:
snip
Thanks for the help so far, I think I'm starting to get a hang of the
syntax.
I think I need to state my goal more clearly.
Instead of writing a long list of
On Tue, 23 Dec 2008 03:52:35 -, Aaron Stepp stepp.aa...@gmail.com
wrote:
Simply put, I just need enough arrays to hold a list of
pitches/rhythms. Then I'll have each list member returned to an
instrument defined in another module.
One array can hold a list of pitches/rhythms. I'm
On Mon, Dec 22, 2008 at 7:52 PM, Aaron Stepp stepp.aa...@gmail.com wrote:
On Dec 22, 2008, at 10:43 PM, Chris Rebert wrote:
On Mon, Dec 22, 2008 at 7:32 PM, Aaron Stepp stepp.aa...@gmail.com
wrote:
snip
Thanks for the help so far, I think I'm starting to get a hang of the
syntax.
I
17 matches
Mail list logo