Python

Python is an open-source, high-level, interpreted, general-purpose programming language. It was created by Guido van Rossum, and was first released in 1991.

The Language

Since Python is open source, you have access to the source code, if you need to see how the internals work. It also means that Python is freely accessible to anyone with a computer. This is one of the reasons why it has a large user community world wide, and why it has been one of the fastest-growing programming languages over the last few years.

Python is a high-level language, which means that you have much less responsibility to take care of detailed computing matters such as memory management and disk access. This is great if you are a scientist or engineer who doesn’t know or care about these things, and you just want to get on with getting your job done.

Since Python is interpreted, you don’t have to compile and build your software before you can run it. You can just type and run. This makes it very productive and easy to work with.

Python’s general-purpose nature means that once you have written a nice application to solve a thermochemical problem, it can be integrated into a web application or some other application written by programmers or other IT people. Python is not like MATLAB, which is purely scientific and technical. It can integrate with and be integrated with virtually any other system.

Our view is that learning Python is a wise investment for any modern scientist and engineer. If you choose to learn it, you will become part of a world-wide movement of people sharing ideas and software, and get access to a multitude of packages related to things like mathematics, chemistry, numerical methods, and much more. If you want a Python module to help you make coffee, you will probably find that as well. (Yup, I just confirmed this. Have a look at this package on GitHub!).

Versions

Python is available in many versions, which may be confusing. The first point to note is that we only make ChemApp for Python available for 3.x of Python, and not for 2.x versions. You should therefore not download or install Python 2.6 or 2.7 if you want to work with ChemApp for Python.

At the time of writing this manual, Python 3.7 - 3.10 were all available. The version of Python that you should use with ChemApp for Python is indicated in the ChemApp for Python distribution file name. An example of such a name is chemapp1.3.0-win-chemapp7.2.0-python3.6.5.tar.gz, which indicates that it is intended for use with Python 3.6.5.

Packages and Modules

When working with Python software, we use the terms package and module, and it is important that you understand them.

A package is analogous to a folder. The folder must contain at least an __init__.py module to be recognised as a package. It can also contain other Python modules, and sub-packages.

A module is a file that contains Python code. When you write your first script, it will be contained in a Python module. Modules can be in the form of text files with the .py extension, or it can be compiled binary files with .so extensions on Linux, and .pyd extensions on Windows. A .pyd file is simply a dynamically linked library (.dll) with a different extension.