Python TkInter:创建一个运行我的自定义代码的窗口 [英] Python TkInter: Creating a Window which runs my custom code

查看:50
本文介绍了Python TkInter:创建一个运行我的自定义代码的窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在创建一个 Python 自定义代码来以 3D 形式可视化科学/医学数据.

I am Creating a python custom code to Visualise scientific/medical data in 3D.

这段代码应该在我用 TKInter 创建的 GUI 中实现,以便直接在 GUI 中可视化这些数据集.

This code should be implemented in the GUI I am creating with TKInter, so as to visualise these data sets directly in the GUI.

如果我已经编写了代码,有没有一种方法可以在我的 GUI 中运行此代码,然后直接在 TKInter GUI 中打开和运行可视化窗口???

If I already have the code written up is there a way I can run this code in my GUI and subsequently open and run the visualisation window directly in the TKInter GUI???

是否可以使用 TKInter 在内部创建自定义窗口,其中包含更复杂的代码并允许用户可视化代码的图像输出??

Is it possible to create custom windows inside with TKInter which contain more complex code and allow the user to visualise the image output of the code??

附加信息:3d 数据的可视化代码是使用 VTK(可视化工具包)创建的,并打开一个自定义的可视化窗口.

Additional info: The visualisation code for the 3d data is created with VTK (Visualisation ToolKit) and opens a custom Visualisation window.

推荐答案

VTK 应该附带 vtkTkRenderWindowInteractor 功能,但默认情况下没有构建或包含在大多数发行版中,例如 pypi 或 anaconda.然后,您很可能必须使用 VTK_USE_TK cmake 标志手动构建 VTK,例如参见此线程:

VTK should ship with the vtkTkRenderWindowInteractor functionality but is per default not built or included in most distributions like pypi or anaconda. You would then most likely have to build VTK manually with the VTK_USE_TK cmake flag, see for example this thread:

https:///discourse.vtk.org/t/error-importing-vtktkrenderwindowinteractor-in-vtk-8-2-0/856/27

这篇关于Python TkInter:创建一个运行我的自定义代码的窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆