Created
July 13, 2017 13:10
-
-
Save Iruyan-Zak/607d146e2180d745c6c030e0e6caa194 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python3 | |
from sys import stderr, argv | |
if len(argv) <= 1: | |
stderr.write("No file names are specified.\n") | |
exit(1) | |
prev = '' | |
s = '' | |
for l in open(argv[1], mode='r'): | |
for c in l: | |
if prev == '_': | |
if c == '_': | |
s += '_' | |
c = '' | |
if c.islower(): | |
c = c.capitalize() | |
prev = '' | |
s += prev | |
prev = c | |
print(s + prev) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment