Page 1 of 1

Accessing FreePIE namespaces in imported module

Posted: Sun Jan 24, 2016 5:57 am
by matzie
I have some python code in a freepie\pylib\somefile.py. I can import this into my FreePIE script with 'import somefile', that works fine

(although I'd like to be able to have my files in freepie\pylib\mydir\somefile.py , I can't seem to get that to work, but that isn't my main question)

but what I want to do now is, inside somefile.py, access FreePIE objects like keyboard, Key, joystick and so on.

In my actual FreePIE script I instantiated some objects defined in somefile.py, so I know I can pass the objects I'm interested in to the object's constructor, but what I'd prefer to be able to do is, inside somefile.py, have an import statement that will allow me to access them there. But I can't figure out the correct paths etc.

thanks

Matt

Re: Accessing FreePIE namespaces in imported module

Posted: Mon Jan 25, 2016 2:09 am
by CyberVillain
This used to work, they changed something in Iron Python with latest version. I have a question going about it on stack
IT could be solvable by overriding the import function, but I didn't get it to work

http://stackoverflow.com/questions/3124 ... om-modules