Oli
0
Q:

python gui

# 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())



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

#	enter widgets here

root.mainloop()
5
### Answer to: "" ###

###
#  You can find thirteen gui libraries for python here:
#  https://medium.com/issuehunt/13-python-gui-libraries-a6196dfb694
#
#  Personally, I like "Kivy".
###
3
from tkinter import *

def changel():
    if l['text']!='Stop it!':
        l['text']='Stop it!'
    else:
        l['text']='Are you over?'

w = Tk()
l = Label(w,text = 'GUI Interface')
b = Button(w,text = 'A normal button',command = changel )
t = w.title('A normal window')
l.pack()
b.pack()
w.mainloop()
2
import tkinter as tk
#Importing the main module
window = tk.Tk()
window.mainloop()
1
from tkinter import *
root = Tk()
root.mainloop()
#Tkinter is the GUI module for Python.
3
# 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()
0
import tkinter
master = tkinter.Tk()
master.mainloop()
1
m.mainloop()
0

New to Communities?

Join the community