Last active
April 23, 2021 08:35
-
-
Save lpinner/e6b9a25831d66c83e7e9bc3a26cc30b5 to your computer and use it in GitHub Desktop.
Convert tab to chordpro format
This file contains 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 | |
# -*- coding: iso-8859-1 -*- | |
###################################################################### | |
# Copyright: lpinner 2021 | |
# License: Apache 2.0 | |
##################################################################### | |
import os | |
import subprocess | |
def tab_to_pro(f): | |
return subprocess.check_output(['chordpro', '--a2crd', f]) | |
if __name__ == '__main__': | |
import os, sys | |
f = sys.argv[1] | |
o = os.path.splitext(f)[0] + '.pro' | |
assert f != o, "Input file (%s) can't be the same as the output file" % os.path.basename(f) | |
with open(o, 'wb') as p: | |
p.write(tab_to_pro(f)) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Awesome! Thank you for this!