How to use python functions in conf.py file in Sphinx
I've written a little python function, called myFunction, stored in
function.py that I'd like to call within a conf.py file. The function
works fine when called from a test python file, so I appear to have a
problem importing modules in this file specifically.
The setup is like this:
DocumentSourceFolder/sourcefile.txt
DocumentSourceFolder/conf.py
DocumentSourceFolder/function.py
Within conf.py I have added the following:
import function
variable = function.myFunction()
(where variable is something that already exists within the conf.py file).
When running sphinx on this document, however, I receive the error:
ImportError: No module named function
Any ideas?
Thanks
No comments:
Post a Comment