Hey everyone. I've run into a bit of trouble trying to use an imported function in one of my PyGimp plugins, and I was hoping someone on the forum might be able to give me a heads up as to why this is happening. Here is the contents of a module that I wrote, called 'ofstream.py', which I placed inside "C:\Program Files\GIMP-2.0\lib\gimp\2.0\python" (next to pygimp.py).
f = open('C:/testData.dat', 'w')
I'm trying to call the function 'fout' from within a plugin, which contains:
from gimpfu import *
"shows how to open a file and read / write from it using PyGimp",
"takes no arguments. Has no return values",
"jason sultana 2010",
Note that if i import ofstream in the PyGimp console and run ofstream.fout(), it works fine. It only plays up if I try to call the function from within my testFile plugin. I get:
"Traceback (most recent call last):
File "", line 1, in
RuntimeError: execution error"
Any ideas as to why this is happening? I'm able to use register() and main() contained within gimpfu.py just fine, so by rights I should be able to use fout() contained within ofstream.py also.
Please disregard the lack of whitespace, the forum won't let me indent properly, but the code is properly indented.
Thanks heaps every1 4 any replies