473,835 Members | 1,924 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

print some text

I'm a beginner searching for an easy way to print the contents of a
text control. So far I've come up with the following(diffi culties):

1) using wxPython
-convert to HTML and then print (I don't know anything about
HTML)
-use wx.Printout (Seems complicated; may be beyond my abilities)

2) create a text file and then print it out (can create but can only
print with the win32api.ShellE xecute method so this solution doesn't
help me on my Linus laptop)

3) use ReportLab to create .pdf and then print that out (again, can
create but can't print in Linux)

Thanks for any help.

Mike

Jun 27 '08 #1
4 1237
On Apr 23, 2:05*pm, barronmo <barro...@gmail .comwrote:
I'm a beginner searching for an easy way to print the contents of a
text control. *So far I've come up with the following(diffi culties):

1) using wxPython
* * *-convert to HTML and then print (I don't know anything about
HTML)
* * *-use wx.Printout (Seems complicated; may be beyond my abilities)

2) create a text file and then print it out (can create but can only
print with the win32api.ShellE xecute method so this solution doesn't
help me on my Linus laptop)

3) use ReportLab to create .pdf and then print that out (again, can
create but can't print in Linux)

Thanks for any help.

Mike
Write out an HTML file, write back if you need a quick one, then print
that with a browser.
Jun 27 '08 #2
Hi !

Other idea (old style school):

def printing():
f=open("lpt1", "w")
f.write("\nSome thing to print\f")
f.close()

Cheers..

- Ibanez -

----- Original Message -----
From: <ca********@gma il.com>
Newsgroups: comp.lang.pytho n
To: <py*********@py thon.org>
Sent: Wednesday, April 23, 2008 10:27 PM
Subject: Re: print some text
On Apr 23, 2:05 pm, barronmo <barro...@gmail .comwrote:
I'm a beginner searching for an easy way to print the contents of a
text control. So far I've come up with the following(diffi culties):

1) using wxPython
-convert to HTML and then print (I don't know anything about
HTML)
-use wx.Printout (Seems complicated; may be beyond my abilities)

2) create a text file and then print it out (can create but can only
print with the win32api.ShellE xecute method so this solution doesn't
help me on my Linus laptop)

3) use ReportLab to create .pdf and then print that out (again, can
create but can't print in Linux)

Thanks for any help.

Mike
Write out an HTML file, write back if you need a quick one, then print
that with a browser.
--
http://mail.python.org/mailman/listinfo/python-list

Jun 27 '08 #3
On Apr 25, 2:44 pm, "Gabriel Ibanez" <mob...@ibinsa. comwrote:
Hi !

Other idea (old style school):

def printing():
f=open("lpt1", "w")
f.write("\nSome thing to print\f")
f.close()

Cheers..

- Ibanez -
I haven't found a way from within python to print f. I'm sure there
it is something simple but I've been searching for a couple weeks now
with no luck.

Mike
Jun 27 '08 #4
barronmo wrote:
I haven't found a way from within python to print f. I'm sure
there it is something simple but I've been searching for a couple
weeks now with no luck.
Tried some searching?

http://wiki.wxpython.org/Printing

HTH&Regards,
Björn
--
BOFH excuse #374:

It's the InterNIC's fault.

Jun 27 '08 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
13385
by: MouseHart | last post by:
I've written a simple program in VB 6.0 to list all my MP3 files. To show them on the screen I used an MSFlexGrid named TextGrid (which is not associated with any table or text file) in the following code run by a button (the files are all in the format "Artist - Name Of Song" in their directories, which is why the code looks for a dash): Private Sub Command1_Click() Dim dashplace%, length% For I% = 0 To File1.ListCount FLIName =...
1
2136
by: weiwei | last post by:
HI I am having a problem with print friendly function with asp, I have download some code regard with print friendly, it works fine with static html information, however, I have the dynamic pages and strange things is everything works except I cannt see the result of query from database. anyone has idea, please help me out, thanks in advance. below is the code I have, there are several pages of code and I have
1
5725
by: hamil | last post by:
I am trying to print a graphic file (tif) and also use the PrintPreview control, the PageSetup control, and the Print dialog control. The code attached is a concatination of two examples taken out of a Microsoft book, "Visual Basic,Net Step by Step" in Chapter 18. All but the bottom two subroutines will open a text file, and then allow me to use the above controls, example 1. The bottom two subroutines will print a graphic file, example...
1
2359
by: DeWittds | last post by:
I have been tring to recreate a simple program that I wrote many years ago in quick basic. The program get name and address from a database, then the user will enter in info like order #, po # and starting box then number of boxes. In quick basic it was easy to send a form feed and print the next label. But this visual basic .net stuff has me pulling my hair out. I can print all the info to desired printer. But do not understand how to...
4
2504
by: DeWittds | last post by:
Had no luck in the visual basic group maybe someone here can give me a hand. I have been tring to recreate a simple program that I wrote many years ago in quick basic. The program get name and address from a database, then the user will enter in info like order #, po # and starting box then number of boxes. In quick basic it was easy to send a form feed and print the next label. But this visual basic .net stuff has me pulling my hair out....
1
1644
by: eqiz | last post by:
I'm looking for a way to print stuff from my program. I have searched and searched for a way to print and the only thing I have found is PrintFORM which only takes a picture of the form and prints it in image quality which is really really bad quality. Is there any way to print the text off my form the way it looks and everything? Like how PrintForm prints but instead printing the text in "text quality" and the images in image quality? Im...
2
2711
by: alivip | last post by:
when I wont to inser (anyting I print) to the textbox it will not inser it just print then hanging # a look at the Tkinter Text widget # use ctrl+c to copy, ctrl+x to cut selected text, # ctrl+v to paste, and ctrl+/ to select all # count words in a text and show the first ten items # by decreasing frequency
12
3550
by: Studiotyphoon | last post by:
Hi, I have report which I need to print 3 times, but would like to have the following headings Customer Copy - Print 1 Accounts Copy - Print 2 File Copy -Print 3 I created a macro to print the report three times, but do not know how
16
4530
by: raylopez99 | last post by:
I am running out of printing paper trying to debug this...it has to be trivial, but I cannot figure it out--can you? Why am I not printing text, but just the initial string "howdy"? On the screen, when I open a file, the entire contents of the file is in fact being shown...so why can't I print it later? All of this code I am getting from a book (Chris Sells) and the net. The solution is to be found in the fact that stringbuilder is...
11
4230
by: JWest46088 | last post by:
I'm having difficulty trying to figure out how to print a text file from a hash table one line at a time. I have the text file read into the hash table and can print the text file all at once, but I can't seem to figure out how to do it one line at a time. Here is what I'm trying to do: I want the user to be able to print the text file one line at a time by clicking a button to see the next line. Example: If text_file1 first line is...
0
9803
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9652
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10520
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10233
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6963
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5636
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4433
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3993
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3088
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.