python
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
python [2017/12/30 16:37] – [Installation and Requirements] g00r00 | python [2023/01/08 12:01] – [Why Python 2] g00r00 | ||
---|---|---|---|
Line 8: | Line 8: | ||
Custom Python scripts can be executed by a menu command on any menu, and can also replace any prompt in a Theme' | Custom Python scripts can be executed by a menu command on any menu, and can also replace any prompt in a Theme' | ||
- | ==== Why Python | + | This is a full implementation of Python, meaning you can use external modules to accomplish just about anything alongside with many built in BBS-related functions for user input/ |
- | For those familiar with Python, it is important to note that Mystic uses the 2.x style of Python. | ||
- | * Better package support for Python 2.x | + | ==== Installation and Getting Started |
- | * Python 2 is the default Python version used in the latest LTS versions of Ubuntu | + | |
- | * Python 2 is the default Python version used in the latest of Apple' | + | |
- | * Proven stability over many years in production environments | + | |
- | * The Python 2 syntax will not change, causing your scripts to break while the same cannot be said about Python 3 | + | |
- | + | ||
- | ===== Installation and Requirements | + | |
- | + | ||
- | Mystic requires that Python 2.7 is installed on your system if you wish to execute Python scripts. | + | |
- | + | ||
- | Most Linux desktop distributions and Apple' | + | |
- | + | ||
- | **Note:** If you are using the 32-bit version of Mystic (even if it is in a 64-bit operating system), then you need the 32-bit version of Python installed. | + | |
- | + | ||
- | ==== Library Validation ==== | + | |
- | + | ||
- | When initializing Python, Mystic will be attempting to locate the following library depending on operating system: | + | |
- | + | ||
- | Windows: python27.dll | + | |
- | Linux: libpython2.7.so.1.0 | + | |
- | MacOS: libpython2.7.dylib | + | |
- | + | ||
- | In Windows, you should probably know if Python is installed already since it has to be manually installed. | + | |
- | + | ||
- | In Linux environments, | + | |
- | + | ||
- | ldconfig -p | grep libpython2.7.so.1.0 | + | |
- | + | ||
- | If the above command does not find anything but " | + | |
- | + | ||
- | ldconfig -p | grep libpython | + | |
- | + | ||
- | The result will tell you where Python 2.7 is installed. | + | |
- | ==== Environment Variables ==== | + | |
- | + | ||
- | In addition to the basic Python installation, | + | |
- | + | ||
- | One common error reported when the environment variables need adjusted or set is the message " | + | |
- | + | ||
- | **PYTHONHOME** and **PYTHONPATH** are two environment variables which need to be set. Depending on your operating system, Python may already be installed and working without making any changes. | + | |
- | + | ||
- | SET PYTHONHOME=C: | + | |
- | SET PYTHONPATH=C: | + | |
- | SET PATH=%PYTHONHOME%; | + | |
- | + | ||
- | For more information on how to set environment variables, you'll need to research the specific operating system that you are using and the Python documentation. | + | |
- | + | ||
- | | + | |
- | + | ||
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | + | ||
- | When PYTHONHOME is set to a single directory, its value replaces both | + | |
- | | + | |
- | | + | |
- | + | ||
- | | + | |
- | + | ||
- | | + | |
- | as the shell’s PATH: one or more directory pathnames separated by | + | |
- | | + | |
- | | + | |
- | + | ||
- | In addition to normal directories, | + | |
- | refer to zipfiles containing pure Python modules (in either source or | + | |
- | | + | |
- | + | ||
- | The default search path is installation dependent, but generally begins | + | |
- | with prefix/ | + | |
- | | + | |
- | + | ||
- | An additional directory will be inserted in the search path in front of | + | |
- | | + | |
- | can be manipulated from within a Python program as the variable sys.path | + | |
+ | See the subsections of this documentation for information on installation, |
python.txt · Last modified: 2023/01/20 01:07 by g00r00