用于执行命令的Tkinter GUI控制台。
DevConsole的Python项目详细描述
开发控制台
DevConsole是一个开发人员控制台,它允许用户或开发人员使用控制台界面进行测试。 当您想在特定时间执行函数,而不想为测试设置一个超级复杂的系统时,这变得非常方便。在
“Command”类是一个类,它存储在执行命令时调用的函数/方法,以及 用于在控制台中调用命令的名称(注意:命令将被降低,因此即使是像 “退出”将被视为“退出”)。在
用法示例(Python代码):
fromDevConsole.ConsoleimportConsole,Commandconsole=Console("Console title","icon path","background color code")# Create a new console. all these parameters are optionaldeffunction():# The Function That Will Get Activated When A Command Is Executedprint("A Command Has Been Executed Through DevConsole")console.Log("You Just Executed A Command")# Writing A Line To The Consolecmd=Command("name",function)# Created a Command Object Called cmd and giving it a name and a function/method to call# The Name Of The Command Will Be the text used to call the commandconsole.RegisterCommand(cmd)# Register The Command That We Just Created, You Could Register As Many As You Wantconsole.mainloop()# Calls the tkinter.mainloop() function
更新0.2.2
将命令“WriteLine”更改为“Log” 增加了前缀和文本颜色选项 用法(Python):
^{pr2}$颜色参数中的颜色需要小写,与tkinter兼容。在
忘记在控制台类的RaiseError函数中添加self。这是固定的,它将正确地引发一个错误或跳过
更新0.2.1
增加了对在一个函数中添加命令列表的支持
command_list=[command1,command2]# Making A List Of Commandsconsole.RegisterCommands(command_list)# RegisterCommands() function added to the Console Class
修正错误:
更改了图标上的路径检查,使其现在可以工作,并且在尝试向窗口添加图标时不会收到AttributeError
升级功能(也许…)
- 自定义控制台窗口
- 项目
标签: