[pygtk] pygtk.require("2.0") changed sys.path
pogonyshev at gmx.net
Mon Mar 19 07:02:04 WST 2007
Preben Randhol wrote:
> If I do:
> import pygtk
> then sys.path will point towards
> in stead of the script. Is this expected behavior?
Yes, I think. require() above changes sys.path so that correct GTK+
version (2.0 in your case) is loaded.
> If so is there an alternative to sys.path except from catching it
> before doing pygtk.require. Do one need to do this at all by the way?
There is no alternative I think. But most of the time you don't need
to worry. If you do, however, better copy it to some meaningfully
named variable like
path_to_application = sys.path
before doing anything else.
More information about the pygtk