importing modules dynamicly

2011-01-10 Thread dubux
I am trying to import modules dynamicly from a directory (modules/) in which i have __init__.py with the __all__ variable set. Everything imports correctly and I have verified this however I am stuck on actually using my classes in the dynamicly imported modules. this bit is in my main.py (or base

Re: TypeError: list indices must be integers

2008-12-30 Thread dubux
thanks for help everyone. it turned out the function itself worked fine.. it was the way i was calling it that was messing everything up. i ended up re-doing the whole thing as follows, and it now works perfectly. def news(x,y): news_file = '/home/scam/Desktop/www/info/news' news =

TypeError: list indices must be integers

2008-12-30 Thread dubux
here is a function i wrote that doesnt work. i wrote to parse a "news" file that is going to work in conjunction with a website via mod_wsgi. my head hurts from looking at it so long. please help! i will further explain in the post. def news(x,y): # usage news(date, number) # x = d