2022年1月7日 星期五

Python Tkinter – button

 Python Tkinter – button


#!/usr/bin/env python3

# -*- coding: utf-8 -*-


#import tkinter   # In Python 3.x

# import Tkinter   # In python 2.x. (Note Capital T)


# import everything from tkinter module

from tkinter import *


# create a tkinter window

root = Tk()


# Open window having dimension 100x100

root.geometry('100x100')


# Create a Button

btn1 = Button(root, text = 'Click me !', bd = '5',

command = root.destroy)


# Set the position of button on the top of window.

btn1.pack(side = 'top')


btn2 = Button(root, text = 'Click me !',

                command = root.destroy)

 

# Set the position of button on the top of window

btn2.pack(side = 'top')    


root.mainloop()


沒有留言:

張貼留言

Telegram Bot 即時告警推播 與 每 30 分鐘定時遙測回報

Telegram Bot 即時告警推播 與 每 30 分鐘定時遙測回報   將 Telegram Bot 即時告警推播 與 每 30 分鐘定時遙測回報 完整整合進程式中。 新增功能重點 Telegram 推播設定面板(區塊 2-B) :可直接輸入 Bot Token 與 ...