如何解决对话框中条目分类的方法
我一直在使用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 举报,一经查实,本站将立刻删除。