Re: Calling a function from a custom module

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Apr 18, 2010 at 11:12:05AM +0200, Jason S. wrote:
> As general practice, I've written a function that I put inside a file called
> "ofstream.py" (placed in the same folder as gimpfu.py), which consists of:
> [...] example code
> But I keep getting an 'execution error' linked to the fout statement.
Could you paste the error as well?

> If I comment out that line and replace it with something else, it
> works fine. The 'import ofstream' line gives me no trouble; its the
> function call thats the problem.
IMHO it's better do use absolute imports like:

    import ofstream
    ....
    ofstream.fout()

But that will not fix your problem.

> Why am I having this issue? I can use functions located in gimpfu.py
> just fine (register, main, etc). Why can't I use my own function?
It would be much more helpful if you could paste the whole traceback...

If you can import your module, it should also be possible to access your
function. What will happen if you you explicitly import your function:

    from ofstrem import fout

Cheers
-- 
Roman Joost
www: http://www.romanofski.de
email: romanofski@xxxxxxxx

Attachment: signature.asc
Description: Digital signature

_______________________________________________
Gimp-developer mailing list
Gimp-developer@xxxxxxxxxxxxxxxxxxxxxx
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer

[Index of Archives]     [Video For Linux]     [Photo]     [Yosemite News]     [gtk]     [GIMP for Windows]     [KDE]     [GEGL]     [Gimp's Home]     [Gimp on GUI]     [Gimp on Windows]     [Steve's Art]

  Powered by Linux