Skip to main content

A prettier way to test for main.

is_main()

Instead of the not-so-pretty:

if __name__ == "__main__":
    main()

pip install ismain from PyPI:

$pip install ismain

And use is_main() from ismain:

from ismain import is_main

if is_main():
    main()

Release files for ismain 0.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for ismain 0.0.4
File Interpreter ABI Platform
ismain-0.0.4-py3-none-any.whl Python 3 none any Details

Release files / ismain-0.0.4-py3-none-any.whl

Download URL ismain-0.0.4-py3-none-any.whl
Size 3.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9ec9056df9d942088f8572248aac7247842fcc65d400424aff9eeaa7e6a78a64
BLAKE2b-256 checksum
How to use checksums
65108cf3d4c7ece958c1b532075f84377020fa6fdc13ef72a068ffb1df019426
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.1.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.9.1

Release history Release notifications | RSS feed

This release

0.0.4 This release

1 release file

0.0.3

1 release file

0.0.2

1 release file

0.0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page