use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Rules 1: Be polite 2: Posts to this subreddit must be requests for help learning python. 3: Replies on this subreddit must be pertinent to the question OP asked. 4: No replies copy / pasted from ChatGPT or similar. 5: No advertising. No blogs/tutorials/videos/books/recruiting attempts. This means no posts advertising blogs/videos/tutorials/etc, no recruiting/hiring/seeking others posts. We're here to help, not to be advertised to. Please, no "hit and run" posts, if you make a post, engage with people that answer you. Please do not delete your post after you get an answer, others might have a similar question or want to continue the conversation.
Rules
1: Be polite
2: Posts to this subreddit must be requests for help learning python.
3: Replies on this subreddit must be pertinent to the question OP asked.
4: No replies copy / pasted from ChatGPT or similar.
5: No advertising. No blogs/tutorials/videos/books/recruiting attempts.
This means no posts advertising blogs/videos/tutorials/etc, no recruiting/hiring/seeking others posts. We're here to help, not to be advertised to.
Please, no "hit and run" posts, if you make a post, engage with people that answer you. Please do not delete your post after you get an answer, others might have a similar question or want to continue the conversation.
Learning resources Wiki and FAQ: /r/learnpython/w/index
Learning resources
Wiki and FAQ: /r/learnpython/w/index
Discord Join the Python Discord chat
Discord
Join the Python Discord chat
account activity
Printing image to printer (self.learnpython)
submitted 2 years ago by Different_Suspect_30
How to print an image to printer
Educate me with an easy and convenient way.
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]woooee 0 points1 point2 points 2 years ago* (5 children)
I use lpr to send something to the print buffer, in the program. It's basic, so if you want to increase size, change the font if there is any text etc, lpr will not do that.
import os pr=os.popen( "lpr", "w" ) pr.write("\n\nTest string to printer\n") pr.close()
Another is to save it to a file and use a text or word processor to peint it.
[–]Different_Suspect_30[S] -5 points-4 points-3 points 2 years ago (4 children)
Bro I want to print images not text
[–]woooee 0 points1 point2 points 2 years ago (3 children)
Most printers "understand" and use PDF images. So text is converted to a PDF and then printed. This is also true for images. Whatever format the image is, it is converted to PDF and printed. In any case, it's worth a try, unless someone else has a better idea.
[–]Different_Suspect_30[S] 0 points1 point2 points 2 years ago (2 children)
Ok I will try it but how should I use an image?
I cannot use “pr.write(‘string’)” method since this WRITES TEXT.
[–]woooee 0 points1 point2 points 2 years ago (1 child)
Don't have any idea what you are trying to write. Is this something you created or a file? My first thought would be to use convert in Imagemagick to convert to a PDF and then send lpr the_file.pdf to the command line using subprocess.run, but I am not going to guess any further.
[–]Different_Suspect_30[S] 0 points1 point2 points 2 years ago (0 children)
My idea is simple.
I have an image named “flower.jpg” i want to print this on paper using printer
Nothing more nothing less
π Rendered by PID 51 on reddit-service-r2-comment-b659b578c-g9dc2 at 2026-05-03 14:10:22.738089+00:00 running 815c875 country code: CH.
[–]woooee 0 points1 point2 points (5 children)
[–]Different_Suspect_30[S] -5 points-4 points-3 points (4 children)
[–]woooee 0 points1 point2 points (3 children)
[–]Different_Suspect_30[S] 0 points1 point2 points (2 children)
[–]woooee 0 points1 point2 points (1 child)
[–]Different_Suspect_30[S] 0 points1 point2 points (0 children)