gongjinmu
发表于 2021-3-22 12:59:35
讲的惟妙惟肖,通俗易懂,从B站来
xjy=lwy
发表于 2021-3-22 20:34:00
针不戳
zhao137817
发表于 2021-3-25 11:29:27
aaaaaa
LSY2318633503
发表于 2021-3-29 19:11:25
11
lonsvm
发表于 2021-4-1 15:27:58
签到
cyx0701
发表于 2021-4-2 16:39:05
优秀~
wwk12345
发表于 2021-4-15 22:14:58
666
吴棋铭
发表于 2021-4-17 11:38:14
本帖最后由 吴棋铭 于 2021-4-17 11:40 编辑
这个怎么办呢C:\Users\Administrator\Desktop
万魔
发表于 2021-4-19 11:58:27
import easygui as g;
import os;
import sys;
import pickle as p;
os.chdir(os.curdir);
filepath = g.fileopenbox(msg='打开一个二进制文件,存在就选择他,不存在就取消',title='通讯录');
print(filepath);
#with open(filepath,'rb') as f:
try:
with open(filepath,'rb') as f :
try:
fa = p.load(f);
f.close;
except EOFError:
fa = {};
except TypeError:
fa ={};
print('-|-a');
filepath='通讯录.pkl';
TongxunData = fa;
fs = open(filepath,'wb');
uersattribut = ['真实是姓名', '电话号码', 'QQ号码', '电子邮件'];
def Findname(name,zidian={}):
lisnamedata = zidian;
userdata = name+'的联系资料'
g.multenterbox(msg=userdata,title='通讯录',fields=uersattribut,values=lisnamedata)
#print('''
#|username | :%s|
#|reallyname | :%s|
#|telephonenumb| :%s|
#|qqwords | :%s|
#|e_mailwords| :%s|'''%(name,lisnamedata,lisnamedata,lisnamedata,lisnamedata));
return
def Addname(filea,newname=str(),zidian={}):
#reallyname = input('请输入真是姓名\n');
#telephonenumb = input('请输入电话号码\n');
#qqwords = input('请输入QQ号码\n');
#e_mailwords = input('请输入你的电子邮件地址\n');
#peopledata = ;
peopledata = g.multenterbox(msg='联系人资料',title='通讯录',fields=uersattribut);
zidian = peopledata;
p.dump(zidian,filea);
filea.flush();
return
def Modifynamedata(name,zidian={}):
#dataname =['reallyname','telephonenumb','qqwords','e_mailwords'];
#dataname = ['真实是姓名', '电话号码', 'QQ号码', '电子邮件'];
olddataname = zidian;
newdataname = g.multenterbox(msg='联系人资料',title='通讯录',fields=uersattribut,values=olddataname);
data=[]
for i in range(0,len(olddataname)):
#msga='你想修改%s的%s吗(yes/no)'%(name,dataname);
#ifg.buttonbox(msg=msga,title='通讯录',choices=['Yes','No']) == 'yes':
if olddataname == newdataname:
#msgb = "请输入你的%s:"%dataname;
#newelement = g.enterbox(msg=msgb,title='通讯录');
data.append(olddataname);
else:
data.append(newdataname);
zidian=data;
return
def Caozuo(datatelephon={}):
while True:
try:
#order = int(input('请输入命令find(1)add(2),modify(3)remove(4)esc(5)\n'));
order = g.buttonbox(msg='请操作',title='通讯录',choices=['查找联系人','添加联系啊人','修改联系人资料','删除联系人','退出']);
if order == '查找联系人':
gvename = g.enterbox(msg='请输入用户名',title='通讯录');
ifgvename in datatelephon.keys():
Findname(gvename, datatelephon);
continue
if order == '添加联系啊人':
gvename = g.enterbox(msg='请输入用户名',title='通讯录');
ifgvenamein datatelephon.keys():
Findname(gvename, datatelephon);
continue;
else:
gvename = gvename;
Addname(fs,gvename, datatelephon);
continue;
if order == '修改联系人资料':
gvename = g.enterbox(msg='请输入用户名',title='通讯录');
ifgvename in datatelephon.keys():
Modifynamedata(gvename,datatelephon);
p.dump(datatelephon, fs);
fs.flush();
continue
if order == '删除联系人':
gvename = g.enterbox(msg='请输入用户名',title='通讯录');
if gvename in datatelephon.keys():
datatelephon.__delitem__(gvename);
p.dump(datatelephon,fs);
fs.flush();
continue;
if order == '退出':
p.dump(datatelephon, fs);
break ;
g.msgbox(msg='没有此用户,请注册新用户',title='通讯录')
#print('没有此用户,请注册新用户')
continue;
except Exception as reason:
g.exceptionbox(reason);
print(datatelephon);
fs.close();
sys.exit();
Caozuo(datatelephon=TongxunData);
js8023mrf
发表于 2021-4-21 15:55:50
突然又有了信心
only1980yoy
发表于 2021-4-22 11:07:07
学习下
Salubrious
发表于 2021-4-25 00:25:00
显示图片那个和 显示文本 代码应该怎么写呀?
eg.buttonbox(msg = '看我帅吗?',image = ' ' ,choices = ‘帅’,‘不帅’,‘njadnjn’)
image =这里应该怎样填呀?
branze
发表于 2021-5-1 16:08:34
kaixin
branze
发表于 2021-5-4 11:58:04
少时诵诗书十四说四十三生三世少时诵诗书
爱吃肥肉的马
发表于 2021-5-5 22:04:30
ERROR: Invalid requirement: 'hu\\appdata\\local\\programs\\python\\python38\\lib\\site-packages'
Hint: It looks like a path. File 'hu\appdata\local\programs\python\python38\lib\site-packages' does not exist.
我安装的时候报这个错要怎么破啊
1790741005
发表于 2021-5-6 11:18:45
.
.
.
醉心东柳兮
发表于 2021-5-8 13:51:58
支持小甲鱼
1374708088
发表于 2021-5-18 08:55:00
找不到命令窗口是在哪里打开的
在下草民
发表于 2021-5-24 15:47:00
我怎么安装不了easygui
pk388
发表于 2021-5-31 19:58:34
单看这个不会运用,还是要多做练习试试