Topic: Python programming determine default printer

All,

I have several ubuntu boxes at a client site and have a small python script to pull a pdf from a remote server based on the user checking in and print this pdf to a label printer. Currently I do a wget to save the file then lp -d <printername> <file_name>

With the variety of printers I have to hard code the <printername>

I'd like to dynamically determine the printer name and pass that variable into the lp -d line.

on the command line I can do

lpstat -p -d
to determine the list of printers. I can also do
lpstat -p -d | grep

Thumbs up

Re: Python programming determine default printer

Look at ether the expect module OR subprocess

Thumbs up