Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 8a60fd1

Browse files
Added tkinter snippet
1 parent 27d8016 commit 8a60fd1

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
title: Hello, World!
3+
description: Creates a basic Tkinter window with a "Hello, World!" label.
4+
author: Legopitstop
5+
tags: app,hello-world,object-oriented
6+
---
7+
8+
```py
9+
from tkinter import Tk, Label
10+
11+
class App(Tk):
12+
def __init__(self):
13+
Tk.__init__(self)
14+
self.geometry("100x100")
15+
16+
self.lbl = Label(self, text='Hello, World!')
17+
self.lbl.pack(expand=1)
18+
19+
# Usage:
20+
root = App()
21+
root.mainloop()
22+
```

‎snippets/python/[tkinter]/icon.svg

Lines changed: 1 addition & 0 deletions
Loading[フレーム]

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /