Package: pssepath
pssepath - Easy PSSE Python codingauthor: whit. (whit.com.au)pssepathsimplifies the code required to setup the Python environment necessary
to use the PSSE API. Usingpssepathall you have to do is::importpssepathpssepath.add_pssepath()importpsspyTested and works on:PSSE 32PSSE 33PSSE 34PSSE 35Supports 32 and 64 bit windows (and provides warnings when using mismatched 64
bit python when PSSE requires 32 bit python).Using this module makes the PSSE system files available for use while avoiding
making modifications to system paths or hardcoding the location of the PSSE
system folders. This makes PSSE easy to use.Withoutpssepath, you have to do something like this::importosimportsysPSSE_LOCATION=r"C:\Program Files\PTI\PSSE32\PSSBIN"sys.path.append(PSSE_LOCATION)os.environ['PATH']=os.environ['PATH']+';'+PSSE_LOCATIONimportpsspyFurthermore, by includingpssepathwith any scripts you distribute, others will
be able to use your code without having to edit your code to suit their
varying install paths (such as different versions of PSSE).It can also provide information about which version of Python to use with a
particular install of PSSE to avoidImportError: Bad magic number....Installationpip install pssepathor copy thepssepathcode directory (the dir that containscore.py) to your
project's root directory.Usagepssepathprovides 3 methods for setting up the PSSE paths:pssepath.add_pssepath()Adds the most recent version of PSSE that works with the currently
running version of Python.pssepath.add_pssepath(<version>)Adds the requested version of PSSE. Remember that specifying a version
number may make your code less portable if you or your colleagues ever use a
different version.pssepath.add_pssepath(33)pssepath.select_pssepath()Produces a menu of all the PSSE and Python installs on your system,
along with the required version of Python.If you have set up your system to have the PSSE system files on the system path
at all times,pssepathwill only use these files.For information about the PSSE versions installed on your system, either:execute the pssepath.py file from windows; orrunpython -m pssepath.pssepathinfoYou may have to specify the python
install path: ie.c:\Python25\python -m pssepath.pssepathinfoorpy.exe -2.5 -m pssepath.pssepathinfoThis will provide you with a summary similar to the following::Found the following versions of PSSE installed:

    1. PSSE version 32
        Requires Python 2.5-32bit (Current running Python)
    2. PSSE version XX
        Requires Python 2.X-32bit (Installed)
    3. PSSE version XX
        Requires Python 2.X-32bit

Found the following Python installations:
  2.5-32bit (currently running):
    PythonCore: C:\Python25\
  3.7-64bit:
    PythonCore: C:\Users\dan\AppData\Local\Programs\Python\Python37\The status next to the Python version indicates the installation status of the
required Python for the particular PSSE install.Current running Pythonindicates the Python version used to invoke the script
(c:\Python25\python.exeif invoked asc:\Python25\python.exe -m pssepath) is
appropriate for that version of PSSE.Installedindicates that a Python version different to the one used to invoke the
script is required for that PSSE version, but that it is already installed
on your system.<nothing>The absence of a status means that a different version of Python is
required to run that version of PSSE and it is not installed on your
system. As Python comes bundled with PSSE, this status is unlikely.Ensuring you use the correct version of Python for the version of PSSE you are
running will avoid seeingImportError: Bad magic number...ever again.LicenseThis program is released under the very permissive MIT license. You may freely
use it for commercial purposes, without needing to provide modified source.Read the LICENSE file for more information.Tips on managing multiple Python versionsI like to use batch files that point to a specific python version.  For
example::$moreC:\bin\python25.bat
@C:\Python25\python.exe%*Where the PATH includesc:\bin.  Now you can run python scripts with the
command::python25myscript.pyargsinstead of:c:\Python25\python.exemyscript.pyargsContributersDiscussion about this module was conducted at thePython for PSSE Foruminvolving the following members:Daniel HillierJervisWChip WebberImprovements or suggestionsVisit thePython for PSSE ForumSee also:github:https://github.com/danifus/pssepathcontact:daniel@whit.com.auFor any other questions about Python and PSSE, feel free to raise them on thePython for PSSE Forum