Skip to content

Latest commit

 

History

History
38 lines (30 loc) · 1.25 KB

README.md

File metadata and controls

38 lines (30 loc) · 1.25 KB

PyOG

A python library for interfacing with OutGauge in a (hopefully) simple way.

Designed for WinPython 3.11, but should run on most past Python versions.

Usage

  1. Clone the project
  • git clone https://github.com/jeepracer98/pyog.git
  1. Change directory to the top level folder of pyog
  • cd pyog
  1. Create and activate a virtual enviroment (recommended)
  • python3 -m venv win-venv
  • win-venv\Scripts\activate
  1. Install pyog with pip
  • python3 -m pip install -e .
  • This will only work if you are in the pyog folder where setup.py is.
  1. If you plan to be commiting to the pyog project, install pre-commit with:
  • python3 -m pip install -r requirements-dev.txt
  • pre-commit install

Then you can integrate pyog into programs by opening the socket and reading data from it. Here's a simple example which will keep trying to read data until you press Ctrl+C.

import pyog

IP = "127.0.0.1"
PORT = 4444

with pyog.create_socket(IP, PORT) as sock:
    while True:
        print(pyog.read_outgauge_data(sock))
	# and/or pyog.read_motionsim_data(sock)

If you're using both OutGauge and MotionSim, make sure they aren't running on the same port. This will cause the two streams of data to mix together and get garbled.