# how translate c++ example to python

**URL:** https://discourse.vtk.org/t/how-translate-c-example-to-python/13254
**Category:** Support
**Tags:** python
**Created:** [February 5, 2024, 3:15am UTC](https://discourse.vtk.org/t/how-translate-c-example-to-python/13254 "2024-02-05T03:15:15Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![zhangm](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/z/34f0e0/32.png) [@zhangm](https://discourse.vtk.org/u/zhangm)
#### Post date: [February 5, 2024, 3:15am UTC](https://discourse.vtk.org/t/how-translate-c-example-to-python/13254/1 "2024-02-05T03:15:15Z")

</div>

I want translate FourPaneViewer from c++ to python as my project framework is based on pyqt5. But now I have the problem as below:

1. how can I create a subclass of vtkcommand as the example;
2. how can I show the result by QVTKRenderWindowInteractor as the example is use QVTKWidget.

---

<div class="post-metadata">

### Author: ![rexthor](https://discourse.vtk.org/user_avatar/discourse.vtk.org/rexthor/32/6481_2.png) [@rexthor](https://discourse.vtk.org/u/rexthor)
#### Post date: [February 7, 2024, 1:33pm UTC](https://discourse.vtk.org/t/how-translate-c-example-to-python/13254/2 "2024-02-07T13:33:56Z")

</div>

I tried to get an example for you, but I’m working remote - and graphics forwarding is prevented.  
Perhaps try something with [vtkViewport](https://vtk.org/doc/nightly/html/classvtkViewport.html#details)? There is an online example on that page as well.
