Template:PT3 PYTHON WIN VS
Contents
Language - Python
Windows with Visual Studio
Welcome to using Phidgets with Python! By using Python, you will have access to the complete Phidget22 API, including events.
Visual Studio is an IDE provided by Microsoft that can be used to develop code in a wide variety of programming languages, including Python.
Installing the Phidget Python Module
First, install Python3 if you haven't already.
You can install the Phidget22 libraries and python module for your current Visual Studio project with PIP by opening View > Other Windows > Python Environments
Installing the Phidget Python Module
Next, select Packages (PyPI) from the drop-down menu:
Installing the Phidget Python Module
Type Phidget22 into the search bar, then click Install Phidget22:
Success! Your project now has access to Phidget22.
Setting Up a New Project
When you are building a project from scratch, or adding Phidget functionality to an existing project, you'll need to configure your development environment to properly link the Phidget Python library.
To start, create a new Python project:
Setting Up a New Project
Then open the Python file that was generated with the project.
Finding Code Samples
To find the code sample to use for your Phidget, navigate to the Code Samples page and select your device from the drop-down menu.
Once you select your device, the code sample generator will give you a working code sample, and a selection of options to customize it to your needs.
Using the Code Samples
If it's unclear what any of the options do, click on the nearby '?' for more info.
Once you've made your selections, click the copy button and paste the code into your new project.
What's Next?
Now that you've set up Phidgets in your programming environment, you should read our guide on Phidget Programming Basics to learn the fundamentals of programming with Phidgets.