import time
import openpyxl as vb
import pyautogui
ZT = float(input("输入粘贴后暂停。。。秒"))
HC = float(input("输入回车后暂停/。。。秒"))
print('鼠标点击输入窗口,5秒后开始程序')
time.sleep(5)
wb = vb.load_workbook('./1111.xlsx')
sheet = wb.active
row_num = sheet.max_row
pyautogui.failsafe = True
FAILSAFE = False
for i in range(int(row_num)):
var: object = sheet.cell(row=i + 1, column=1).value
pyautogui.typewrite(var)
time.sleep(ZT)
pyautogui.press('enter')
time.sleep(HC)
print(row_num, '/{}个已发送:{}'.format(i + 1, var))
input("程序已结束,按任意键关闭")
win7闪退内容
Microsoft Windows [版本 6.1.7601]
版权所有 (c) 2009 Microsoft Corporation。保留所有权利。
C:\Users\Administrator>C:\Users\Administrator\Desktop\111\ts.exe
Python path configuration:
PYTHONHOME = 'C:\Users\ADMINI~1\AppData\Local\Temp\_MEI13842'
PYTHONPATH = (not set)
program name = 'C:\Users\Administrator\Desktop\111\ts.exe'
isolated = 1
environment = 0
user site = 0
safe_path = 1
import site = 0
is in build tree = 0
stdlib dir = ''
sys._base_executable = 'C:\\Users\\Administrator\\Desktop\\111\\ts.exe'
sys.base_prefix = 'C:\\Users\\ADMINI~1\\AppData\\Local\\Temp\\_MEI13842'
sys.base_exec_prefix = 'C:\\Users\\ADMINI~1\\AppData\\Local\\Temp\\_MEI13842'
sys.platlibdir = 'DLLs'
sys.executable = 'C:\\Users\\Administrator\\Desktop\\111\\ts.exe'
sys.prefix = 'C:\\Users\\ADMINI~1\\AppData\\Local\\Temp\\_MEI13842'
sys.exec_prefix = 'C:\\Users\\ADMINI~1\\AppData\\Local\\Temp\\_MEI13842'
sys.path = [
'C:\\Users\\ADMINI~1\\AppData\\Local\\Temp\\_MEI13842\\base_library.zip',
'C:\\Users\\ADMINI~1\\AppData\\Local\\Temp\\_MEI13842\\lib-dynload',
'C:\\Users\\ADMINI~1\\AppData\\Local\\Temp\\_MEI13842',
]
[6184] Failed to start embedded python interpreter!
Fatal Python error: init_fs_encoding: failed to get the Python codec of the file
system encoding
Python runtime state: core initialized
Traceback (most recent call last):
File "<frozen importlib._bootstrap_external>", line 1437, in _path_importer_ca
che
KeyError: 'C:\\Users\\ADMINI~1\\AppData\\Local\\Temp\\_MEI13842\\base_library.zi
p'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<frozen zipimport>", line 92, in __init__
KeyError: 'C:\\Users\\ADMINI~1\\AppData\\Local\\Temp\\_MEI13842\\base_library.zi
p'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
File "<frozen importlib._bootstrap>", line 1138, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 1078, in _find_spec
File "<frozen importlib._bootstrap_external>", line 1504, in find_spec
File "<frozen importlib._bootstrap_external>", line 1473, in _get_spec
File "<frozen importlib._bootstrap_external>", line 1439, in _path_importer_ca
che
File "<frozen importlib._bootstrap_external>", line 1415, in _path_hooks
File "<frozen zipimport>", line 94, in __init__
File "<frozen zipimport>", line 517, in _read_directory
File "<frozen importlib._bootstrap_external>", line 104, in _path_join
SystemError: Negative size passed to PyUnicode_New