Skip to content

Instantly share code, notes, and snippets.

@hhatto
Created December 7, 2015 02:42
Show Gist options
  • Select an option

  • Save hhatto/e1a344f016e6a6804769 to your computer and use it in GitHub Desktop.

Select an option

Save hhatto/e1a344f016e6a6804769 to your computer and use it in GitHub Desktop.
import os
from fnmatch import fnmatch
import autopep8
root = '.'
cmd_args = ['dummy', '-d']
args = autopep8.parse_args(cmd_args)
for dirname, dirs, files in os.walk(root):
print(dirname, dirs, files)
for filename in files:
if fnmatch(filename, '*.py'):
f = os.path.join(dirname, filename)
autopep8.fix_file(f, options=args)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment