subclassing list

2005-07-31 Thread spike
I've googled like crazy and can't seem to find an answer to why this isn't working. I want to create a custom list class that acts as a circular list. ie: my_list = (0, 1, 2) how I want it to behave: my_list[0] -> 0 my_list[1] -> 1 my_list[2] -> 2 my_list[3] -> 0 my_list[4] -> 1 ...etc so, wha

Does anyone have a Python Logic Map/Flow Chart? (Example Provided)

2010-02-08 Thread spike
Has anyone been able to come across a Python logic map or flow chart? An example can be seen here on the right: http://en.wikipedia.org/wiki/Usenet This would be very helpful for users. -- http://mail.python.org/mailman/listinfo/python-list

Python Logic Map/Logic Flow Chart. (Example Provided)

2010-02-08 Thread spike
Has anyone been able to come across a Python logic map or Python logic flow chart? An example can be seen on the right under History: http://en.wikipedia.org/wiki/Usenet#History This would be very helpful for all users. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Logic Map/Logic Flow Chart. (Example Provided)

2010-02-08 Thread spike
On Feb 8, 1:35 pm, Gary Herron wrote: > spike wrote: > > Has anyone been able to come across a Python logic map or Python logic > > flow chart? > > > An example can be seen on the right under History: > >http://en.wikipedia.org/wiki/Usenet#History > > > T

opening a file using a relative path from a subclass in a package

2005-12-07 Thread spike grobstein
kage to calculate the absolute path of it and pass that as a variable? I'd rather not have to repeat myself for each package that I make, and I've got a feeling that I'm missing something really obvious. thanks in advance! ...spike -- http://mail.python.org/mailman/listinfo/python-list

Re: opening a file using a relative path from a subclass in a package

2005-12-07 Thread spike grobstein
oh, wow. that works!!! thanks for the help! so, since python supports module packages like it does, you'd think that it would have ways of making add-on or extension modules to be more self contained. Thanks, again! -- http://mail.python.org/mailman/listinfo/python-list

Re: opening a file using a relative path from a subclass in a package

2005-12-07 Thread spike grobstein
I understand why it wasn't working and it makes sense based on the structure of namespaces that python defines, however, I'm just surprised that there isn't some kind of built-in facility for dealing with these types of things. Module packages are a spectacular idea, it is just kinda easy to get c

importing files from a directory

2005-07-09 Thread spike grobstein
have just blah. I realize I could say: my_module = __import__("Modules.%s" % mod) module_list.append(getattr(my_module, mod)) but... is there a better way to accomplish what I'm trying to do? tia. ...spike -- http://mail.python.org/mailman/listinfo/python-list

Re: importing files from a directory

2005-07-11 Thread spike grobstein
ex) and get_named_module(module_name), etc). Thanks for the help. Python's making me have to think a little backwards. I have to make sure I declare my functions before I call them, but it's a very cool language overall. ...spike -- http://mail.python.org/mailman/listinfo/python-list

Re: subclassing list

2005-07-31 Thread spike grobstein
>You also need to post the code that raises the error, or no one else can debug it. sorry, I thought I had pasted that line in there, but I guess I missed it. Here's the full code (after modifying it slightly based on your post): #! /usr/bin/env python def circular_list(list): def __getitem_