Este team especializado pasados ciertos días de trabajo y recopilar de datos, hallamos la respuesta, deseamos que resulte útil para ti en tu proyecto.
Ejemplo 1: etiqueta python tkinter
from Tkinter import *
root =Tk()
w =Label(root, text="Hello Tkinter!")
w.pack()
root.mainloop()
Ejemplo 2: tutorial de tkinter
#checkthis code first.
from tkinter import *
app =Tk()#The title of the project
app.title("The title of the project")#The size of the window
app.geometry("400x400")#Defining a funtion
def c():#Label
m =Label(app, text="Text")
m.pack()#Button
l =Button(app, text="The text of the Butoon", command=c)#Packing the Button
l.pack()
app.mainloop()#Quick Note :#When you put a command you should not use parentheses#l=Button(app, text="The text of the Butoon", command=c)#l=Button(app, text="The text of the Butoon", command=c())
Ejemplo 3: interfaz gráfica de usuario básica de tkinter
import tkinter as tk
root = tk.Tk()
root.title("my title")
root.geometry('200x150')
root.configure(background='black')#enterwidgets here
root.mainloop()
Ejemplo 4: interfaz gráfica de usuario de Python
#App python gui
import tkinter as tk
import webbrowser as wb
def Facebook():
wb.open('facebook.com')
def Instagram():
wb.open('instagram.com')
def Twitter():
wb.open('twitter.com')
def Youtube():
wb.open('youtube.com')
def Google():
wb.open('google.com')
window = tk.Tk()
window.title('Browser')
google = tk.Button(window, text='Google', command=Google)
youtube = tk.Button(window, text='Youtube', bg='red', fg='white', command=Youtube)
twitter = tk.Button(window, text='Twitter', bg='powder blue', fg='white', command=Twitter)
Instagram = tk.Button(window, text='Instagram', bg='white', fg='black', command=Instagram)
facebook = tk.Button(window, text='Facebook', bg='blue', fg='white', command=Facebook)
facebook.pack()
Instagram.pack()
twitter.pack()
youtube.pack()
google.pack()
window.mainloop()
Ejemplo 5: funciones que llaman a la creación tkinter fix
Make your event handler a lambda function, which calls your command()- in thiscaseget_dir()- with whatever arguments you want:
xbBrowse =Button(frameN, text="Browse...", font=fontReg, command=lambda : self.get_dir(xbPath))
Ejemplo 6: tutorial de tkinter
#Python 3.x
import tkinter
top = tkinter.Tk()#Code to add widgets will go here...
top.mainloop()#I recommend creating each tkinter window as a child classto a frame.#This keeps all methods related to the window encapsulated,and makes#yourcode alot more understandable and readable :)
Si eres capaz, puedes dejar una reseña acerca de qué te ha parecido esta noticia.
¡Haz clic para puntuar esta entrada!
(Votos: 0 Promedio: 0)