Setting up a Python development environment
These are the steps for setting up a development environment to control and analyze data from INFINICAM using Python on Windows.
1. Installing Python
Section titled “1. Installing Python”-
Download the installer
Visit the official Python downloads page and click the “Download Python 3.x.x” button to download the installer (
.exe). -
Run the installer and configure PATH
Run the downloaded file. When the screen appears, be sure to check the following box as the very first step.
After checking the box, click “Install Now” in the center of the screen to run the installation.
-
Confirm the installation completed
Open a command prompt (press
Win+Rand typecmd), and run the following command.Terminal window python --versionIf a version number such as
Python 3.x.xis displayed, Python has been installed successfully.
2. Installing the INFINICAM SDK (pypuclib)
Section titled “2. Installing the INFINICAM SDK (pypuclib)”Install pypuclib, the library used to control the camera from Python.
-
Obtain and install from GitHub
Visit photron-limited/pypuclib (GitHub).
- Click
<> Codein the upper right, then 👉Download ZIPto download it, and extract it to a folder of your choice. - Open a command prompt and use the
cdcommand to move to the extractedpypuclibfolder.Terminal window cd C:\path\to\pypuclib - Run the following command to install it.
Terminal window pip install .
- Click
-
Verify it works
Run the following command at the command prompt to test that the library loads correctly.
Terminal window python -c "import pypuclib; print('Installation successful!')"If no error occurs and
Installation successful!is displayed, your environment setup is complete!
3. Creating and running your first program
Section titled “3. Creating and running your first program”Using a text editor (such as VS Code), create a file named test.py, write the following code, and run it.
import pypuclib
print("pypuclib was loaded successfully.")How to run it (command prompt):
python test.py