ispythonsource(path) - True if path is python file (.py or python shebang)


Keywords
python inspect, python
License
BSD-3-Clause
Install
pip install ispythonsource==1.0.2

Documentation

Travis

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

Sources