Importing in Python extensions
Posted: Fri Sep 04, 2015 3:20 am
Hello everyone, once again I have benign problems that should be relatively simple to figure out, but have me stumped:
I have a simple Hello World python function, and I want to give it more functionality by importing classes from another python file in the same folder. In normal python programming this would be as simple as writing But after compilation of the files into an extension, I get an ImportError stating that it cannot find ClassFile. What do I need to do to get this python file to import into the Hello World function?
An extension on that question; I am also trying to use nltk (an external, 3rd party library for python), which would be imported in the same way, but is not contained within the extension file, it is instead installed in python/Lib/site-packages/nltk. Do I need to install this library into the OpenOffice python distribution, or is it more complicated to get third-party libraries working with OpenOffice?
I have a simple Hello World python function, and I want to give it more functionality by importing classes from another python file in the same folder. In normal python programming this would be as simple as writing
Code: Select all
import ClassFile
An extension on that question; I am also trying to use nltk (an external, 3rd party library for python), which would be imported in the same way, but is not contained within the extension file, it is instead installed in python/Lib/site-packages/nltk. Do I need to install this library into the OpenOffice python distribution, or is it more complicated to get third-party libraries working with OpenOffice?