Importing

Do you have questions about writing plugins or scripts in Python? Meet the coders here.
Post Reply
cfull1
Experienced User
Posts: 124
Joined: Thu Aug 19, 2010 4:52 am

Importing

Post by cfull1 » Wed Aug 17, 2011 4:01 pm

Is there a way to import files into a plugin not from that folder?
Like if I installed something and its in python27\Libs.
Is there anyway to import that?

eatmeimadanish
Experienced User
Posts: 118
Joined: Thu Oct 01, 2009 5:11 pm

Re: Importing

Post by eatmeimadanish » Tue Aug 23, 2011 12:04 am

If you are talking about modules inside of Python (IE import MySQLdb) then yes you can. You should probably run the same version of Python thats in EG which is currently 2.6.5. For instance I just imported MySQLdb into EG by droping all of the files into C:\Program Files (x86)\EventGhost\lib26\site-packages that pertained to that module. Now I can access a MySQL database directly from EG.

cfull1
Experienced User
Posts: 124
Joined: Thu Aug 19, 2010 4:52 am

Re: Importing

Post by cfull1 » Tue Aug 23, 2011 5:50 am

Nice! This is what I was looking for thanks. I've got 2.7 installed, not that much different right?

Post Reply