Jump to content

Physically print output of print python

Go to solution Solved by German_John,

Found a solution (or workaround): having the output of print() be written to a file and then directly printing that file with a two second delay. It's not the most elegant solution, but it does what I want quite effectively

Hello everyone,

 

I'm an absolute noob to programming. I've written a script that generates a form of German poem from a set of word lists. Eventually, I want to add a little thermal printer (already on its way), connect it to a Raspi Zero, add a button, and have it print the generated text on the printer.

I've searched for a bit, but I couldn't find a way to have a python script actually, physically print something. Surely there must be a way?  And surely someone here knows it! 

 

Looking forward to any help!

Link to comment
https://linustechtips.com/topic/1055587-physically-print-output-of-print-python/
Share on other sites

Link to post
Share on other sites

How do you connect the thermal printer, using USB, serial port?

For serial ports, there's serial stuff for python, just google it

For usb , maybe see the driver that comes with the printer ... maybe see usb generic printer class , maybe you have to send it postscript (like PDF) etc etc

 

Link to post
Share on other sites

Found a solution (or workaround): having the output of print() be written to a file and then directly printing that file with a two second delay. It's not the most elegant solution, but it does what I want quite effectively

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×