INSERT or UPDATE Example What we actually do in SQLite is somehing they call UPSERT
All posts by
Auto save on debug/run
Menu > File > Preferences > Task: Save Before Run In theory this should be all we need, but when set to ‘always’ it doesn’t work for running Python code. Hopefully this will get fixed sometime… Instead we have to do this for now: Files: Auto Save = onFocusChange Files: Auto Save Workplace Files Only […]
Buffers
Move buffer down one place Move buffer up one place
IO pins on the Raspberry Pi
See the section on it here
SPI on Raspberry Pi OS
See https://raspberry-projects.com/pi/programming-in-python/spi-programming-in-python/using-the-spi-interface-2
I2C on Raspberry Pi OS
See https://raspberry-projects.com/pi/programming-in-python/i2c-programming-in-python/using-the-i2c-interface-2
Using perf_counter
The perf_counter() function returns the float value of time in seconds. It uses a performance counter, i.e. a clock with the highest available resolution to measure a short duration. It includes time elapsed during sleep and is system-wide. The reference point of the returned value is undefined, so you must measure at the start and […]
Detect Windows vs Linux
Detecting Windows or Linux in code Import You can use the same if statement for import etc:
Virtual environment in VS Code for Windows
Creating a virtual environment is good practice anyway for Python development in general, as it helps to manage dependencies and avoid conflicts. Create virtual environment Use the Command Palette (CTRL+SHIFT+P) to open a new terminal session with “Terminal: Create New Terminal”. Then create a new virtual environment by running the following commands in the terminal: […]
Virtual environment on Raspberry Pi
Creating a virtual environment for python programs See here.