Vi posto un esempio:
import Tkinter
from Tkinter import *
class MiaApp:
def __init__(self, parent):
self.root = parent
self.quadro = Frame(parent,
borderwidth = 2,
relief = RIDGE)
self.quadro.pack(expand = YES,
fill = BOTH)
self.Quadro_pulsanti= LabelFrame(self.quadro,
bd = 2,
text = "RISOLUZIONE SCHERMO:",
relief = RIDGE)
self.Quadro_pulsanti.pack(expand = YES,
fill = BOTH,
padx = 10,
pady = 10)
self.button1 = Button(self.Quadro_pulsanti,
text='1280 x 1024',
activebackground = "azure",
width = 20,
relief = RAISED,)
self.button1.pack(side = LEFT,
padx = 20,
pady = 15)
self.button2 = Button(self.Quadro_pulsanti,
text='1024 x 768',
activebackground = "azure",
width = 20,
relief = RAISED)
self.button2.pack(side = LEFT,
padx = 20,
pady = 15)
root = Tk()
miaApp = MiaApp(root)
root.mainloop()
da linux per farlo partire devo digitare sul terminale:
python nome_file.py
e se invece volessi renderlo avviabile con un semplice doppio click,
cosa dovrei fare?