マウス座標を取得する処理を書いて最後にループで回してるので自動更新できると思ったのですが
できてません。どの様にすれば良いのでしょうか?
#コード
python
1 2 3 4import pyautogui 5import tkinter as tk 6 7 8# メインウィンドウ作成 9root = tk.Tk() 10 11#メインウィンドウのタイトルを変更 12root.title("Tkinter test") 13 14 15#メインウィンドウを640x480にする 16root.geometry("360x480") 17 18 19 20 21def pushed(): 22 pass 23 24 25#マウス座標を取得する 26x=pyautogui.position() 27 28 29 30#ラベルを追加 31label = tk.Label(root, text=x) 32#表示 label.grid() 33label.place(x=10, y=10) 34label.update() 35#label.delete() 36 37 38button = tk.Button(root, text="ボタン", command=pushed) 39#button.grid() 40button.place(x=250, y=5) 41 42 43 44 45#rootを表示し無限ループ 46root.mainloop() 47 48
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2019/06/01 07:43
2019/06/01 08:00 編集