Guest User

Untitled

a guest
Feb 10th, 2021
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. #program that will get information from PKMS and put it into Excel
  2.  
  3. #1 Open PKMS
  4.  
  5. import subprocess
  6. subprocess.Popen('C:\\Mochasoft\\mtn5250.exe')
  7. import pyautogui
  8. pyautogui.PAUSE = .7
  9. pyautogui.hotkey('win', 'up')
  10.  
  11. #2 Enter log in
  12.  
  13. pyautogui.write('MSHENK')
  14. pyautogui.press('tab')
  15. pyautogui.write('Moneyavian')
  16.  
  17. #3 Navigate to SKU Inventory Inquiry screen
  18.  
  19. pyautogui.press('enter')
  20. pyautogui.press('1', interval=.25)
  21. pyautogui.press('enter')
  22. pyautogui.press('2', interval=.25)
  23. pyautogui.press('enter', interval=.25)
  24. pyautogui.press('3', interval=.25)
  25. pyautogui.press('enter', interval=.25)
  26. pyautogui.press('2', interval=.25)
  27. pyautogui.press('enter', interval=.25)
  28.  
  29. #4 Read product code from Excel cell
  30.  
  31. import openpyxl
  32. wb = openpyxl.load_workbook('repack_locns.xlsx')
  33. sheet = wb['r_locn']
  34. sku = 'A11841\t2 \t \t'
  35.  
  36.  
  37. #5 Enter product code into PKMS (cursor should already be where it's supposed to be)
  38. #and press Enter
  39. import pyautogui
  40. pyautogui.write(sku)
Advertisement
Add Comment
Please, Sign In to add comment