我试图将我的 python 可执行文件放入一个名为“folder.app”的文件夹,然后放入“Contents”,然后放入“MacOs”,但是每当我尝试打开它时,它什么都不做。这是 Python 代码:
#!/usr/bin/env python3
import tkinter as tk
from PIL import Image, ImageTk
import time
import os
import ast
#other stuff
f = open("/Users/mimmo/ssh_login_system/login_info.txt", "r")
contents = f.read()
f.close()
users = ast.literal_eval(contents)
#variables
stuff = ""
newlist = []
login = ""
inp = ("| => ")
rw = tk.Tk()
rw.title("Login")
rw.configure(bg="grey14")
rw.geometry("500x200")
def login(self):
username = e1.get()
password = e2.get()
if username in users:
if password == users[username]:
rw.destroy()
print ("\nlogin successful!\n")
os.system("python3 connect")
a = tk.Label(rw, text="Username:", fg='white', bg='grey14').grid(row=0)
b = tk.Label(rw, text="Password:", fg='white', bg='grey14').grid(row=1)
e1 = tk.Entry(rw)
e2 = tk.Entry(rw, show="*")
e2.bind("", login)
e1.grid(row=0, column=1)
e2.grid(row=1, column=1)
rw.mainloop()
慕村9548890
相关分类