Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # run_html_parallel.py
- import os
- html = '''
- <html>
- <head>
- <title>{title}</title>
- </head>
- <body>
- {text}
- </body>
- </html>
- '''
- dir='c:/pytemp/'
- def save_html(file_name, title, text):
- t=text.replace('\n','<br>')
- html_copy=html.format(title=title, text=t)
- f=open(dir+file_name, "w")
- f.write(html_copy)
- save_html("MyHTML.html", "My WebPage", "Hello World...\nPython Is Awesome!")
- os.popen(dir+'MyHTML.html file')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement