fork download
  1.  
  2. import pyautogui
  3. import pandas as pd
  4. import tkinter as tk
  5. from time import sleep
  6.  
  7.  
  8. # メインウィンドウ作成
  9. root = tk.Tk()
  10. #メインウィンドウのタイトルを変更
  11. root.title("クリック君")
  12. #メインウィンドウを640x480にする
  13. root.geometry("160x50")
  14.  
  15. # 座標をフォーマット
  16. def timer():
  17. px,py = pyautogui.position()
  18. label['text'] = '{},{}'.format(px,py)
  19. root.after(10, timer)
  20.  
  21.  
  22. #ラベルを追加
  23. label = tk.Label(root)
  24. label.place(x=10, y=10)
  25.  
  26.  
  27.  
  28. """
  29. Memo.csv
  30. 25,5,0
  31. 500,500,1
  32. """
  33.  
  34.  
  35. # csv読み込み
  36. df = pd.read_csv('Memo.csv', header=None)
  37. # リスト化
  38. l=df.values.tolist()
  39. # csvをintに変換
  40. [ int(j) for i in l for j in i]
  41.  
  42.  
  43. # 処理を仕分ける 右クリック or 左クリック
  44. def Sample():
  45. for i in l:
  46. if i[2]==0:
  47. pyautogui.click(i[0],i[1])
  48. sleep(0.20)
  49. elif i[2]==1:
  50. pyautogui.rightClick(i[0],i[1])
  51. sleep(0.20)
  52. else:
  53. pass
  54.  
  55.  
  56. # ボタンを追加
  57. button = tk.Button(root, text="ボタン", command=Sample)
  58. button.place(x=90, y=5)
  59.  
  60. # 開始
  61. timer()
  62.  
  63. #rootを表示し無限ループ
  64. root.mainloop()
  65.  
  66.  
Runtime error #stdin #stdout #stderr 0.01s 27656KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
Traceback (most recent call last):
  File "./prog.py", line 2, in <module>
ImportError: No module named 'pyautogui'