
| Current Path : /home/cgabriel/20_dev/11_iftlib/sysadmin/ |
Linux ift1.ift-informatik.de 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 |
| Current File : //home/cgabriel/20_dev/11_iftlib/sysadmin/getch_example.py |
import curses, re, os
c = curses.initscr()
scandir = "/home/01_scan"
while (0 == 0):
c1 = c.getch()
# print c1
if c1 == 48:
break
zaehler = "001"
if c1 == 53:
while (0 == 0):
if not os.path.isfile(scandir+"/hpscan"+zaehler+".pdf"):
break
zaehler = "%03u" % (int(zaehler)+1)
os.system("cd "+scandir +"; hp-scan --size=a4 -d hpaio:/usb/HP_LaserJet_3330?serial=00SGG2410KJ1 -m lineart " +
"-ohpscan"+zaehler+".pdf")
if c1 == 55:
os.system("cd "+scandir +"; hp-scan --size=a4 -d hpaio:/usb/HP_LaserJet_3330?serial=00SGG2410KJ1 -m lineart --adf")
os.system("echo '\a'")
curses.endwin()