- How do I make Python scripts executable?
- ========================================
- On Windows, the standard Python installer already associates the .py
- extension with a file type (Python.File) and gives that file type an
- open command that runs the interpreter ("D:\Program
- Files\Python\python.exe "%1" %*"). This is enough to make scripts
- executable from the command prompt as 'foo.py'. If you'd rather be
- able to execute the script by simple typing 'foo' with no extension
- you need to add .py to the PATHEXT environment variable.
- How do I make an executable from a Python script?
- =================================================
- See How can I create a stand-alone binary from a Python script? for a
- list of tools that can be used to make executables.
- Recommended video tutorial (watch video below):
- How to Convert any Python File to .EXE
- Is a "*.pyd" file the same as a DLL?
- ====================================
- Yes, .pyd files are dll's, but there are a few differences. If you
- have a DLL named "foo.pyd", then it must have a function
- "PyInit_foo()". You can then write Python "import foo", and Python
- will search for foo.pyd (as well as foo.py, foo.pyc) and if it finds
- it, will attempt to call "PyInit_foo()" to initialize it. You do not
- link your .exe with foo.lib, as that would cause Windows to require
- the DLL to be present.
- Note that the search path for foo.pyd is PYTHONPATH, not the same as
- the path that Windows uses to search for foo.dll. Also, foo.pyd need
- not be present to run your program, whereas if you linked your program
- with a dll, the dll is required. Of course, foo.pyd is required if
- you want to say "import foo". In a DLL, linkage is declared in the
- source code with "__declspec(dllexport)". In a .pyd, linkage is
- defined in a list of available functions.
- Why does Python sometimes take so long to start?
- ================================================
- Usually Python starts very quickly on Windows, but occasionally there
- are bug reports that Python suddenly begins to take a long time to
- start up. This is made even more puzzling because Python will work
- fine on other Windows systems which appear to be configured
- identically.
- The problem may be caused by a misconfiguration of virus checking
- software on the problem machine. Some virus scanners have been known
- to introduce startup overhead of two orders of magnitude when the
- scanner is configured to monitor all reads from the filesystem. Try
- checking the configuration of virus scanning software on your systems
- to ensure that they are indeed configured identically. McAfee, when
- configured to scan all file system read activity, is a particular
- offender.
Python software and documentation are licensed under the PSF License Agreement.
Starting with Python 3.8.6, examples, recipes, and other code in the documentation are dual licensed under the PSF License Agreement and the Zero-Clause BSD license.
Some software incorporated into Python is under different licenses. The licenses are listed with code falling under that license. See Licenses and Acknowledgements for Incorporated Software for an incomplete list of these licenses.
Python and it's documentation is:
Copyright © 2001-2022 Python Software Foundation. All rights reserved.
Copyright © 2000 BeOpen.com. All rights reserved.
Copyright © 1995-2000 Corporation for National Research Initiatives. All rights reserved.
Copyright © 1991-1995 Stichting Mathematisch Centrum. All rights reserved.
See History and License for complete license and permissions information:
https://docs.python.org/3/license.html#psf-license