Need Suggestions for Python/Tk/VTK

Discussion in 'Python' started by Yang Wang, May 3, 2004.

  1. Yang Wang

    Yang Wang Guest

    Dear All,

    I am totally new to Python, however had some experience with Tcl/Tk.
    Currently I am doing a project that will need Python/Tk as well
    as VTK(Visualization Toolkit) for image processing and visualization.

    Have anyone had any experience in this that can give me some suggestions
    or references? And I also wonder how Tk is working with Python in
    the process of constructing GUI, is it like the way that with Tcl?

    Any help will be greatly appreicated. Thanks.

    Yours,
    Casper
     
    Yang Wang, May 3, 2004
    #1
    1. Advertising

  2. Yang Wang

    Eric Brunel Guest

    Yang Wang wrote:
    > Dear All,
    >
    > I am totally new to Python, however had some experience with Tcl/Tk.
    > Currently I am doing a project that will need Python/Tk as well
    > as VTK(Visualization Toolkit) for image processing and visualization.
    >
    > Have anyone had any experience in this that can give me some suggestions
    > or references? And I also wonder how Tk is working with Python in
    > the process of constructing GUI, is it like the way that with Tcl?
    >
    > Any help will be greatly appreicated. Thanks.
    >
    > Yours,
    > Casper


    I never used VTK, so I cannot help you for this part. As for the GUI
    construction process in Python/Tkinter, the only difference with tcl/tk is the
    syntax. For example, instead of doing in tcl:

    frame .frm -width 500 -height 200 -bd 3 -fg red
    pack .frame -side top

    in Python, you'll do:

    ## Import the Tkinter module
    from Tkinter import *
    ## Initialize Tkinter/tk
    root = Tk()
    ## The next two lines are the equivalent of the two tcl lines above
    frm = Frame(root, width=500, height=200, bd=3, fg='red')
    frm.pack(side=TOP)

    So you see, it's quite straightforward. The concepts, widgets, operations,
    options, ... are exactly identical in Python/Tkinter and tcl/tk. In fact, the
    Tkinter module actually creates a tcl interpreter in the background and converts
    all calls to Tkinter objects to tcl commands. So once you've understood how to
    convert tcl syntax to Python/Tkinter syntax, you can even use the tcl/tk manual
    pages as a reference.

    HTH
    --
    - Eric Brunel <eric (underscore) brunel (at) despammed (dot) com> -
    PragmaDev : Real Time Software Development Tools - http://www.pragmadev.com
     
    Eric Brunel, May 3, 2004
    #2
    1. Advertising

  3. At some point, Yang Wang <> wrote:

    > Dear All,
    >
    > I am totally new to Python, however had some experience with Tcl/Tk.
    > Currently I am doing a project that will need Python/Tk as well
    > as VTK(Visualization Toolkit) for image processing and visualization.
    >
    > Have anyone had any experience in this that can give me some suggestions
    > or references? And I also wonder how Tk is working with Python in
    > the process of constructing GUI, is it like the way that with Tcl?
    >
    > Any help will be greatly appreicated. Thanks.


    Have a look at the MayaVi project, which uses Tkinter and VTK for data
    visualization. You should be able to get some ideas from that.

    http://mayavi.sf.net/

    --
    |>|\/|<
    /--------------------------------------------------------------------------\
    |David M. Cooke
    |cookedm(at)physics(dot)mcmaster(dot)ca
     
    David M. Cooke, May 3, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Yi-Yu Chou

    python, vtk, C++

    Yi-Yu Chou, Sep 30, 2003, in forum: Python
    Replies:
    3
    Views:
    513
    Fernando Perez
    Oct 1, 2003
  2. Yi-Yu Chou
    Replies:
    1
    Views:
    542
    =?Big5?B?Sj9yZ2VuIENlZGVyYmVyZw==?=
    Dec 16, 2003
  3. John Hunter

    Re: Need Suggestions for Python/Tk/VTK

    John Hunter, May 3, 2004, in forum: Python
    Replies:
    1
    Views:
    382
    Fernando Perez
    May 6, 2004
  4. Ron Kneusel
    Replies:
    1
    Views:
    669
    Charl P. Botha
    Jun 3, 2004
  5. =?iso-8859-1?q?S=E9bastien_Ramage?=

    How Build VTK for Python 2.5 under Windows?

    =?iso-8859-1?q?S=E9bastien_Ramage?=, Oct 3, 2006, in forum: Python
    Replies:
    1
    Views:
    488
    =?iso-8859-1?q?S=E9bastien_Ramage?=
    Oct 3, 2006
Loading...

Share This Page