fork download
  1. import pyautogui
  2. import pygetwindow
  3. import ctypes
  4. import win32gui, sys
  5. import time
  6.  
  7. GIMP_titles = pygetwindow.getWindowsWithTitle('GIMP')
  8. for ti in GIMP_titles:
  9. if win32gui.FindWindow('gdkWindowToplevel', ti.title) != 0:
  10. GIMP_title = ti
  11.  
  12. GIMP_title.activate()
  13. print("tes" + GIMP_title.title)
  14. for n in range(30):
  15. act_win = pygetwindow.getActiveWindow()
  16. if act_win.title == GIMP_title.title:
  17. #print('GIMPがアクティブになりました')
  18. print(act_win.title)
  19. break
  20. time.sleep(0.5)
  21.  
  22. act_win = pygetwindow.getActiveWindow()
  23. if act_win.title == GIMP_title.title:
  24. t = 1 #print('GIMPがアクティブでループを終わりました')
  25. else:
  26. #print('GIMPが非アクティブでループを終わりました')
  27. sys.exit(0)
  28.  
  29. #print('終了')
  30. time.sleep(0.5)
  31. pyautogui.press('a')
  32. pyautogui.hotkey('ESC')
  33. time.sleep(0.5)
  34. pyautogui.hotkey('shift', 'nonconvert')
  35. time.sleep(2)
  36. pyautogui.press('t')
  37. time.sleep(2)
  38. pyautogui.hotkey('ctrl', 'r')
  39. #time.sleep(3)
  40. pyautogui.hotkey('hanja')
  41.  
Runtime error #stdin #stdout #stderr 0.04s 63368KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
Traceback (most recent call last):
  File "prog.py", line 1, in <module>
    import pyautogui
ImportError: No module named pyautogui