I'm somewhat new to python (using 2.5 on w2k)
Currently I am trying to organize a structure for a project, and import all necessary files and so on.
Everything went fine until I tried to import a python file with no name (don't ask me why it has no name ;)
e.g.
root (the folder where the code is run from)
root/.py (the file)
Now, how can I load that file as a module? It doesn't have a name...
I have tried manually loading the file (using open()) but how do I "read" the content so that it is loaded as a module and assign it to a variable (which will work as the module name)?
e.g.
Expand|Select|Wrap|Line Numbers
- f=open('.py')
- import whateverThatCanDoThis
- ModuleName=whateverThatCanDoThis.loadModule(f)
I need to know if this is possible? (any suggestions for a solution is also welcome ;)