对话框中条目分类的方法

问题描述

我一直在使用easygui处理简单的事情,例如从列表中选择选项,例如:

For Each tbl In ActiveDocument.Tables
    For r = 1 To tbl.Rows.Count
        Set tCell = tbl.Cell(r,3) ' check only row 3
        If tCell.Range.Text Like "#.#.#.#.#.#*" Then ' search for heading number consisting of x.x.x.x.x.x
            tCell.Range.Text = Right(tCell.Range.Text,Len(tCell.Range.Text) - 12) ' remove old heading numbers
            tCell.Range.Text = Replace(tCell.Range.Text,Chr(13),"") ' remove Carrige Return at end of string
            tCell.Range.Style = ActiveDocument.Styles("heading 6")
        End If
    Next r
Next tbl

For Each tbl In ActiveDocument.Tables
    For r = 1 To tbl.Rows.Count
        Set tCell = tbl.Cell(r,3) ' check only row 3
        If tCell.Range.Text Like "#.#.#.#.#*" Then ' search for heading number consisting of x.x.x.x.x
            tCell.Range.Text = Right(tCell.Range.Text,Len(tCell.Range.Text) - 10) ' remove old heading numbers
            tCell.Range.Text = Replace(tCell.Range.Text,"") ' remove Carrige Return at end of string
            tCell.Range.Style = ActiveDocument.Styles("heading 5")
        End If
    Next r
Next tbl

For Each tbl In ActiveDocument.Tables
    For r = 1 To tbl.Rows.Count
        Set tCell = tbl.Cell(r,3) ' check only row 3
        If tCell.Range.Text Like "#.#.#.#*" Then ' search for heading number consisting of x.x.x.x
            tCell.Range.Text = Right(tCell.Range.Text,Len(tCell.Range.Text) - 8) ' remove old heading numbers
            tCell.Range.Text = Replace(tCell.Range.Text,"") ' remove Carrige Return at end of string
            tCell.Range.Style = ActiveDocument.Styles("heading 4")
        End If
    Next r
Next tbl

For Each tbl In ActiveDocument.Tables
    For r = 1 To tbl.Rows.Count
        Set tCell = tbl.Cell(r,3) ' check only row 3
        If tCell.Range.Text Like "#.#.#*" Then ' search for heading number consisting of x.x.x
            tCell.Range.Text = Right(tCell.Range.Text,Len(tCell.Range.Text) - 6) ' remove old heading numbers
            tCell.Range.Text = Replace(tCell.Range.Text,"") ' remove Carrige Return at end of string
            tCell.Range.Style = ActiveDocument.Styles("heading 3")
        End If
    Next r
Next tbl

For Each tbl In ActiveDocument.Tables
    For r = 1 To tbl.Rows.Count
        Set tCell = tbl.Cell(r,3) ' check only row 3
        If tCell.Range.Text Like "#.#*" Then ' search for heading number consisting of x.x
            tCell.Range.Text = Right(tCell.Range.Text,Len(tCell.Range.Text) - 4) ' remove old heading numbers
            tCell.Range.Text = Replace(tCell.Range.Text,"") ' remove Carrige Return at end of string
            tCell.Range.Style = ActiveDocument.Styles("heading 2")
        End If
    Next r
Next tbl

现在已经使用了一段时间了,我会说它正在工作,但是确实很笨拙,并不十分适合我真正想做的事情。更好的是,如果我可以生成一个对话框,在左侧为我提供一个列表(在这种情况下为数据框列名称),并且对于该列表的每一行,都有一个数字(例如3)组成一个复选框。矩阵。复选框的每一列都将以该列的所需操作来命名(例如,放置,分类代码,数字代码等)。如果我可以在easygui中做到这一点,那将是非常不错的,但是我一直无法在easygui文档中找到类似此功能的任何东西。看来,如果要执行此操作,则需要学习一个新的gui软件包来完成此操作。

我正在寻找的帮助具体是:

  • 哪些gui软件包/库将非常适合帮助我完成此任务
  • 我想可能有多种选择,在这种情况下,应该理解在能力/对其他目的的通用性与学习曲线的陡度之间取得平衡的想法。

我正在运行python 3.7并使用spyder。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)