Linux Gui 窗口对话和窗口操作

zenity

可以实现窗口对话

eg: 

zenity --error --width 300 --text "Permission denied. Cannot write to the file."
ChosenDate=$(zenity --calendar --text "Choose a date" --title "How-To Geek Rota" --day 1 --month 9 --year 2019);
echo $ChosenDate
Response=$(zenity --entry --text "Enter your search term" --title "Howe-To Geek" --entry-text=""); echo $Response

Python GUI Frameworks

Tkinter

优点:自带lib,不需要安装,轻量级,适合新手

缺点:gui风格老旧,组件较少

PyQt

优点:丰富的架构组件,文档和社区多,适合complex GUI projects

缺点: 需要license, 相比Tkinter学习较难

TCL/TK

linux command: wish test.tcl

destroy  .buttons
toplevel .buttons
wm title .buttons "Buttons"
set count 0
proc add_button {title command} {
  global count
  button .buttons.$count -text $title -command $command
  pack   .buttons.$count -side top -pady 1 -padx 1 -fill x
  incr count
}

#######################################
####                               ####
####     Change these lines to     ####
####     add your own buttons      ####
####                               ####
#######################################
add_button "Resize Main" { wm geometry . 464x650+0+0  }
add_button "Hello"       { puts "Hello there"         }
add_button "Goodbye"     { puts "Cheerio"             }
add_button "Exit"        { exit                       }

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值