Created
August 15, 2017 03:40
-
-
Save rdapaz/d92e27a19b4cb797a0c2c12ede6d4d3b to your computer and use it in GitHub Desktop.
Python Script to Print to Dymo Labeller
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Testcoding: utf-8 | |
import time | |
import win32com | |
import win32com.client | |
labels_to_print = """ | |
Label 1 | |
Label 2 | |
Label 3 | |
""".splitlines() | |
labels_to_print = [x for x in labels_to_print if len(x) > 0] | |
shell = win32com.client.Dispatch("WScript.Shell") | |
# shell.Run("notepad") | |
# time.sleep(0.1) | |
shell.AppActivate('Dymo Label Light') | |
for label in labels_to_print: | |
shell.SendKeys("^n") | |
shell.SendKeys(f"{label}") | |
shell.sendkeys("^p") | |
time.sleep(8) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment