[Tutor] empty gfx module?

2014-06-22 Thread Lifeng Lin
Hi Everyone!

I am recently trying to process a gfx file using python.
gfx module does not come default, and with some struggle, i seem to have
succeeded in installing the module. However, when I import it, no methods
or attributes showed up.
here are some codes:

###
import gfx

handle = gfx.open("pdf", "sample.pdf")


I got the error:
AttributeError: 'module' object has no attribute 'open"

when i do "dir(gfx)"
nothing but the usual suspect showed up. Help?

best,
Lifeng...
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] empty gfx module?

2014-06-22 Thread Steven D'Aprano
On Sun, Jun 22, 2014 at 12:18:11AM -0500, Lifeng Lin wrote:
> Hi Everyone!
> 
> I am recently trying to process a gfx file using python.
> gfx module does not come default, and with some struggle, i seem to have
> succeeded in installing the module. However, when I import it, no methods
> or attributes showed up.

Make sure you haven't shadowed the gfx module with a file of your own 
called "gfx.py" or "gfx.pyc".

You can check which file Python sees by doing this:

import gfx
print(gfx.__file__)



-- 
Steven
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] empty gfx module?

2014-06-22 Thread Alan Gauld

On 22/06/14 06:18, Lifeng Lin wrote:

Hi Everyone!

I am recently trying to process a gfx file using python.
gfx module does not come default, and with some struggle, i seem to have
succeeded in installing the module.


Steven has suggested one possible cause.
However this list is for the Python language and standard library.
The best place to get help on specific modules is from the author or 
their specific mailing list/forum. Failing that the main Python list may 
have more likelihood of another user being able to help.


Using the tutor list you are reducing your odds of finding someone
who can help.

--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.flickr.com/photos/alangauldphotos

___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor