Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

363
Views
Python print to /dev/usb/lp0

I would like print to /dev/usb/lp0 from my python code. In bash it is very simple: echo 'apple' >/dev/usb/lp0

I found linemode, but this is not working. When I try to install it I get these errors.

byte-compiling build/bdist.linux-x86_64/egg/linemode/renderers/xml.py to xml.pyc
File "build/bdist.linux-x86_64/egg/linemode/renderers/xml.py", line 67
def __init__(self, source, *, max_width=None, prelude=True):
                            ^
SyntaxError: invalid syntax

How I print to /dev/usb/lp0 from python code?

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

This is working:

 with open('/dev/usb/lp0', 'w') as printer:
            printer.write("Line 1\n")
            printer.write("Line 2\n")
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!