this python stuff is rather amazing
no strange feature has bitten you in the ass yet?
oh, I've been nibbled on a bit
but no major chunks missing
how close are you to your goals?
If I pastebin what I've got so far, would you mind taking a look at it? I want to make sure I'm not doing anything boneheaded
sure, but I'm actually at a friend's and probably shouldn't chat too long
this can wait
I'm finishing up some error checking/validation code, then I'm gonna move on to "its parsed, now do something usefull with it"
I had a bit of a setback - about a 4 hour power failure here (storm)
only got booted back up recently
15 minute UPS doesn't do much good when the power goes out at 4ish, and I'm at work till 5:30 ;-(
cradek, u there?
(not for long)
what do you think about making fengli a developer?
I took a look at his Qt GUI, and it's not bad
I think he's off to an ok start
the GUI code should be pretty well isolated, so I don't think he would really do any harm
jepler: you around?
I don't see any mention of arrays in the tutorial, although google does say py has arrays
can I make an array of lists?
the elements of lists can be lists
I know I could make a dict with integers as keys, and pretend its an array, but that seems strange
if you want to index by numbers, then you want a list
(unless you have a special purpose in mind, like storing an array of 'char' or 'long' in the same way that C would, for binary I/O of some sort)
what I'm doing: I have a bunch of instances (in a dict of class objects, but it could be a list of objs or whatever)
each has a "num_addr_bits" member
I want to build an array of lists, from a to a, which contains the objects having that number of bits
why do you know that the biggest index is 14?
sort of a histogram - loop thru the instances, assigning each one to a bin
because if its bigger it won't fit in the address space of the FPGA
there may be a bigger number in the source file, but if so its an error and I want to report it
instances_by_bits = [  for i in range(15) ] # Make a list of 15 empty lists
then you can put the instances into the bins with a loop like this one:
for i in instances:
I just had a duh moment... I didn't realize that lists can be accessed using subscripts
I think I overlooked that page, and was assuming things like append, insert, remove, index, were the only way
is this notation something I should explain further: instances_by_bits = [  for i in range(15) ]
I think I get it
 makes an empty list (I've used that already)
for i in range(15) iterates i from 0 to 14
the contatenation of the two is new
I really hate error checking
my code has gotten rather crufted up, because I
because I'm trying to give the user helpfull info instead of stack tracebacks for at least common errors in the input file
I think I've restructured the parsing code three times
yeah it's a hard trade-off
first pass: parse all instance requests from the source file, parse all module specs from the "library", then make sure a spec exists for every type of instance requested
first version I mean
2nd version: parse all instance requests, then parse a module spec for each type of instance requested (don't parse it if you don;t need it)
3rd version: like the 2nd, but put "look for (and parse if not found) a matching module spec" in the instance class __init__
each time I thought I was making it better, but now I'm not so sure
stop changing it then, and see if using the tool gives you a better understanding of the trade-offs
thats kind of the conclusion I reached... but I'm less worried about ME needing the messages than I am about other people needing them
anyway, I moved on to the address decode stuff, hence the array question
hmm.... "for i in instances : " results in i being the key, not the instance object
(instances is a dict of name:object pairs)
I can do for name, i in instances.iteritems() :
I don't need name though - is there a way to get just the objects?
there are .keys(), .values(), .items() as well as 'iter' variants
I knew about keys, didn't know about the others
does python have the equivalent of "foo++", "foo *= 3", "foo <<= 2", etc? or do you write them out as "foo = foo + 1" ?
it does have 'foo *= 3' but not 'foo++'
I suppose I should have just tried it...
still adapting to the interpreter way of doing things
jmkasunich, how's the mesa Step/dir stuff going?
anything I maybe able to help with?
a-l-p-h-a: working on infrastructure stuff right now