Datasets:

Modalities:
Text
Formats:
text
Size:
< 1K
ArXiv:
Libraries:
Datasets
RepoZero-Py2JS / boltons /test9.py
jessezhaoxizhang's picture
Duplicate from jessezhaoxizhang/RepoZero-Py2JS
a839836
Raw
History Blame Contribute Delete
671 Bytes
import argparse
from boltons.strutils import camel2under, under2camel, slugify
parser = argparse.ArgumentParser()
parser.add_argument('--a', type=str, required=True, help='Comma-separated strings')
args = parser.parse_args()
strings = args.a.split(',')
result1 = [camel2under(s) for s in strings] # 批量转换为下划线命名
print(result1)
result2 = [under2camel(s) for s in strings] # 批量转换为驼峰命名
print(result2)
result3 = [slugify(s) for s in strings] # 批量创建slug
print(result3)
result4 = camel2under(strings[0]) # 转换第一个字符串
print(result4)
result5 = under2camel(strings[-1]) # 转换最后一个字符串
print(result5)