I am using the Button, Entry, Label element, as well as using winfo_screenwidth(), winfo_screenwidth(), and the geometry() function for my main window. On the Entry elements I am only using the get() and delete() functions.
from Tkinter import *
def main():
window = Tk()
window.title('cool stuff')
width = 750
height = 60
screenw = window.winfo_screenwidth()
screenh = window.winfo_screenheight()
posx = (screenw/2) - (width/2)
posy = (screenh/2) - (height/2)
window.geometry('%dx%d+%d+%d' % (width, height, posx, posy))
Label(window, text='enter text: ').pack(side=LEFT)
textEntry = Entry(window)
textEntry.config(width=16)
textEntry.pack(side=LEFT)
submitButton = Button(window, text='Submit', width=12, command=lambda: buttonCallback(textEntry))
submitButton.pack()
window.mainloop()
# in buttonCallback Entry.get() and Entry.delete() functions are used...
Is there a way to make my imports weigh less in this scenario? I am trying to compile the python file to .exe, but it requires a lot of files by its side to function. It would also make sense to shrink down imports in a lot of other cases, because I guess you'd want less overhead for your python files to run faster.