当前位置:首页>python>国产可视化Python开发工具PyMe API 分类索引表

国产可视化Python开发工具PyMe API 分类索引表

  • 2026-09-04 04:10:14
国产可视化Python开发工具PyMe API 分类索引表

PyMe API 分类索引表

前文已为大家介绍了 PyMe 的 API 接口。由于 PyMe 接口数量较多,为方便查找,本文继续整理并提供了 PyMe 的 API 分类查找表。

全网首发没有之二,国产可视化Python开发工具PyMe API大全

国产可视化Python工具 PyMe 初体验:拖拖拽拽做桌面应用

PyMe 版本:PyMe-1.5.1.6

后台回复:"PyMe"  可下载 pdf 格式的 PyMe API 手册(为便于使用加入了跳转标签),是“私信”,不是”留言“。

目录索引

  1. 界面管理
  2. 控件基本操作
  3. 数据操作
  4. 列表/树形控件
  5. 界面导航
  6. 对话框与消息
  7. 文件操作
  8. 画布绘图
  9. 高级控件
  10. 事件处理
  11. 工具函数
  12. 布局管理
  13. 样式设置
  14. 动画效果
  15. 网络与通信

1. 界面管理

API名称
功能描述
参数类型
返回值
RunApplication
运行PyMe工程,启动主界面
uiClass, deiconify, projName, InitCheckFunc
无
DestroyUI
销毁指定界面
uiName, result, animation
无
GetElement
获取指定控件的实例
uiName, elementName
控件对象
IsUIExist
判断界面是否存在
uiName
bool
SetVisible
设置控件显示或隐藏
uiName, elementName, Visible
无
SetEnable
设置控件可用或禁用
uiName, elementName, Enable
无
SetWindowTitle
设置窗口标题
uiName, title
无
SetWindowTransparency
设置窗口透明度
uiName, alpha
无
SetUIRootSize
设置界面根大小
uiName, width, height, scale
无
GetUIRootSize
获取界面根大小
uiName, init
(width, height)
MaximizeUI
最大化窗口
uiName
无
MinimizeUI
最小化窗口
uiName
无
RestoreUI
恢复窗口
uiName
无
HideUI
隐藏窗口
uiName
无

2. 控件基本操作

API名称
功能描述
参数类型
返回值
SetText
设置控件的文本内容
uiName, elementName, textValue
无
GetText
获取控件的文本内容
uiName, elementName
字符串
SetBGColor
设置控件背景色
uiName, elementName, RGBColor
无
GetBGColor
获取控件背景色
uiName, elementName
颜色值
SetTextColor
设置控件文字颜色
uiName, elementName, RGBColor
无
GetTextColor
获取控件文字颜色
uiName, elementName
颜色值
SetFont
设置控件字体
uiName, elementName, fontName, fontSize, fontWeight, fontSlant, fontUnderline, fontOverstrike
无
CreateFont
创建字体对象
fontName, fontSize, fontWeight, fontSlant, fontUnderline, fontOverstrike
字体对象
SetImage
设置控件背景图片
uiName, elementName, imagePath, autoSize, format, state
无
SetImageFromURL
从URL设置图片
uiName, elementName, url, autoSize
无
RemoveImage
删除控件背景图片
uiName, elementName
无
GetImage
获取控件图片
uiName, elementName, state
图片对象
SetCursor
设置控件光标样式
uiName, elementName, cursor
无
HideCursor
隐藏控件光标
uiName
无
GetCursorPosition
获取光标位置
uiName, elementName
(x,y)坐标
SetRoundedRectangle
设置控件圆角
uiName, elementName, WidthEllipse, HeightEllipse
无
GetElementXYWH
获取控件位置大小
uiName, elementName
(x,y,width,height)
SetElementXYWH
设置控件位置大小
uiName, elementName, x, y, width, height
无

3. 数据操作

API名称
功能描述
参数类型
返回值
SetCurrentValue
设置控件的当前值
uiName, elementName, value
无
GetCurrentValue
获取控件的当前值
uiName, elementName
任意类型
SetCurrentIndex
设置选中索引
uiName, elementName, index
无
GetCurrentIndex
获取选中索引
uiName, elementName
整数
SetValueList
设置值列表
uiName, elementName, valueList
无
GetValueList
获取值列表
uiName, elementName
列表
AddUserData
添加用户数据
uiName, elementName, dataName, datatype, datavalue, isMapToText
无
GetUserData
获取用户数据
uiName, elementName, dataName
任意类型
DelUserData
删除用户数据
uiName, elementName, dataName
无
SetUserData
设置用户数据
uiName, elementName, dataName, datavalue
无
AddTKVariable
添加Tkinter变量
uiName, elementName, defaultValue
变量对象
SetTKVariable
设置Tkinter变量
uiName, elementName, value
无
GetTKVariable
获取Tkinter变量
uiName, elementName
变量值
SetTKAttrib
设置Tkinter属性
uiName, elementName, AttribName, attribValue
无
GetTKAttrib
获取Tkinter属性
uiName, elementName, AttribName
属性值

4. 列表/树形控件

API名称
功能描述
参数类型
返回值
AddLineText
增加一行文字
uiName, elementName, text, lineIndex, textTag, set_see
无
DelAllLines
清空所有行
uiName, elementName
无
GetLineText
获取指定行文字
uiName, elementName, lineIndex
字符串
SetLineText
设置指定行文字
uiName, elementName, lineIndex, text
无
Clear
清空控件内容
uiName, elementName
无
AddTreeItem
增加树形项
uiName, elementName, parentItem, insertItemPosition, itemName, itemText, itemValues, iconName, tag
项对象
ExpandTreeView
展开树所有节点
uiName, elementName
无
DelTreeItem
删除树项
uiName, elementName, itemName
无
DelAllTreeItem
删除所有树项
uiName, elementName
无
GetSelectedTreeItem
获取选中树项
uiName, elementName
项对象
SelectTreeItem
选中树项
uiName, elementName, itemName
无
AddRowText
插入一行
uiName, elementName, rowIndex, values, tag
行索引
AddMultiRowText
批量插入多行
uiName, elementName, rowIndex, rowValuesList, tagList
起始索引
GetAllRowTextList
获取所有行数据
uiName, elementName
二维列表
GetRowTextList
获取指定行数据
uiName, elementName, rowIndex
列表
GetColumnTextList
获取指定列数据
uiName, elementName, columnIndex
列表
GetCellText
获取单元格文本
uiName, elementName, rowIndex, columnIndex
字符串
SetCellText
设置单元格文本
uiName, elementName, rowIndex, columnIndex, text
无
DeleteRow
删除指定行
uiName, elementName, rowIndex
无
DeleteRows
删除多行
uiName, elementName, rowIndexList
无
DeleteAllRows
删除所有行
uiName, elementName
无
SortListView
排序列表
uiName, elementName, columnIndex, reverse, sortkeyDict
无
SetRowStyle
设置行样式
uiName, elementName, rowIndex, bgColor, fgColor, textFont
无
SetRowBGColor
设置行背景色
uiName, elementName, rowIndex, bgColor
无
GetSelectedRowIndex
获取选中行索引
uiName, elementName
列表
SelectRow
选中指定行
uiName, elementName, beginRowIndex, endRowIndex
无
SetCellEntry
设置单元格为输入框
uiName, elementName, rowIndex, columnIndex, callback
无
SetCellComboBox
设置单元格为下拉框
uiName, elementName, rowIndex, columnIndex, initList, callback
无
SetCellCheckBox
设置单元格为复选框
uiName, elementName, rowIndex, columnIndex, selected
无
GetCellBox
获取单元格位置
uiName, elementName, rowIndex, columnIndex
(x,y,width,height)

5. 界面导航

API名称
功能描述
参数类型
返回值
CallUIDialog
调用模式对话框
uiName, topmost, toolwindow, grab_set, wait_window, animation, params
数据字典
LoadUIDialog
嵌入加载界面
uiName, elementName, targetUIName, params, ignoreSameUI
界面实例
GoToUIDialog
跳转到另一个界面
uiName, targetUIName, params
无
AddUIDialog
添加界面到指定位置
uiName, elementName, targetUIName, x, y, params
界面实例
AddPage
增加NoteBook选项页
uiName, elementName, title, iconFile, importUI
无
SelectPage
选中NoteBook页面
uiName, elementName, index
无
GetSelectedPageIndex
获取当前选中页索引
uiName, elementName
整数
GetPage
获取指定页
uiName, elementName, index
页面对象
GetPageText
获取页面标题
uiName, elementName, index
字符串
GetPageIndex
根据标题获取页索引
uiName, elementName, title
整数
HidePage
隐藏页面
uiName, elementName, index
无
DelPage
删除页面
uiName, elementName, index
无
AddPanedWindowPage
增加分割窗体页面
uiName, elementName, WidthOrHeight
页面对象
DelPanedWindowPage
删除分割窗体页面
uiName, elementName, index
无

6. 对话框与消息

API名称
功能描述
参数类型
返回值
MessageBox
信息对话框
text, title, type, parent
无
AskBox
Yes/No选择对话框
title, text, parent
bool
AskCancelBox
Yes/No/Cancel对话框
title, text, parent
"Yes"/"No"/"Cancel"
InputBox
输入对话框
title, prompt, initialvalue, parent
字符串
InputDialog
自定义输入对话框
width, lines, bgColor, titleText, promptText, defaultText, callBackFunction
字符串
SelectDirectory
目录选择对话框
title, initDir, parent
路径字符串
OpenFile
文件打开对话框
title, filetypes, initDir, multi
路径字符串或列表
SaveFile
文件保存对话框
title, filetypes, initDir, initialFile, defaultextension
路径字符串
SelectColor
颜色选择对话框
title
颜色值

7. 文件操作

API名称
功能描述
参数类型
返回值
ReadFromFile
从文件读取内容
filePath, encoding, autoEval
文件内容
WriteToFile
写入内容到文件
filePath, content, encoding, append
bool
CopyFile
复制文件
srcFile, dstFile, coverMode
bool
MoveFile
移动文件
srcFile, dstFile, coverMode
bool
DeleteFile
删除文件
dstFile
无
CreateDir
创建目录
dstDir, coverMode
bool
DeleteDir
删除目录
srcDir
无
CopyDir
复制目录
srcDir, dstDir, coverMode
bool
MoveDir
移动目录
srcDir, dstDir, coverMode
bool
WalkAllResFiles
遍历目录获取文件
parentPath, alldirs, extName
文件列表
GetFileMD5
获取文件MD5
srcFile
MD5字符串
CompareFileMD5
比较文件MD5
srcFile, dstFile
bool
CheckExist
判断文件是否存在
srcDir
bool
CheckIsDir
判断是否为目录
srcDir
bool
GetFileExtension
获取文件扩展名
srcFile
扩展名
ImportResources
导入资源文件
srcFile, coverMode
bool
GetResourcePath
获取资源文件路径
FileName
路径字符串

8. 画布绘图

API名称
功能描述
参数类型
返回值
DrawLine
画线
uiName, drawCanvasName, x1, y1, x2, y2, Anchor, color, width, dash, shapeTag
shapeTag
DrawArrow
画箭头
uiName, drawCanvasName, x1, y1, x2, y2, Anchor, color, width, dash, shapeTag
shapeTag
DrawRectangle
画矩形
uiName, drawCanvasName, x1, y1, x2, y2, Anchor, color, outlinecolor, outlinewidth, dash, shapeTag
shapeTag
DrawCircle
画圆
uiName, drawCanvasName, x1, y1, x2, y2, Anchor, color, outlinecolor, outlinewidth, dash, shapeTag
shapeTag
DrawRoundedRectangle
画圆角矩形
uiName, drawCanvasName, x1, y1, x2, y2, Anchor, color, outlinecolor, outlinewidth, dash, roundRadius, shapeTag
shapeTag
DrawTriangle
画三角形
uiName, drawCanvasName, direction, x1, y1, x2, y2, Anchor, color, outlinecolor, outlinewidth, dash, shapeTag
shapeTag
DrawDiamond
画菱形
uiName, drawCanvasName, x1, y1, x2, y2, Anchor, color, outlinecolor, outlinewidth, dash, shapeTag
shapeTag
DrawCylinder
画圆柱
uiName, drawCanvasName, x1, y1, x2, y2, Anchor, color, outlinecolor, outlinewidth, dash, shapeTag
shapeTag
DrawStar
画星星
uiName, drawCanvasName, x1, y1, x2, y2, Anchor, color, outlinecolor, outlinewidth, dash, shapeTag
shapeTag
DrawText
写字
uiName, drawCanvasName, x, y, Anchor, text, textFont, color, anchor, shapeTag
shapeTag
DrawImage
显示图片
uiName, drawCanvasName, x1, y1, x2, y2, Anchor, imagefile, shapeTag
shapeTag
DrawButton
画按钮
uiName, drawCanvasName, x1, y1, x2, y2, Anchor, text, textcolor, textFont, fillcolor, outlinecolor, outlinewidth, dash, shapeTag
shapeTag
DeleteShape
删除图形
uiName, drawCanvasName, shapeTag
无
SetShapeFillColor
设置填充颜色
uiName, drawCanvasName, shapeTag, color
无
SetShapeOutlineColor
设置边框颜色
uiName, drawCanvasName, shapeTag, color
无
SetShapeLineWidth
设置线条宽度
uiName, drawCanvasName, shapeTag, width
无
SetShapeImage
更换图片
uiName, drawCanvasName, shapeTag, imageFile, angle
无
SetShapeText
设置文字
uiName, drawCanvasName, shapeTag, text, color
无
GetShapeText
获取文字
uiName, drawCanvasName, shapeTag
(text, color)
GetShapeRect
获取图形位置
uiName, canvasName, shapeTag
(x1,y1,x2,y2)
SetCanvasBGImage
设置画布背景图
uiName, elementName, imagePath, wrapType
无
EraserCanvas
擦除区域
uiName, drawCanvasName, x1, y1, x2, y2
无
SetCanvasGridBG
设置网格背景
uiName, drawCanvasName, bgcolor, tile_width, tile_height
无

9. 高级控件

API名称
功能描述
主要方法
返回值类型
Calendar
日历控件
SetBGColor(), GetDate(), SetDate(), SetRangeOfYears(), SetBtnCallBackFunction()
控件对象
DatePicker
日期选择器
SetBGColor(), GetDate(), SetSeparatorChar(), SetBtnCallBackFunction()
控件对象
SwitchButton
开关按钮
SetCurrValue(), GetCurrValue(), SetOnStateBGColor(), SetOffStateBGColor(), SetOnStateText(), SetOffStateText(), SetSwitchCallBackFunction()
控件对象
Slider
滑动条
SetMinValue(), SetMaxValue(), SetCurrValue(), GetCurrValue(), SetBarBGColor1(), SetBarBGColor2(), SetBarButtonColor(), SetBarImage1(), SetBarImage2(), SetValueChangedFunction()
控件对象
ProgressDial
进度转盘
SetBGColor(), SetFillColor(), SetCurrValue(), SetMaxValue(), SetBeginAngle(), SetEndAngle(), SetSections(), SetPersentage(), SetFont(), SetTextColor()
控件对象
Navigation
导航栏
AddItem(), DelItem(), Clear(), SetCurrentIndex(), GetCurrentIndex(), SetDirection(), SetItemBGColor(), SetItemFGColor(), SetItemImage(), SetNavigationCallBackFunction()
控件对象
ListMenu
列表菜单
AddTitle(), AddItem(), DelTitle(), DelItem(), Clear(), ExpandAllTitle(), SetTitleBGColor(), SetTitleFGColor(), SetItemBGColor(), SetItemFGColor(), SetListMenuCallBackFunction()
控件对象
SwitchPage
切换页面
AddPage(), DelPage(), Clear(), SetCurrentIndex(), SetProgressBarLeft(), SetProgressBarTop(), Play(), SetPageClickCallBackFunction()
控件对象
ShowCase
列表页
AddItem(), AddItemUI(), DelItem(), Clear(), SetItemWidth(), SetItemHeight(), SetItemSpacing(), SetItemBGColor(), SetItemFGColor(), SetClickItemCallBackFunction()
控件对象
CustomEntry
自定义输入框
SetText(), GetText(), SetTipText(), SetLeftIcon(), SetRightIcon(), SetRestriction(), SetLeftIconClickFunction(), SetRightIconClickFunction(), SetTextChangedFunction()
控件对象
CustomText
自定义文本框
SetText(), GetText(), SetAutoWrap(), SetHScrollBar(), SetVScrollBar(), InsertText(), DeleteContent(), GetCurrentLine()
控件对象
CustomNoteBook
可关闭的NoteBook
继承NoteBook功能,支持关闭按钮
控件对象

10. 事件处理

API名称
功能描述
参数类型
返回值
SetBindEventFunction
设置事件响应函数
uiName, elementName, eventName, callbackFunction
无
CreateToolTip
创建提示信息
uiName, elementName, tipText, bgColor, fgColor, inTop
无
SetControlAcceptDrop
设置接受拖拽文件
uiName, elementName, functionCallback
无
SetElementScrollbar
设置滚动条
uiName, elementName, orient
无
EventFunction_Adaptor
事件适配器
fun, params
事件函数
CommandFunction_Adaptor
命令适配器
fun, uiName, widgetName
命令函数
SetValueChangedFunction
设置值变化函数
fun, uiName, widgetName
函数对象

11. 工具函数

API名称
功能描述
参数类型
返回值
GetCurrTime
获取当前时间
splitChar
时间字符串
GetCurrDate
获取当前日期
splitChar
日期字符串
Sleep
暂停等待
second
无
RandNumber
生成随机数
begin, end
整数
IsMobilePhone
判断手机号
text
bool
IsEmail
判断邮箱
text
bool
IsNumeric
判断数字
text
bool
IsInt
判断整数
text
bool
IsFloat
判断浮点数
text
bool
IsAlphanumeric
判断字母或数字
text
bool
CheckSpecialChar
检查特殊字符
text
bool
GetParentCallFunc
获取调用函数信息
无
[函数名, 参数列表]
EnumFontName
枚举系统字体
无
字体列表
CurrentThreadIsMainThread
判断是否主线程
无
bool

12. 布局管理

API名称
功能描述
参数类型
返回值
SetControlPlace
设置绝对/相对位置
uiName, elementName, x, y, w, h, anchorpoint, visible, modify
无
SetControlPack
设置打包布局
uiName, elementName, fill, side, padx, pady, expand, width, height
无
SetControlGrid
设置表格布局
uiName, elementName, row, column, rowspan, columnspan
无
GetControlPlace_AnchorPoint
获取锚点
uiName, elementName
锚点字符串
UpdateElementPlace
更新控件位置
uiName, elementName, HScrollBarOffsetY, VScrollBarOffsetX
无
UpdateAllElementPlace
更新所有控件位置
uiName, HScrollBarOffsetY, VScrollBarOffsetX
无
SetElementLayer
设置层次升降
uiName, elementName, direction
无
CenterDlg
对话框居中
uiName, popupDlg, dw, dh, keepHide, popui_xy
无

13. 样式设置

API名称
功能描述
参数类型
返回值
SetRadioButtonSelectedColor
设置单选按钮选中颜色
uiName, elementName, BGColor, FGColor
无
SetCheckButtonSelectedColor
设置复选框选中颜色
uiName, elementName, BGColor, FGColor
无
SetRadioButtonPyMeStyle
设置自定义单选按钮样式
uiName, elementName, radiovalue, fgColor, SelectedFGColor, visible
无
SetCheckButtonPyMeStyle
设置自定义复选框样式
uiName, elementName, checkbutton_value, fgColor, SelectedFGColor, visible
无
SetComboBoxListColor
设置下拉框列表颜色
uiName, elementName, BGColor, FGColor
无
SetItemBGColor
设置选项背景色
uiName, elementName, lineIndex, color
无
SetItemFGColor
设置选项文字色
uiName, elementName, lineIndex, color
无
ReadStyleFile
读取样式文件
filePath
样式字典

14. 动画效果

API名称
功能描述
参数类型
返回值
PlayAction_MoveTo
移动到指定位置
uiName, elementName, targetX, targetY, duration, fps
无
PlayAction_MoveBy
移动一定距离
uiName, elementName, moveX, moveY, duration, fps
无
PlayAction_ScaleTo
缩放到指定大小
uiName, elementName, anchor, scaleW, scaleH, duration, fps
无
LoadGIF
播放GIF动画
uiName, elementName, imagefile, width, height
图片对象
StopGIF
停止GIF动画
uiName, elementName
无
updateGIFFrame
更新GIF帧
uiName, elementName
无

15. 网络与通信

API名称
功能描述
参数类型
返回值
DownLoadFileProgressDialog
下载文件进度对话框类
uiName, showDialog, title, bgColor, fgColor
对话框对象
downloadFileFromURL
从URL下载文件
url, saveToDir, ReDownLoadIfExist, autoExtractZip, progressCallBack, finishCallBack, errorCallBack
无
downloadFilesFromURLList
下载多个文件
urllist, saveToDir, ReDownLoadIfExist, progressCallBack, finishCallBack, errorCallBack
无
extractZipFile
解压ZIP文件
ZipFile, ExtractDir
bool

16. 动态创建控件

API名称
功能描述
参数类型
返回值
CreateLabel
创建Label
uiName, parentName, elementName
控件对象
CreateButton
创建Button
uiName, parentName, elementName
控件对象
CreateEntry
创建Entry
uiName, parentName, elementName
控件对象
CreateText
创建Text
uiName, parentName, elementName
控件对象
CreateListBox
创建ListBox
uiName, parentName, elementName
控件对象
CreateComboBox
创建ComboBox
uiName, parentName, elementName
控件对象
CreateRadioButton
创建RadioButton
uiName, parentName, elementName, groupName, defaultValue, style
控件对象
CreateCheckButton
创建CheckButton
uiName, parentName, elementName, defaultValue, style
控件对象
CreateFrame
创建Frame
uiName, parentName, elementName
控件对象
CreateLabelFrame
创建LabelFrame
uiName, parentName, elementName
控件对象
CreateCanvas
创建Canvas
uiName, parentName, elementName
控件对象
CreateTreeView
创建TreeView
uiName, parentName, elementName
控件对象
CreateListView
创建ListView
uiName, parentName, elementName
控件对象
CreateNoteBook
创建NoteBook
uiName, parentName, elementName
控件对象
CreatePanedWindow
创建PanedWindow
uiName, parentName, elementName, orient
控件对象
CreateScale
创建Scale
uiName, parentName, elementName, orient
控件对象
CreateSpinBox
创建SpinBox
uiName, parentName, elementName
控件对象
CreateProgress
创建Progress
uiName, parentName, elementName, orient
控件对象
DestroyElement
删除指定控件
uiName, elementName
无


作者简介:码上工坊,探索用编程为己赋能,定期分享编程知识和项目实战经验。持续学习、适应变化、记录点滴、复盘反思、成长进步。

重要提示:本文主要是记录自己的学习与实践过程,所提内容或者观点仅代表个人意见,只是我以为的,不代表完全正确,欢迎交流讨论。

最新文章

随机文章