Skip to content
test if running as "main"
Python Batchfile Makefile
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
docs/source
example
ismain
source
test_is_main
.coveragerc
.gitignore
LICENSE
LICENSE.txt
Makefile
blackify.bat
coverage.bat
make.bat
make_docs.bat
make_venv.bat
pypi.bat
readme.md
readme.rst
requirements-dev.txt
setup.py

readme.md

Installation

pip install ismain

Usage

from ismain import is_main

#
# Same as:
# 
#     if "__name__" == __main__:
# 
# ... but more readable.
#
if is_main():
    print("Hello from main.")
You can’t perform that action at this time.