Python
- dht11 sensor with arduinowww.slyautomation.com dht11 with arduino
To read a dht11 temperature and humidity sensor using an Arduino, you’ll need to use a library that simplifies communication with the sensor. Below is a simple Arduino sketch to read data from a dht11 sensor and display the temperature and humidity on the Serial Monitor. Components Needed: Aliexpres...
- Python Bindings for llama.cppgithub.com GitHub - abetlen/llama-cpp-python: Python bindings for llama.cpp
Python bindings for llama.cpp. Contribute to abetlen/llama-cpp-python development by creating an account on GitHub.
Simple Python bindings for @ggerganov's llama.cpp library. This package provides:
Low-level access to C API via ctypes interface. High-level Python API for text completion OpenAI-like API LangChain compatibility LlamaIndex compatibility OpenAI compatible web server Local Copilot replacement Function Calling support Vision API support Multiple Models
Documentation is available at https://llama-cpp-python.readthedocs.io/en/latest.
- Translation of Python code to Coq | Formal Landformal.land 🐍 Translation of Python code to Coq | Formal Land
We are starting to work on a new product, coq-of-python. The idea of this tool is, as you can guess, to translate Python code to the proof system Coq.
- A library for creating fully typed declarative API clients quickly and easilygithub.com GitHub - martinn/quickapiclient: Create fully typed declarative API clients quickly and easily.
Create fully typed declarative API clients quickly and easily. - martinn/quickapiclient
cross-posted from: https://programming.dev/post/13395352
> Would love to hear any suggestions, feedback or comments.
- Announcing py2wasm: A Python to Wasm compilerwasmer.io Announcing py2wasm: A Python to Wasm compiler · Blog · Wasmer
py2wasm converts your Python programs to WebAssembly, running them at 3x faster speeds
- Guido in the NY Times crosswordframapiaf.org Barbara Shaurette :python: (@bshaurette@social.linux.pizza)
Attached: 1 image in today’s NY Times crossword (this is how you know he’s finally made it):
- Idle Clicke in Tkinter for Pydroid3 or Desktopgithub.com Build software better, together
GitHub is where people build software. More than 100 million people use GitHub to discover, fork, and contribute to over 420 million projects.
It runs!.. it's just a toy.
- Single and Double Underscores in Python Names – Real Pythonrealpython.com Single and Double Underscores in Python Names – Real Python
In this tutorial, you'll learn a few Python naming conventions involving single and double underscores (_). You'll learn how to use this character to differentiate between public and non-public names in APIs, write safe classes for subclassing purposes, avoid name clashes, and more.
- win32api alternative for mac and linux that isnt pyautogui, and preferably faster
is there any win32 alternative that is multi platform and doesnt consume too much resources and are fast? thx
- Accelerating Python Code with Numba Vectorize - CodersLegacycoderslegacy.com Accelerating Python Code with Numba Vectorize - CodersLegacy
We will delve into the inner workings of Numba Vectorize, understand how it harnesses the power of SIMD operations to improve performance.
- GitHub - Lancetnik/Propan: Propan is a powerful and easy-to-use Python framework for building event-driven applications that interact with any MQ Brokergithub.com GitHub - Lancetnik/Propan: Propan is a powerful and easy-to-use Python framework for building event-driven applications that interact with any MQ Broker
Propan is a powerful and easy-to-use Python framework for building event-driven applications that interact with any MQ Broker - GitHub - Lancetnik/Propan: Propan is a powerful and easy-to-use Pytho...
- Dealing with Databases - Inserting, Updating Etc.
Wondering if anyone here has some advise or a good place to learn about dealing with databases with Python. I know SQL fairly well for pulling data and simple updates, but running into potential performance issues the way I've been doing it. Here are 2 examples.
-
Dealing with Pandas dataframes. I'm doing some reconciliation between a couple of different datasources. I do not have a primary key to work with. I have some very specific matching criteria to determine a match. The matching process is all built within Python. Is there a good way to do the database commits with updates/inserts en masse vs. line by line? I've looked into upsert (or inserts with clause to update with existing data), but pretty much all examples I've seen rely on primary keys (which I don't have since the data has 4 columns I'm matching on).
-
Dealing with JSON files which have multiple layers of related data. My database is built in such a way that I have a table for header information, line level detail, then third level with specific references assigned to the line level detail. As with a lot of transactional type databases there can be multiple references per line, multiple lines per header. I'm currently looping through the JSON file starting with the header information to create the primary key, then going to the line level detail to create a primary key for the line, but also include the foreign key for the header and also with the reference data. Before inserting I'm doing a lookup to see if the data already exists and then updating if it does or inserting a new record if it doesn't. This works fine, but is slow taking several seconds for maybe 100 inserts in total. While not a big deal since it's for a low volume of sales. I'd rather learn best practice and do this properly with commits/transactions vs inserting an updating each record individually within the ability to rollback should an error occur.
-
- Is installing personal packages with pipx an anti-pattern?
So I made a small little command-line utility for myself just for practice, but I had a hard time figuring out how to actually turn it into something I can just use on the command line with no fuss. It uses a virtual environment as Python packages should, so it needs to be run in that environment and I was having trouble figuring out how to do it.
But then I remembered that pipx runs application in a virtual environment, and after checking the docs, I found out that it allows installing local packages by just pointing
install
at the package directory. So I did, and after setting up the command name as a project script that points tomain
it ended up working.I haven't ever heard of anyone doing something like this for a personal program though. Is something like this a bad idea? Is it over engineering or error prone? Is there another way that most people do something like this?
- This is valid Python syntax
cross-posted from: https://programming.dev/post/21515
> Some surprising, but valid, python syntax examples.
- Is learning programming worth it? Outside of a career, what can I do with programming?
I learned a little bit of python back in college with the hope that it would give me a competitive edge in the field I hoped to enter. Lo and behold, I got a job in a different industry entirely and any knowledge of coding I once had became irrelevant.
Would it be worth it to pick up my python textbook again and self-teach in my free time if I don't want to make a career of coding? What exactly can python be used to create?
- What python project(s) are you currently working on?
With r/python out for the next 48 hours, here’s a post to promote continuing discussion a language we all love. Python.
- Has anyone tried nogil?
I was playing a bit with the nogil version of Python 3.12. In theory it should have large gains for multi threaded workloads (at the expense of single threaded workloads).
Has anyone given it a try?
https://github.com/colesbury/nogil-3.12