Skip to content

Instantly share code, notes, and snippets.

@GravenilvecTV
Created February 18, 2019 20:12
Show Gist options
  • Save GravenilvecTV/2240add5bfb3d3fa53f9f98057cad63c to your computer and use it in GitHub Desktop.
Save GravenilvecTV/2240add5bfb3d3fa53f9f98057cad63c to your computer and use it in GitHub Desktop.
from tkinter import *
import webbrowser
class MyApp:
def __init__(self):
self.window = Tk()
self.window.title("My Application")
self.window.geometry("720x480")
self.window.minsize(480, 360)
self.window.iconbitmap("logo.ico")
self.window.config(background='#41B77F')
# initialization des composants
self.frame = Frame(self.window, bg='#41B77F')
# creation des composants
self.create_widgets()
# empaquetage
self.frame.pack(expand=YES)
def create_widgets(self):
self.create_title()
self.create_subtitle()
self.create_youtube_button()
def create_title(self):
label_title = Label(self.frame, text="Bienvenue sur l'application", font=("Courrier", 40), bg='#41B77F',
fg='white')
label_title.pack()
def create_subtitle(self):
label_subtitle = Label(self.frame, text="Hey salut à tous c'est Graven", font=("Courrier", 25), bg='#41B77F',
fg='white')
label_subtitle.pack()
def create_youtube_button(self):
yt_button = Button(self.frame, text="Ouvrir Youtube", font=("Courrier", 25), bg='white', fg='#41B77F',
command=self.open_graven_channel)
yt_button.pack(pady=25, fill=X)
def open_graven_channel(self):
webbrowser.open_new("http://youtube.com/gravenilvectuto")
# afficher
app = MyApp()
app.window.mainloop()
@oubleface
Copy link

Et merci Graven , ça fait un bout de temps que j'essaie d'apprendre Python mais je procrastinais tout le temps mais maintenant je suis à fond dessus et grâce à tes vidéos j'apprends plus plus que tout ce que j'ai fait en 3 ans de licence en développement de logiciel dans mon université so un grand merci
Thank you a lot .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment