PySimpleGUI 的第一个桌面软件

最近学习了python风格的GUI模块,寻思着既然学了,就要学以致用,花了点时间,写了下面这个
简历软件。后面,可以通过接口 获取提交的数据,传到数据库里与网页交互。此软件我已经打包成 exe软件,直接windows电脑双击使用。

 

# -*- coding: utf-8 -*-
# @Time : 2019/1/18 9:46
# @Author : wujf
# @Email : 1028540310@qq.com
# @File : tkinter_02.py
# @Software: SublimText
sg.ChangeLookAndFeel('GreenTan') form = sg.FlexForm('PySimpleGUI入门软件', default_element_size=(40, 1)) column1 = [[sg.Text('个人评估', background_color='#d3dfda', justification='center', size=(10,1))], [sg.Spin(values=('1','2', '3','4','5','6', '7','8', '9','10'), initial_value='工作能力')], [sg.Spin(values=('1','2', '3','4','5','6', '7','8', '9','10'), initial_value='同事相处')], [sg.Spin(values=('1','2', '3','4','5','6', '7','8', '9','10'), initial_value='团队协作')]] layout = [ [sg.Text('个人简历', size=(30, 1), font=("Helvetica", 25)),sg.Text('Writer:Mr wu', size=(60, 1),font=("Helvetica",10))], [sg.Text('自我介绍', size=(60, 1),font=("Helvetica", 10))], [sg.InputText('执着于技术的探索,代码就是一切!')], [sg.Text('个人爱好')], [sg.Checkbox('游泳'), sg.Checkbox('看书'), sg.Checkbox('打羽毛球', default=True), sg.Checkbox('打保龄球'), sg.Checkbox('打兵球'), sg.Checkbox('打篮球'), sg.Checkbox('打棒球'), sg.Checkbox('唱歌'), sg.Checkbox('跳舞'), sg.Checkbox('玩游戏'), sg.Checkbox('旅游') ], [sg.Text('性别')], [sg.Radio('男 ', "RADIO1", default=True), sg.Radio('女', "RADIO1")], [sg.Text('出生')], [sg.Listbox(values=('1990年','1991年','1992年','1993年','1994年','1995年','1996年','1997年','1998年','1999年','2000年','2001年','2002年','2003年'), size=(30, 5))], [sg.Text('工作简介')], [sg.Multiline(default_text='This is the default Text should you decide not to type anything', size=(50, 5))], [sg.Text('工作经历')], [sg.Multiline(default_text='This is the default Text should you decide not to type anything', size=(70, 8))], [sg.Text('语言')], [sg.InputCombo(('汉语', '英语','德语', '法语','韩语', '意大利语','俄语', '日语','其他'), size=(20, 6)), sg.Text('语言能力'), sg.Slider(range=(1, 100), orientation='h', size=(20, 20), default_value=65)], [sg.InputCombo(('汉语', '英语','德语', '法语','韩语', '意大利语','俄语', '日语','其他'), size=(20, 6)), sg.Text('语言能力'), sg.Slider(range=(1, 100), orientation='h', size=(20, 20), default_value=65)], [sg.Text('你的学历')], [sg.Listbox(values=('高中','大专', '本科','硕士', '博士','海外引进人才'), size=(30, 5)), sg.Text('行业认知度'), sg.Slider(range=(1, 100), orientation='v', size=(5, 20), default_value=25), sg.Text('工作热情度'), sg.Slider(range=(1, 100), orientation='v', size=(5, 20), default_value=75), sg.Text('效率执行度'), sg.Slider(range=(1, 100), orientation='v', size=(5, 20), default_value=10), sg.Column(column1, background_color='#d3dfda')], [sg.Text('_' * 80)], [sg.Text('上传附件简历', size=(35, 1))], [sg.Text('目录', size=(15, 1), auto_size_text=False, justification='right'), sg.InputText('默认目录'), sg.FolderBrowse('浏览')], [sg.Submit('确认'), sg.Cancel('取消')] ] button, values = form.Layout(layout).Read() sg.Popup(button,values) (python3.0以上不再写成 sg.Msgbox())    

效果图:

 

打包生成的 桌面软件:

制作的界面UI效果有点丑,有兴趣的同学留言可以跟我私下探讨优化下。

PS:注意的是当你设置图标打包时,在源文件里面看不到它改变了,你要把它移动下别的目录,才能看到它时间上是替换图标成功了的。(神奇吧?)

 

转载于:https://www.cnblogs.com/wujf-myblog/p/10534959.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值