Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@bgamut
Created March 15, 2018 21:34
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bgamut/3b19d3f45ffec19cae6baff993fbb57e to your computer and use it in GitHub Desktop.
Save bgamut/3b19d3f45ffec19cae6baff993fbb57e to your computer and use it in GitHub Desktop.
decompile all pic file in midi remote scripts directory.
import os
from fnmatch import fnmatch
import subprocess
root = "/Users/bernardahn/Desktop/MIDI Remote Scripts"
pattern="*.pyc"
for path, subdirs,files in os.walk(root):
for name in files:
if fnmatch(name,pattern):
index=os.path.splitext(name)[0]
newfile=index+".py"
newfile=os.path.join(path,newfile)
subprocess.call(["touch",newfile])
subprocess.call(["uncompyle6","-o",newfile,os.path.join(path,name)])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment