Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
VTK
VTK
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 582
    • Issues 582
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 160
    • Merge Requests 160
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI / CD
    • Repository
    • Value Stream
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • VTK
  • VTKVTK
  • Merge Requests
  • !543

Closed
Opened Aug 17, 2015 by Andrew Maclean@amacleanDeveloper
  • Report abuse
Report abuse

Converting python examples so they also run on Py3k.

  • Overview 19
  • Commits 2
  • Changes

There are 155 python examples in 21 folders.

I have run each example using Python 3.4 and making changes where applicable.

For those I couldn't run (see below) I also ran 2to3 on them and modified any print statements etc.

Changes:

  • Mainly print x -> print(x)
  • For examples using Tk, these are now use tkinter instead of Tkinter if Py3k is used.
  • The abstract class vtkCompositeDataIterator in SingleYoungsMaterialInterface.py was replaced with vtkDataObjectTreeIterator.

Not tested:

GUI/Qt/GraphicsViewPython/

No PyQt4
  • GraphicsViewPython.py

Examples\Infovis\Python\

No boost:
  • boost*.py
  • graph_tree_ring.py
  • hierarchical_graph.py
  • selection.py
  • simple_selection.py
  • tree1.py

No database access (it belongs to Sandia):

  • mysql_database.py

No Matlab:

  • Matlab_engine_filter.py
  • Matlab_engine_interface.py

No PyQt4

  • gui.py
  • streaming_statistics_pyqt.py

No R

  • Rcalculator_mst.py
  • Rcalculator_vd.py
  • Rinterface.py
  • Rrand_table.py

Fails

Maybe because I am running OpenGL2 or I don't have the requisite option set:

 Examples/Infovis/Python>python databases2.py
Traceback (most recent call last):
  File "databases2.py", line 15, in <module>
    databaseToGraph = vtkSQLDatabaseGraphSource()
NameError: name 'vtkSQLDatabaseGraphSource' is not defined

 Examples\ParallelProcessing\MPI\Python>python ParallelCone.py
Traceback (most recent call last):
  File "ParallelCone.py", line 10, in <module>
    compManager = vtkCompositeRenderManager()
NameError: name 'vtkCompositeRenderManager' is not defined

These work with the OpenGL backend, tested by @dgobbi:
 SimpleTextureMap2D.py
 VolumePicker.py
Assignee
Assign to
Reviewer
Request review from
None
Milestone
None
Assign milestone
Time tracking
Reference: vtk/vtk!543
Source branch: make_python_examples_p3k_compliant