Last active
December 21, 2018 04:34
-
-
Save ayutaz/a5af93ceb8bcc508d0df0a21738e5d82 to your computer and use it in GitHub Desktop.
GUI(tkinter)を使い,時刻を表示する No.2 ref: https://qiita.com/ayousanz/items/ac09dbfbb3d0f1d8a835
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ウインドウの時間が適度に更新されるようにする. | |
# 入力した時間にウインドウが作成される. | |
from tkinter import font | |
import tkinter | |
from datetime import datetime,time | |
def show_time(): | |
today_time=datetime.now() | |
label1 = tkinter.Label(root, text=today_time) | |
label1.pack(side="top") | |
font1 = font.Font(family='Helvetica', size=30, weight='bold') | |
print("現在の時間:"+str(today_time)) | |
label1.destroy() | |
root.after(1000,show_time) | |
root=tkinter.Tk() | |
root.title("timer") | |
root.geometry("400x300") | |
show_time() | |
root.mainloop() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment