Gui en tkinter

Ejemplos de código

5
0

gui básica de tkinter

import tkinter as tk
root = tk.Tk()
root.title("my title")
root.geometry('200x150')
root.configure(background='black')

#	enter widgets here

root.mainloop()
4
0

tutorial de tkinter

# check this 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())
3
0

gui de python

import tkinter as tk
#Importing the main module
window = tk.Tk()
window.mainloop()
0
0

gui en tkinter

from tkinter import *
import os

# window
window = Tk()
window.geometry("450x450")
window.title("Gui App")
window.configure(bg="powder blue")

# Enter or user input in tkinter
filename = Entry(window, width=75)
filename.pack()

# Run file Function

def runFile():
  try:
  	os.startfile(filename.get())
   
  except:
    error = Label(window, text=f"No file found as {filename.get}")
    error.pack()
    
 # Run file button
open_file_button = Button(window, text="Run File", command=runFile)
open_file_button.pack()

window.mainloop()

En otros idiomas

Esta página está en otros idiomas

Русский
..................................................................................................................
English
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
한국어
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
ไทย
..................................................................................................................
中文
..................................................................................................................
Slovenský
..................................................................................................................
Балгарскі
..................................................................................................................
Íslensk
..................................................................................................................