所以我的A级课程明天就要交了,我决定昨天重新开始(愚蠢的ik)。我正在为Dijkstra做一个基础教育,但首先我想添加一个登录系统。我有一个工作系统,如果我打开csv,并将用户名、密码和功能直接写入其中。我只需要弄清楚如何在程序中添加创建新帐户的能力,因为我已经可以读取csv并检索信息。任何想法都值得赞赏:)
我从
开始
def新用户(自身):
newuser=self.logbtn.get()=1
但是我不知道从那里走到哪里:/
class LoginFrame(Frame):
def __init__(self, master):
super().__init__(master)
self.label_username = Label(self, text="Username")
self.label_password = Label(self, text="Password")
self.entry_username = Entry(self)
self.entry_password = Entry(self, show="*")
self.label_username.grid(row=0, sticky=E)
self.label_password.grid(row=1, sticky=E)
self.entry_username.grid(row=0, column=1)
self.entry_password.grid(row=1, column=1)
self.checkbox = Checkbutton(self, text="New Account")
self.checkbox.grid(columnspan=2)
self.logbtn = Button(self, text="Login", command=self.login)
self.logbtn.grid(columnspan=2)
self.pack()
the 'self.checkbox' part is what i want to tick when creating a new user,
which will take the username and password, write it to the csv with the option
to choose 'student' or 'teacher'and add it to the end of existing users however making a new function is pointless
as i dont know how to write to a csv.
目前没有回答
相关问题 更多 >
编程相关推荐