OS. Set Up Your Coding Environment
In order to program OpenSTAAD in Python, you will need to set up a development environment.
A develop environment is typically a program that supports writing the code as well as a suite of tools to make that job easier. While computer code could be written in any plain text editor, an integrated development environment (IDE) will make the job much easier and more efficient. For this guide, you will use Microsoft Visual Studio Code. This is a popular programming editor which is free to use and supports many different programming languages through a wide array of extensions.
Note: Microsoft has an excellent reference on getting started programming
in python within Visual Studio Code at
https://code.visualstudio.com/docs/python/python-tutorial.
You are free to use any editor or IDE of
your choice, so long as you have the pywin32 extension added. For example, if you are
comfortable with using Visual Studio 2019, you can read about using Python in Visual
Studio at https://docs.microsoft.com/en-us/visualstudio/python/.
- Download and install Visual Studio Code from https://code.visualstudio.com/
- Install a python interpreter. This is the python language version you will be using. This performs the actual operations of your code. You can download Python from https://www.python.org/downloads/.
- Launch the Visual Studio Code application.
- Install the Python extension in Visual Studio Code. The extension is used to help you easily write Python code in the editor. It can also interact with a interpreter to allow you to run and debug the code from within the editor itself.
- Verify the Python installation.
- Install pywin32. This allows COM objects to interact with Python and is required for using OpenSTAAD in Python. You will use a package management system built into the Python extension to download an install this.