Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!\bin\python
- #copyright Usmar A Padow (amigojapan) 2015 usmpadow@gmail.com
- #converts the newlines of a text file to line brakes in HTML
- #usage text2html_newlines textfile.txt htmlfile.html
- import sys
- textfilename = sys.argv[1]
- htmlfilename = sys.argv[2]
- f = open(textfilename, 'r')
- textfile = f.read()
- html= textfile.replace('\n', '\n<BR>')
- f = open(htmlfilename, 'w')
- f.write(html)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement