Skip to content

Instantly share code, notes, and snippets.

@Galarius
Created June 18, 2016 16:28
Show Gist options
  • Save Galarius/4cb0cb55b3394a6d3837b0539481601c to your computer and use it in GitHub Desktop.
Save Galarius/4cb0cb55b3394a6d3837b0539481601c to your computer and use it in GitHub Desktop.
path1 = 'text_ru.txt'
path2 = 'text_ru.uppercase.txt'
f = open(path1, 'r')
w = open(path2, 'w')
lines = f.readlines()
lines = [unicode(line.decode('utf-8')) for line in lines]
lines = [line.upper() for line in lines]
lines = [line.encode('utf-8') for line in lines]
w.writelines(lines)
w.close()
f.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment