Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'win32': 0.03; 'output': 0.05; 'file)': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'suppress': 0.09; 'that).': 0.09; 'python': 0.11; 'windows': 0.15; 'contexts,': 0.16; 'message-id:@4ax.com': 0.16; 'printing.': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'simplest': 0.16; 'subject:printer': 0.16; 'subject:windows': 0.16; '(but': 0.19; 'basically': 0.19; 'file,': 0.19; "hasn't": 0.19; 'solution.': 0.20; 'command': 0.22; 'feb': 0.22; 'print': 0.22; "aren't": 0.24; 'url:home': 0.24; 'header': 0.24; 'mon,': 0.24; 'file.': 0.24; "haven't": 0.24; 'appreciated': 0.26; 'header:X-Complaints-To:1': 0.27; 'function': 0.29; 'invoke': 0.31; 'file': 0.32; 'skip:c 30': 0.32; 'option': 0.32; 'text': 0.33; 'says': 0.33; 'problem.': 0.35; 'google': 0.35; 'charset:us- ascii': 0.36; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'how': 0.40; 'easy': 0.60; 'simple': 0.61; 'email addr:gmail.com': 0.63; 'name': 0.63; 'different': 0.65; 'hours': 0.66; '2015': 0.84; 'yielded': 0.84; 'graphical': 0.91; 'received:108': 0.93 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Dennis Lee Bieber Subject: Re: Printing to printer, windows 7 Date: Tue, 17 Feb 2015 00:50:58 -0500 Organization: IISS Elusive Unicorn References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: adsl-108-79-219-10.dsl.klmzmi.sbcglobal.net X-Newsreader: Forte Agent 6.00/32.1186 X-No-Archive: YES X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 31 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1424152259 news.xs4all.nl 2846 [2001:888:2000:d::a6]:60419 X-Complaints-To: abuse@xs4all.nl Path: csiph.com!usenet.pasdenom.info!bete-des-vosges.org!feed.ac-versailles.fr!nerim.net!novso.com!newsfeed.xs4all.nl!newsfeed2a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Xref: csiph.com comp.lang.python:85732 On Mon, 16 Feb 2015 18:08:22 -0800 (PST), ken.hessel@gmail.com declaimed the following: >Would seem to be a simple problem. I just want to print to my printer instead of the console using Python 2.7, Windows 7. Hours of looking through FAQ's and Google haven't yielded a solution. Any suggestions appreciated -- It hasn't been easy since W9x... Windows printers aren't considered text output devices; one has to basically create a graphical image of the page and send the image to the printer driver. That means lots of win32 function calls on graphical contexts, rendering, etc. Simplest is to just write to a scratch/temp text file, and invoke some utility to do the printing. I used to know how to invoke Word to start/print/exit... ... Just tested C:\Users\Wulfraed\Documents>notepad /p test.csv C:\Users\Wulfraed\Documents> did print the file (but put a header line of the file name at the top -- might be an option to suppress that). Other programs may respond to a /p as a command to print the file. (Appears SciTE takes it, different header and footer -- the SciTE help says it is -p to print the file) -- Wulfraed Dennis Lee Bieber AF6VN wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/