Skip to content

Instantly share code, notes, and snippets.

@Foair
Created April 5, 2020 11:14
Show Gist options
  • Save Foair/0743ffbeb2eb48d10076533f0d1f0b45 to your computer and use it in GitHub Desktop.
Save Foair/0743ffbeb2eb48d10076533f0d1f0b45 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
import os
def main():
symbol = os.environ.get('ARG_SYMBOL')
if not symbol:
symbol = 'Δ'
argc = len(sys.argv) - 1
args = []
print('='* argc + symbol + str(argc))
for i in range(1, len(sys.argv)):
args.append(sys.argv[i].replace('\n', '‣')) # ⬖
# print((symbol + '\n').join(args) + symbol)
for arg in args:
print(arg + symbol + str(len(arg)))
def main2():
print('Length of Params:', len(sys.argv) - 1)
for i in range(1, len(sys.argv)):
print(repr(sys.argv[i]))
if __name__ == '__main__':
# $env:ARG_SYMBOL = '##'
main()
#main2()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment