Size: 643
Comment: converted to 1.6 markup
|
Size: 360
Comment:
|
Deletions are marked like this. | Additions are marked like this. |
Line 1: | Line 1: |
ThomasHeller posted this tip to the mailing list: `main_is_frozen()` returns `True` when running the exe, and `False` when running from a script. `get_main_dir()` returns the directory name of the script or the directory name of the exe - this is also sometimes useful. {{{ #!python import imp, os, sys def main_is_frozen(): return (hasattr(sys, "frozen") or # new py2exe hasattr(sys, "importers") # old py2exe or imp.is_frozen("__main__")) # tools/freeze def get_main_dir(): if main_is_frozen(): return os.path.dirname(sys.executable) return os.path.dirname(sys.argv[0]) }}} |
Nothing to write about myself I think.<<<BR>> ><<<BR>> > Yes! Im a member of py2exe.org.<<<BR>> ><<<BR>> > I really hope I'm useful at all<<<BR>> ><<<BR>> > <<<BR>> ><<<BR>> > My blog :: [[https://gita.jobrove.com/barkxbuddydogtrainers/barkxbuddy-dog-trainer2022/wiki/BarkXBuddy:-Finding-the-Right-Training-Frequency-for-Your-Dog|BarkXbuddy Dog]] |
Nothing to write about myself I think.<
><
> Yes! Im a member of py2exe.org.<
><
> I really hope I'm useful at all<
><
> <
><
> My blog :: BarkXbuddy Dog