Advertisement
here2share

# js_text_angle.py

Nov 25th, 2019
284
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.54 KB | None | 0 0
  1. # js_text_angle.py
  2.  
  3. import tempfile
  4. import webbrowser
  5. import os
  6.  
  7. js_data = '''<!DOCTYPE html>
  8. <html>
  9. <body>
  10.  
  11. <svg height="60" width="200">
  12.  <text x="0" y="15" fill="red" transform="rotate(30 20,40)">I love SVG</text>
  13.  Sorry, your browser does not support inline SVG.
  14. </svg>
  15.  
  16. </body>
  17. </html>'''
  18.  
  19. chrome_path = 'C:/Program Files (x86)/Google/Chrome/Application/chrome.exe %s'
  20.  
  21. tf = tempfile.mktemp(".html", "JSdemo_")
  22. print tf
  23. with open(tf, 'w') as temp:
  24.     temp.write(js_data)
  25. webbrowser.get(chrome_path).open(tf)
  26. os.remove(tf)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement