Answers for "gui definition in python"

1

python gui

# 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()
Posted by: Guest on November-07-2020
0

gui def python

# main library is tkinter so lets go
import tkinter as tk
root = tk.Tk()
#root.geometry("widthxheight+spcefromleft+spacefromright") lets set h and w
root.geometry("500x200+0+0")
# loop your window 
root.mainloop()
Posted by: Guest on September-11-2021

Python Answers by Framework

Browse Popular Code Answers by Language