[vtkusers] Running VTK 4.2 with Python 2.3 & GUI preferences

Arash Jahangir arash at vije.ca
Mon Feb 23 09:10:32 EST 2004


Hi Wesley,
I don't know if Python 2.3 is any different than 2.1 (which is what I use) but the answer to your question lies in reading about sys.path and "site".  I have included the relevant section at the bottom of this page.

As to your second question, for a number of reasons, including the depth and breadth of available support, applications, stability, feature richness, etc, I prefer using wxPython.  On the other hand, VTK and ITK examples are built using FLTK so if you plan on using them, then FLTK will be the way to go.  Also, FLTK is faster and more compact.

I am actually interested to hear from the developers as to the full merits of FLTK vs. wxPython (or wxWindows) as I have not read a full comparison to my satisfaction yet.  It does seem though that most scientific applications are favoring FLTK over wxWindows, though the logic behind it escapes me.

good luck,
Arash


site

Append module search paths for third-party packages to sys.path.
 
****************************************************************
* This module is automatically imported during initialization. *
****************************************************************
 
In earlier versions of Python (up to 1.5a3), scripts or modules that
needed to use site-specific modules would place ``import site''
somewhere near the top of their code.  Because of the automatic
import, this is no longer necessary (but code that does it still
works).
 
This will append site-specific paths to to the module search path.  On
Unix, it starts with sys.prefix and sys.exec_prefix (if different) and
appends lib/python<version>/site-packages as well as lib/site-python.
On other platforms (mainly Mac and Windows), it uses just sys.prefix
\(and sys.exec_prefix, if different, but this is unlikely).  The
resulting directories, if they exist, are appended to sys.path, and
also inspected for path configuration files.
 
A path configuration file is a file whose name has the form
<package>.pth; its contents are additional directories (one per line)
to be added to sys.path.  Non-existing directories (or
non-directories) are never added to sys.path; no directory is added to
sys.path more than once.  Blank lines and lines beginning with
\code{#} are skipped. Lines starting with \code{import} are executed.
 
For example, suppose sys.prefix and sys.exec_prefix are set to
/usr/local and there is a directory /usr/local/lib/python1.5/site-packages
with three subdirectories, foo, bar and spam, and two path
configuration files, foo.pth and bar.pth.  Assume foo.pth contains the
following:
 
  # foo package configuration
  foo
  bar
  bletch
 
and bar.pth contains:
 
  # bar package configuration
  bar
 
Then the following directories are added to sys.path, in this order:
 
  /usr/local/lib/python1.5/site-packages/bar
  /usr/local/lib/python1.5/site-packages/foo
 
Note that bletch is omitted because it doesn't exist; bar precedes foo
because bar.pth comes alphabetically before foo.pth; and spam is
omitted because it is not mentioned in either path configuration file.
 
After these path manipulations, an attempt is made to import a module
named sitecustomize, which can perform arbitrary additional
site-specific customizations.  If this import fails with an
ImportError exception, it is silently ignored.

  ----- Original Message ----- 
  From: Wesley Brooks 
  To: vtkusers at vtk.org 
  Sent: Monday, February 23, 2004 8:36 AM
  Subject: [vtkusers] Running VTK 4.2 with Python 2.3 & GUI preferences


  Dear Users

  I have only recently started programming in order to over come some problems with areas in my research so please keep replies at an entry level!

  Some one has installed VTK 4.2 on my machine and is now running fine with python 2.1. I also have python 2.3 running on this machine but it will not run the same programs saying there is no module named vtk. How do I get python 2.3 to talk to VTK?

  On another note I'm starting to investigate building a GUI for what I have done so far. I have seen  a few options like Tkinter and wxPython, and using a GUI builder using wxPython such as Boa Constrictor. What are the recommendations on this and are they all compatible with VTK?

  Yours Faithfully,

  Wesley Brooks









------------------------------------------------------------------------------
  Half price modem, FREE connection and one month FREE - click here to sign up to BT Broadband. _______________________________________________ This is the private VTK discussion list. Please keep messages on-topic. Check the FAQ at: Follow this link to subscribe/unsubscribe: http://www.vtk.org/mailman/listinfo/vtkusers 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20040223/da3e324d/attachment.htm>


More information about the vtkusers mailing list