Tkinter可执行文件的Windows

我为我的一个朋友介绍了一个抽搐的聊天投票系统,这个系统是一个抽搐的stream媒体,读取抽搐聊天,观众可以对某些选项进行投票,然后显示在一个小的GUI窗口中。

现在我想发送我的应用程序给他,但我不希望他必须安装python,库等,所以我想只能发送一个.exe文件。

我做了一些Googlesearch,但我遇到了一些问题。 其中一个问题是:我在Mac上,他在窗户上。 另外,我正在使用和导入多个python文件来运行我的脚本,这些文件有'Initialize.py','Socket.py','Read.py','Settings.py'和mainfile:'Run.py ”。

现在我的问题是,将所有这些文件合并成一个.exe文件,我可以给我的朋友,所以他可以简单地打开他的Windows机器上的程序,并使其工作?

感谢您的阅读,如果需要的话,这里是Run.py的代码(如果需要,也可以发布其他文件,但是我想现在它们不相关?):

import Tkinter as tk import time import socket from Read import getUser, getMessage from Socket import openSocket, sendMessage from Initialize import joinRoom from collections import OrderedDict class SampleApp(tk.Tk): voteAamount = 0 voteBamount = 0 voteCamount = 0 optieA = "" optieB = "" optieC = "" def __init__(self, *args, **kwargs): tk.Tk.__init__(self, *args, **kwargs) self['background']='black' self.overrideredirect(True) self.s = openSocket() joinRoom(self.s) self.readbuffer = "" self.voteA = tk.Label(self, text="", bg="black", fg="white", font="HouseSlant-Regular 30", anchor="w") self.voteA.pack() self.voteB = tk.Label(self,text="", bg="black", fg="white", font="HouseSlant-Regular 30", anchor="w") self.voteB.pack() self.voteC = tk.Label(self,text="", bg="black", fg="white", font="HouseSlant-Regular 30", anchor="w") self.voteC.pack() self.update_tekst() self.get_votes() # self.anderemethod() # self.after(500,self.get_votes) # self.after(500,self.update_tekst) def update_tekst(self): resultA = self.optieA+": "+str(self.voteAamount) resultB = self.optieB+": "+str(self.voteBamount) resultC = self.optieC+": "+str(self.voteCamount) self.voteA.configure(text=resultA) self.voteB.configure(text=resultB) self.voteC.configure(text=resultC) print("updated tekst!") # self.after(2000, self.update_tekst) def get_votes(self): # print "About to read" try: chat_data = self.s.recv(1024) except socket.timeout: self.after(500,self.get_votes) return self.readbuffer = self.readbuffer + chat_data print "Reading successful" temp = self.readbuffer.split('\n') self.readbuffer = temp.pop() #save the last (possibly incomplete) line for later if self.readbuffer == "": pass #no further messages in the queue #you should add a sleep time here for the sake of your hot NIC for line in temp: print(line) if "PING" in line: self.s.send("PONG :tmi.twitch.tv\r\n".encode()) break user = getUser(line) message = getMessage(line) print "{} typed: {}".format(user, message) if "!commands" in message: sendMessage(self.s, "'!voteA','!voteB','!voteC'") break #optie toevoegen !optieEen prikkelbaar if "!opties" in message: #print de laatste optieEen (by default is dat "lol") # print(optieEen) #!opties prikkelbaar woespoes normaal #a = de message, split de message, de delimiter is een spatie, en we splitten het 1 keer, en dan willen we het tweede list item hebben #want dat is het woord dat we nodig hebben, dus: # !optieEen prikkelbaar, dan is prikkelbaar [1] a = message.split(' ', 4)[1] b = message.split(' ', 4)[2] c = message.split(' ', 4)[3] d = message.split(' ', 4)[4] #post het nog ff in de chat, niet vergeten nog een string te maken van 'a' sendMessage(self.s, str(a)+str(b)+str(c)) #sla de nieuwe optie op in 'optieEen' self.optieA = str(a) self.optieB = str(b) self.optieC = str(c) # self.update() break #print het ff om te checken # print(optieEen) if "!voteA" in message and user != "appie_bot": self.voteAamount += 1 print(self.voteAamount) self.update_tekst() # time.sleep(1) # self.update() break if "!voteB" in message and user != "appie_bot": self.voteBamount += 1 print(self.voteBamount) self.update_tekst() # time.sleep(1) # self.update() break if "!voteC" in message and user != "appie_bot": self.voteCamount += 1 print(self.voteCamount) self.update_tekst() # time.sleep(1) # self.update() break if "!reset" in message: self.voteAamount = 0 self.voteBamount = 0 self.voteCamount = 0 self.update_tekst() # time.sleep(1) # self.update() self.update() self.after(500, self.get_votes) app = SampleApp() app.mainloop() 

我是否需要其他设置不会遇到tkinter GUI窗口的问题?

我想我也读过的地方,在Windows上我应该导入tkinter作为import tkinter而不是import Tkinter ,这是真的吗?