test.py 668 B

1234567891011121314151617181920212223242526272829303132
  1. #!/usr/bin/env python
  2. # -*- encoding: utf-8 -*-
  3. '''
  4. @Contact : liuyuqi.gov@msn.cn
  5. @Time : 2022/10/05 05:47:23
  6. @License : Copyright © 2017-2022 liuyuqi. All Rights Reserved.
  7. @Desc : TcpServer.py 读写 out.py
  8. '''
  9. import pyautogui
  10. import time
  11. from KeyboardManager import key_press
  12. time.sleep(2)
  13. with open('./TcpServer.py', encoding='UTF-8') as f:
  14. while True:
  15. line = f.readline()
  16. if not line:
  17. break
  18. print(line)
  19. #pyautogui.typewrite(line)
  20. #key_press("home")
  21. for c in line:
  22. out = open('out.py','a')
  23. out.write(c)
  24. out.close()
  25. time.sleep(0.001)
  26. # for line in content:
  27. # print(line)
  28. # print('\n')
  29. # pyautogui.typewrite('\n')