import os # first scan a page scanning = "scanimage --resolution 300 --mode gray -o reading.png" os.system(scanning) import calendar import time # Current GMT time in a tuple format current_GMT = time.gmtime() # ts stores timestamp ts = calendar.timegm(current_GMT) copy=f"cp reading.png timestamps/reading-{ts}.png" os.system(copy) printing = "lp -n 2 reading.png" os.system(printing)