Skip to main content
2025 Python Packaging Survey is now live!  Take the survey now

shebang(path) - get script shebang

Project description

Install

$ [sudo] pip install shebang

Usage

>>> from shebang import shebang

>>> shebang(path)

Examples

>>> shebang("path/to/file.py")
'/usr/bin/env python'

>>> shebang("path/to/file.txt")
None

shebang("/bin/test")
None

Sources

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page