Python Forum
Is there in 2018 a python3 library that implements the Internet Printing Protocol?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Is there in 2018 a python3 library that implements the Internet Printing Protocol?
#2
You could work with CUPS directly:
https://pypi.org/project/pycups/

#!/usr/bin/python3
import time, pprint, cups
  
conn = cups.Connection()
printers = conn.getPrinters ()
pprint.pprint(printers)
print()
  
printer = conn.getDefault()
print("Default1:", printer)
  
if printer == None:
    printer = list(printers.keys())[0]
    print("Default2:", printer)
  
myfile = "./test.txt"
pid = conn.printFile(printer, myfile, "test", {})
while conn.getJobs().get(pid, None) is not None:
    time.sleep(1)
#done
Reply


Messages In This Thread
RE: Is there in 2018 a python3 library that implements the Internet Printing Protocol? - by heiner55 - Jun-07-2019, 08:51 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Can I use Python in ns3 simulator to create an IGP routing protocol? leemao 1 8,227 Jun-30-2021, 07:20 PM
Last Post: leemao
  Handle http protocol JohnnyCoffee 1 5,553 Jun-20-2021, 06:51 AM
Last Post: ndc85430
  Check network WITHOUT use internet ATARI_LIVE 1 2,228 Oct-28-2020, 07:59 PM
Last Post: Larz60+
  error opening port from local to internet looney99 3 2,835 Oct-16-2020, 02:01 PM
Last Post: BeanieW
  How to extract protocol from a pcap file ? salwa17 0 2,243 Apr-02-2020, 10:02 PM
Last Post: salwa17
  Is it possible to trun local internet access off programmatically? Larz60+ 4 3,489 Sep-25-2018, 08:10 AM
Last Post: DeaD_EyE
  no protocol header version error mjudhandoyo 2 6,384 Feb-03-2017, 10:35 PM
Last Post: nilamo
  accessing SOAP protocol page secured with cetrificad lopow 3 5,591 Jan-11-2017, 03:14 PM
Last Post: buran

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020