Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
Python
chr(12) Form Feed in Notepad
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Tim Chase, post: 4010550"] If you're writing it to a text file and assuming that Notepad is smart enough to properly handle form-feeds, I'm sorry, you'll be disappointed...this says more about the brain-deadness of Notepad than your optimism :-) If you have a configurable destination, you might be able to do something within your Python app like if 'win' in sys.platform.lower(): default_dest = "lpt1:" else: default_dest = "/dev/lp0" dest = config.get("printer", default_dest) f = file(dest, 'wb') f.write(my_output_with_ff) # optionally # f.write(chr(12)) # to eject the last page f.close() Otherwise, you'd have to write to something a default Windows application would know how to handle with embedded form-feeds/page-breaks (i.e., not Notepad as the default .txt handler). My first thought would be to export it as RTF (there was a good python RTF library I tinkered with one afternoon -- it's a quick google away) which should allow embedding page-breaks, and even give you a fair bit of additional control over other aspects like fonts and styles. -tkc [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
Python
chr(12) Form Feed in Notepad
Top