Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #program that will get information from PKMS and put it into Excel
- #1 Open PKMS
- import subprocess
- subprocess.Popen('C:\\Mochasoft\\mtn5250.exe')
- import pyautogui
- pyautogui.PAUSE = .7
- pyautogui.hotkey('win', 'up')
- #2 Enter log in
- pyautogui.write('MSHENK')
- pyautogui.press('tab')
- pyautogui.write('Moneyavian')
- #3 Navigate to SKU Inventory Inquiry screen
- pyautogui.press('enter')
- pyautogui.press('1', interval=.25)
- pyautogui.press('enter')
- pyautogui.press('2', interval=.25)
- pyautogui.press('enter', interval=.25)
- pyautogui.press('3', interval=.25)
- pyautogui.press('enter', interval=.25)
- pyautogui.press('2', interval=.25)
- pyautogui.press('enter', interval=.25)
- #4 Read product code from Excel cell
- import openpyxl
- wb = openpyxl.load_workbook('repack_locns.xlsx')
- sheet = wb['r_locn']
- sku = 'A11841\t2 \t \t'
- #5 Enter product code into PKMS (cursor should already be where it's supposed to be)
- #and press Enter
- import pyautogui
- pyautogui.write(sku)
Advertisement
Add Comment
Please, Sign In to add comment