The PSLab Python library provides programmatic access to PSLab boards on PCs. It is also the backend to the PSLab desktop app.
The sources are on GitHub.
Note for older Windows systems
PSLab is using an MCP2200 USB serial adapter. You may need to install the driver from the Microchip website.