Skip to content

Instantly share code, notes, and snippets.

View LiamInJapan's full-sized avatar

Liam Conroy LiamInJapan

View GitHub Profile
@LiamInJapan
LiamInJapan / javascript_multiline_string_convertor.py
Last active August 29, 2015 14:02
Python script to parse a file of text into javascript multiline string format to allow easy inlining in JS code. E.g. when you want to inline a block of JSON in JS code to keep things local
from optparse import OptionParser
def main():
parser = OptionParser(usage="usage: %prog [options] filename",
version="%prog 1.0")
parser.add_option("-f", "--file",
action="store",
dest="filename",
help="file to parse",)