Created
June 4, 2018 06:26
-
-
Save wwj718/390e0abca02742f3a7c7147aa45bd654 to your computer and use it in GitHub Desktop.
批量打印
This file contains 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
# 打印lpr | |
import subprocess | |
import pathlib | |
p = pathlib.Path('.') | |
# 列出目录下所有png图片名 | |
imgs = list(p.glob('**/*.png'))[:2] | |
for i in imgs: | |
cmd = "lpr {}".format(i) | |
print(cmd) | |
subprocess.call(cmd,shell=True) | |
print("ok") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment