Python Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesPython Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old November 15th, 2004, 09:59 PM
Questioner Questioner is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: Questioner's home
Posts: 89 Questioner User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 8 h 32 m 10 sec
Reputation Power: 6
Printing html

Is there a way to directly print generated html files without prompting the print setup form? Thanks in advance.
__________________
What can change the nature of a man?

Reply With Quote
  #2  
Old November 16th, 2004, 03:39 AM
netytan's Avatar
netytan netytan is offline
Hello World :)
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Mar 2003
Location: Hull, UK
Posts: 2,536 netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 2 Days 18 h 10 m 32 sec
Reputation Power: 63
Send a message via ICQ to netytan Send a message via AIM to netytan Send a message via MSN to netytan Send a message via Yahoo to netytan
I'n not sure exactly what you mean here, but if your generating a HTML file and want to print the contents of that file then you would do something like:

Code:
>>> print file('some/path/some.html').read()
...


Chances are that this isn't what you want, so a few more details about what you're doing would probably help .

Have fun,

Mark.
__________________
programming language development: www.netytan.com Hula


Reply With Quote
  #3  
Old November 21st, 2004, 08:54 AM
fiomba fiomba is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2004
Posts: 6 fiomba User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 25 m 46 sec
Reputation Power: 0
If you want instead see the file with a browser (for ex. Mozilla), from
which you can (if you want) see the html source...

Code:
import os
os.system('mozilla some/path/some.html')

From the running browser, you can, of course, also send the file or the html source to a printer.
If the command succeed (that is you have the browser in the execution path and the html file is present) a "0" is returned to the function "system".

Reply With Quote
  #4  
Old November 22nd, 2004, 06:43 AM
Dag Dag is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Posts: 113 Dag User rank is Private First Class (20 - 50 Reputation Level)Dag User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 3 Days 3 h 46 m 14 sec
Reputation Power: 5
Send a message via MSN to Dag
Quote:
Originally Posted by fiomba
If you want instead see the file with a browser (for ex. Mozilla), from
which you can (if you want) see the html source...

Code:
import os
os.system('mozilla some/path/some.html')

From the running browser, you can, of course, also send the file or the html source to a printer.
If the command succeed (that is you have the browser in the execution path and the html file is present) a "0" is returned to the function "system".



or use the webbrowser module

Code:
import webbrowser
webbrowser.open_new("url")

Reply With Quote
  #5  
Old November 25th, 2004, 09:42 PM
Questioner Questioner is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: Questioner's home
Posts: 89 Questioner User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 8 h 32 m 10 sec
Reputation Power: 6
Thanks, but what I really wanted is to print (send the request to printer) without prompting the print setup dialog before the print. Let's say I'm generating a report, then after the report is done, I prompt a small message box (not print setup dialog), if ok, print immediately, else do nothing. Izzit possible?

Thanks in advance.

Reply With Quote
  #6  
Old November 26th, 2004, 09:14 AM
netytan's Avatar
netytan netytan is offline
Hello World :)
Dev Shed Frequenter (2500 - 2999 posts)
 
Join Date: Mar 2003
Location: Hull, UK
Posts: 2,536 netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level)netytan User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 2 Days 18 h 10 m 32 sec
Reputation Power: 63
Send a message via ICQ to netytan Send a message via AIM to netytan Send a message via MSN to netytan Send a message via Yahoo to netytan
Assuming we're talking about a windows machine here then you're best bet would be to check out Mark Hammond's win32all extensions:

http://starship.python.net/crew/mhammond/

Reply With Quote
  #7  
Old November 30th, 2004, 03:13 AM
Questioner Questioner is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: Questioner's home
Posts: 89 Questioner User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 8 h 32 m 10 sec
Reputation Power: 6
I sure wish, lol, but it's in Linux, but thanks.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPython Programming > Printing html


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT