Python Development Environment Setup¶
These are the instructions for installing and configuring software to provide the best script development environment for Sutron Satlink 3 and XLink 500.
These instructions should only be followed if you plan on developing Python code. If all you wish to do is to load an existing Python script into the station, please see the following page: Loading a script and setup into Satlink 3 and XLink 500
Light weight Python coding may be done without installing the development environment. Please see Writing Measurement Scripts
The instructions are geared for a Windows PC. However, Sutron Python development may be done on other platforms too.
Python source code examples are hosted on GitHub.
Git is version control software. It plugs nicely into PyCharm, simplifies installation, and allows for contribution to the Sutron Python GitHub project.
While you may download those examples through your browser, if you are planning on developing Python code, you really should get Git software.
2.1 Please choose one:¶
- Either install Git or download the examples
A. Either Install Git¶
- Download Git for Windows: https://git-scm.com/download/win
- Install Git
- Use default options
Python is freely available. It is required to run Python code on your PC.
- Download https://www.python.org/downloads/
- The latest version of Python is likely fine. We developed with 3.5.
- Run the executable downloaded from python.org
- Make sure to check the “Add Python to Path” option
- Choose Install Now
- If your computer requires administrative privileges to install programs, you may need to do a custom install and make sure to check box to install for all users.
You may verify installation is good and OS environment is setup by opening a command window (CMD) and typing in “python” and enter. You should see 3 arrow prompt show up indicating python is running. You can press Ctrl+Z to exit out of the python prompt.
PyCharm is an integrated development environment that makes it easier to code in Python.- PyCharm may be used to write and debug Python code.- PyCharm may also be used to load Python scripts into Satlink.- PyCharm features Git integration, making it easy to access the example code and contribute to the Python libraries.
- Download PyCharm from:Make sure to get the free community version.
- Run the downloaded file and complete PyCharm install with default options
3A. If you have installed Git, hook into the Sutron Python project on GitHub
- Run PyCharm- Choose Check out from Version Control -> Git- For the URL, paste in https://github.com/SutronPyto/LinkPython- For the Directory, choose any local folder- Click Clone- At this point, the source code has been downloaded onto your PC.
3B. If you have downloaded the examples onto your computer (e.g. in “C:\pyto”):
- Go to PyCharm -> File -> Settings -> Project -> Project Interpreter- Check that the Python Interpreter says Python 3- The folders must be marked as source.- Go to PyCharm -> File -> Settings -> Project -> Project Structure- Right click pc folder and mark it as source- Do the same for the src folder