There is a "print" command I can invoke from the command line, but when I try using it, I get the message "Unable to initialize device PRN". Well that is odd given that Notepad knows how to print.
Some digging suggests that PRN by default goes to LPT1: which at some point in the ancient past was an old parallel port.
One suggestion is to use "print /d:printer-name file", but now my question is what is the printer name I should use?
I go to Settings--Devices--Printers and Scanners. I see my Brother printer in the list and select it. Then I select "Manage", then "Printer properties". Here I could change the printer name, but for now I will just note that the name is:
Brother HL-L2370DW series Printer
So I try the command print /d:"Brother HL-L2370DW series Printer" try.py and it tells me that my file is being printed, but nothing happens. In fact I get the message regardless of what I put after the /d: switch.
Another tip is to use powershell and "Start-Process -FilePath="try.py" -verb Print. This seems a bit esoteric. I am starting to remember why I hate windows so much.
Another suggestion is to bounce the file through notepad via:
notepad /pt try.pyI just get bizarre errors from Notpad when I try this. I am giving up on this, something I would have expected to be totally simple.
Forgetting about "print", the Windows view seems to be that you don't just print arbitrary files. They have this idea of "associating" files (based on file extent such as ".txt") with some application that understands the file. The application may then have a print option or it may not. If not, there is no way to print the file, and in the windows view, the file is unable to be printed. This is certainly the case for binary files (such as a ".exe" file).
If this view is right, then I use notepad as the gadget to print plain text files. If I want to print a postscript file, I need an application like "gsview" or perhaps "gsprint". Or I can dive into the Windows programming API and add a print functionality to a program I might write.
Adventures in Computing / tom@mmto.org