Skip to content

Instantly share code, notes, and snippets.

@nick-brady

nick-brady/console.py

Last active Mar 20, 2018
Embed
What would you like to do?
dumb script for writing the boilerplate javascript to log out the arguments in a function
# python console.py arg1, arg2, arg3, arg4
import sys
def cleanString(string):
if string[-1] == ',':
return string[:-1]
else:
return string
def eslintDisable():
print('// eslint-disable-next-line')
cleaned_arguments = [cleanString(s) for s in sys.argv[1:]]
eslintDisable()
print('console.group(\'generated console group\');')
for argument in cleaned_arguments:
eslintDisable()
print('console.log(\'{}: \', {});'.format(argument, argument))
eslintDisable()
print('console.groupEnd(\'end group\');')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.