Advertisement
here2share

# run_html_parallel.py ^ 2016.01

Aug 15th, 2015
336
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.43 KB | None | 0 0
  1. # run_html_parallel.py
  2.  
  3. import os
  4.  
  5. html = '''
  6. <html>
  7. <head>
  8. <title>{title}</title>
  9. </head>
  10. <body>
  11. {text}
  12. </body>
  13. </html>
  14. '''
  15.  
  16. dir='c:/pytemp/'
  17. def save_html(file_name, title, text):
  18.     t=text.replace('\n','<br>')
  19.     html_copy=html.format(title=title, text=t)
  20.     f=open(dir+file_name, "w")
  21.     f.write(html_copy)
  22.  
  23. save_html("MyHTML.html", "My WebPage", "Hello World...\nPython Is Awesome!")
  24.  
  25. os.popen(dir+'MyHTML.html file')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement