个人艺术照写真底层逻辑python简单窗⼝制作
依据:mofan python
代码来源:bilibili 视频
框架:tensorflow
库:tkinter(⽐较⽼,现在也有新的相关库)
网络搞笑图片(mofan python对于初学python,或者初⼊深度学习的伙伴们还是⽐较友好的。)
下图为实验结果图,可以点击下⽅两按钮,继续弹指令或操作。具体可在程序中更改窗⼝⼤⼩,相关指令,⽂字说明提⽰语等。
重庆景点
具体代码:
import tkinter as tk
from tkinter import messagebox # import this to fix messagebox error
import pickle
window = tk.Tk()
window.title('Welcome to xiao Python')
# ur information
tk.Label(window, text='Ur name: ').place(x=50, y=150)
tk.Label(window, text='Password: ').place(x=50, y=190)
var_usr_name = tk.StringVar()
var_usr_name.t('')
entry_usr_name = tk.Entry(window, textvariable=var_usr_name)
entry_usr_name.place(x=160, y=150)
var_usr_pwd = tk.StringVar()
entry_usr_pwd = tk.Entry(window, textvariable=var_usr_pwd, show='*')
entry_usr_pwd.place(x=160, y=190)
def usr_login():
usr_name = var_()
usr_pwd = var_()
try:
with open('usrs_info.pickle','rb')as usr_file:
usrs_info = pickle.load(usr_file)
except FileNotFoundError:
with open('usrs_info.pickle','wb')as usr_file:
五年级下册奥数题
usrs_info ={'admin':'admin'}
pickle.dump(usrs_info, usr_file)
if usr_name in usrs_info:
if usr_pwd == usrs_info[usr_name]:
is_sign_up = tk.messagebox.askyesno('Welcome',
'You have not signed up yet. Sign up today?')
if is_sign_up:
usr_sign_up()
def usr_sign_up():
def sign_to_Mofan_Python():
np = ()
npf = new_()
nn = ()
with open('usrs_info.pickle','rb')as usr_file:
exist_usr_info = pickle.load(usr_file)
if np != npf:
el:
exist_usr_info[nn]= np
with open('usrs_info.pickle','wb')as usr_file:
pickle.dump(exist_usr_info, usr_file)
window_sign_up.destroy()july缩写
window_sign_up = tk.Toplevel(window)
window_ry('350x200')
window_sign_up.title('Sign up window')
new_name = tk.StringVar()
new_name.t('')
tk.Label(window_sign_up, text='Ur name: ').place(x=10, y=10)
entry_new_name = tk.Entry(window_sign_up, textvariable=new_name)
助理医师资格证报考条件
entry_new_name.place(x=150, y=10)
new_pwd = tk.StringVar()
tk.Label(window_sign_up, text='Password: ').place(x=10, y=50)
entry_usr_pwd = tk.Entry(window_sign_up, textvariable=new_pwd, show='*')
entry_usr_pwd.place(x=150, y=50)
new_pwd_confirm = tk.StringVar()
酒瓶盆景tk.Label(window_sign_up, text='Confirm password: ').place(x=10, y=90)
entry_usr_pwd_confirm = tk.Entry(window_sign_up, textvariable=new_pwd_confirm, show='*')
entry_usr_pwd_confirm.place(x=150, y=90)
btn_comfirm_sign_up = tk.Button(window_sign_up, text='Sign up', command=sign_to_Mofan_Python) btn_comfirm_sign_up.place(x=150, y=130)
# login and sign up button
btn_login = tk.Button(window, text='Login', command=usr_login)
btn_login.place(x=170, y=230)
btn_sign_up = tk.Button(window, text='Sign up', command=usr_sign_up) btn_sign_up.place(x=270, y=230)
window.mainloop()
希望对⼤家有所帮助,⼀起加油!