Micah Carrick <[EMAIL PROTECTED]> wrote:
> 2. What's the difference between importing pygtk and just gtk? Is
> that a distribution difference? Just 'import gtk' works for me... but
> I need this code to be nice and universal.
Importing pygtk lets you check the version you're working with, using
pygtk.require to require at least a particular version. The usual
invocation looks like:
try:
        import pygtk
        pygtk.require(version_number)
except:
        # Required version not here, give some error

import gtk

You always need to import gtk  You could probably skip the internal
version checking if the usual way of running the program does it for
you, but the full invocation is safer if you don't know this for sure.
This is portable across distributions.


> 3. I was looking at some PyGTK projects and noticed some have
> everything all in one .py file. Is it common convention to put
> everything into a single file, put each class into it's own file, or
> does it vary from programmer to programmer?
Do what makes sense.


-- 
Lennon Victor Cook
"He who receives an idea from me receives without lessening, as he who
lights his candle at mine receives light without darkening" -- Thomas
Jefferson

Attachment: signature.asc
Description: PGP signature

_______________________________________________
pygtk mailing list   [email protected]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

Reply via email to