Created
March 19, 2020 09:22
-
-
Save outiy5/eaf0c1f596265e005787a45c2a6caad9 to your computer and use it in GitHub Desktop.
Revisions
-
outiy5 created this gist
Mar 19, 2020 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,9 @@ # https://stackoverflow.com/questions/10395319/python-convert-str-to-javascript-literal-string import json jsstring = """ foo "bar" """ print 'function dosomething () { return %s.toLowerCase(); }' % json.dumps(jsstring)