Skip to content

Instantly share code, notes, and snippets.

@Iruyan-Zak
Created July 13, 2017 13:10
Show Gist options
  • Save Iruyan-Zak/607d146e2180d745c6c030e0e6caa194 to your computer and use it in GitHub Desktop.
Save Iruyan-Zak/607d146e2180d745c6c030e0e6caa194 to your computer and use it in GitHub Desktop.
#! /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