Accessing FreePIE namespaces in imported module

Official forum for open source FreePIE discussion and development.
Post Reply
matzie
One Eyed Hopeful
Posts: 10
Joined: Thu Jan 14, 2016 3:59 am

Accessing FreePIE namespaces in imported module

Post 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
CyberVillain
Petrif-Eyed
Posts: 2166
Joined: Mon Jun 22, 2009 8:36 am
Location: Stockholm, Sweden

Re: Accessing FreePIE namespaces in imported module

Post 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
Post Reply

Return to “FreePIE”