Created
December 13, 2017 02:43
-
-
Save sko00o/75042050f083e27d34e4ae579bc9a301 to your computer and use it in GitHub Desktop.
FixCode.py
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
# -*- 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