Skip to content

Instantly share code, notes, and snippets.

@sko00o
Created December 13, 2017 02:43
Show Gist options
  • Save sko00o/75042050f083e27d34e4ae579bc9a301 to your computer and use it in GitHub Desktop.
Save sko00o/75042050f083e27d34e4ae579bc9a301 to your computer and use it in GitHub Desktop.
FixCode.py
# -*- coding: utf-8 -*-
# Author: SKo00o
'''
Format Code use pep8 in pythonista.
1. Install StaSh
2. Run following code in StaSh:
pip install autopep8
3. Add this Script in pythonista's shortcut
'''
import autopep8
import editor
if __name__ == '__main__':
text = editor.get_text()
fixed = autopep8.fix_code(text)
editor.replace_text(0, len(text), fixed)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment