Re: run all scripts in sub-directory as subroutines?

2009-11-14 Thread Dave Angel
Tobiah wrote: This works fine, but in the sub-modules the sys.path appropriately returns the same as from the parent, I want them to know their own file names. How?? I can pass it to them, but wondered if there is a more self-sufficient way for a module to know from where it was invoked.

Re: run all scripts in sub-directory as subroutines?

2009-11-13 Thread Tobiah
> This works fine, but in the sub-modules the sys.path appropriately > returns the same as from the parent, I want them to know their own file > names. How?? I can pass it to them, but wondered if there is a more > self-sufficient way for a module to know from where it was invoked. I like the ide

Re: run all scripts in sub-directory as subroutines?

2009-08-12 Thread ryles
On Aug 11, 5:12 pm, guthrie wrote: > This works fine, but in the sub-modules the sys.path appropriately > returns the same as from the parent, I want them to know their own > file names. How?? I can pass it to them, but wondered if there is a > more self-sufficient way for a module to know from wh

run all scripts in sub-directory as subroutines?

2009-08-11 Thread guthrie
I want to have a program which will form a list of all *.py scripts in a sub-directory, and then call some standard messages on them. So I can add a new data source modularly by just dropping a new file into the sources directory with the appropriate methods in it. For example: path = sys.path[0]