Я создал время для изменения чисел в SAP. Когда я запускаю его, run_path(path_name='C:/Users/name/PycharmProjects/ICPO Inbound-Outbound/run_icpo_flow_report.py')
запускается дважды перед запуском while l oop. Кто-нибудь знает, как это решить?
from runpy import run_path
import subprocess
run_path(path_name='C:/Users/name/PycharmProjects/ICPO Inbound-Outbound/run_icpo_flow_report.py')
from openpyxl import load_workbook
wb = load_workbook('C:/Users/name/PycharmProjects/ICPO Inbound-Outbound/export.xlsx')
InputWorksheet = wb.active
try:
subprocess.call(["taskkill", "/F", "/IM", "EXCEL.EXE"])
print('Excel Closed')
except:
print('Excel Closed')
row = 1
lastrow = len(InputWorksheet['A'])
value = 1
while value <= lastrow:
run_path(path_name='C:/Users/name/PycharmProjects/ICPO Inbound-Outbound/start_vl32n.py')
row = row +1
inboundnr = InputWorksheet.cell(row, column=1).value
outboundnr = InputWorksheet.cell(row, column=2).value
value = value + 1
run_path(path_name='C:/Users/name/PycharmProjects/ICPO Inbound-Outbound/change number sap.py')
print(inboundnr)
print(outboundnr)
if value == lastrow:
print('done')
quit()
print('end')
quit()