Skip to content

Instantly share code, notes, and snippets.

@davaymne
Last active December 13, 2020 22:13
Show Gist options
  • Save davaymne/283e1752ff2c1adac001e483ecd6a462 to your computer and use it in GitHub Desktop.
Save davaymne/283e1752ff2c1adac001e483ecd6a462 to your computer and use it in GitHub Desktop.
import sys
with open(sys.argv[1], 'r') as f:
n = 0
for line in f:
if len(line) > n:
n = len(line)
with open(sys.argv[1], 'r') as f:
for line in f:
new = '{}{}'.format(line[0].lower(), line[1:]).strip().ljust(n)
l = r"query { %s } => <K> * $EFPRICE * $DAI;" % (new)
print(l)
with open(sys.argv[1], 'r') as f:
for line in f:
new = '{}{}s'.format(line[0].lower(), line[1:].strip()).strip().ljust(n+1)
l = r"query { %s (first: $first, skip: $skip) } => <K> * $EFPRICE * $DAI;" % (new)
print(l)
with open(sys.argv[1], 'r') as f:
for line in f:
new = '{}{}s'.format(line[0].lower(), line[1:].strip()).strip().ljust(n+1)
l = r"query { %s } => <K> * $EFPRICE * $DAI;" % (new)
print(l)
print('default => <K> * $EFPRICE * $DAI;')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment