Mar-03-2021, 07:22 PM
I've been assigned the task of looking up master routing information for a part number, and changing the assigned Purchase Requisition information from one that is outdated to a new number. This number will be something of the variety 200003215, and unique to each new part number I look up. I will be given this information in a spreadsheet. For similar tasks I use a Python program my colleagues and I have dubbed 'hotstrings.' It is essentially a simple macro program:
import ctypes
ctypes.windll.kernel32.SetConsoleTitleW("Hotstring")
import keyboard as k
h = k.add_abbreviation
h('.A',"APPLE")
h('.B',"BANNANA")
h('.C',"CARROT")
h('.D',"AVOCADO")
You can set up this script to allow you to type a character string, and it prints what ever is in the quotations for you. E.G. typing .A will print Apple in the active field and window you are using. This is useful for tasks requiring the same part number to be put into multiple fields in the ERP system, quickly and efficiently without error. However, I plan to use if for more part numbers than I ever have before, setting it up manually like I usually do would be time consuming.
My question is, is there a way to import a text file or spreadsheet containing the part numbers, and have them automatically enumerate? And I realize enumerating isn't really what I want to do anyway, more I want to have a character sting automatically assigned to each part number. Additionally, the total number of part numbers will be more than 26, if I am able do this, how would I tell it to start over with '.AA','.BB','CC.' ect. when the time comes?
I'm NOT wanting to automate and a find and replace system, I want to retain control over each transaction, but still save time by not having to type each part number in full.
I'm very new to Coding in general and Python in particular, I'm not even sure what questions I should be asking, I hope I've been clear enough to at least get pointed in the right direction.
import ctypes
ctypes.windll.kernel32.SetConsoleTitleW("Hotstring")
import keyboard as k
h = k.add_abbreviation
h('.A',"APPLE")
h('.B',"BANNANA")
h('.C',"CARROT")
h('.D',"AVOCADO")
You can set up this script to allow you to type a character string, and it prints what ever is in the quotations for you. E.G. typing .A will print Apple in the active field and window you are using. This is useful for tasks requiring the same part number to be put into multiple fields in the ERP system, quickly and efficiently without error. However, I plan to use if for more part numbers than I ever have before, setting it up manually like I usually do would be time consuming.
My question is, is there a way to import a text file or spreadsheet containing the part numbers, and have them automatically enumerate? And I realize enumerating isn't really what I want to do anyway, more I want to have a character sting automatically assigned to each part number. Additionally, the total number of part numbers will be more than 26, if I am able do this, how would I tell it to start over with '.AA','.BB','CC.' ect. when the time comes?
I'm NOT wanting to automate and a find and replace system, I want to retain control over each transaction, but still save time by not having to type each part number in full.
I'm very new to Coding in general and Python in particular, I'm not even sure what questions I should be asking, I hope I've been clear enough to at least get pointed in the right direction.