Install
$ [sudo] pip install ispythonsource
Examples
>>> from ispythonsource import ispythonsource
>>> ispythonsource("file.py")
True
>>> ispythonsource("file.pyc")
False
>>> ispythonsource("path/to/source") # '/usr/bin/env python' shebang
True
ispythonsource(path) - True if path is python file (.py or python shebang)
pip install ispythonsource==1.0.2
$ [sudo] pip install ispythonsource
>>> from ispythonsource import ispythonsource
>>> ispythonsource("file.py")
True
>>> ispythonsource("file.pyc")
False
>>> ispythonsource("path/to/source") # '/usr/bin/env python' shebang
True