February 18th, 2013, 08:47 PM
Print to line printer
Re: PyWin 2.7.3
How do I print a .txt file to the line printer?
I have 3 .txt files that I want to print to the line printer.
All 3 files will fit on one page. How do I concatenate these files to print on 1 page?
February 18th, 2013, 11:34 PM
Load the files into microsoft word and click print?
Use the DOS print command?
untested program to concatenate files named on the command line, includes a one line file name separator.
#use: A:> python thisfile.py a.txt b.txt 3.txt
for name in sys.argv[1:]:
with open(name) as inf:
[/code] are essential for python code and Makefiles!
February 19th, 2013, 11:48 AM
In Linux you can use cat
cat chapter01 chapter02 chapter03 > book
and lpr prints
cat chapter01 chapter02 chapter03 > lpr (assumes you only have one printer)
If you prefer to use Python, this is a tutorial on reading and writing files.
Last edited by dwblas; February 19th, 2013 at 11:51 AM.