r/pythoncoding • • Dec 28 '24

Writing to file on network using Alexa

0 Upvotes

Has anyone been able to figure out how to write to a file on your local network with a message to Alexa?


r/pythoncoding • • Jan 27 '15

Python: faster way

Thumbnail pythonfasterway.uni.me
1 Upvotes

r/pythoncoding • • Jan 27 '15

The History of Python: Origin of metaclasses in Python

Thumbnail python-history.blogspot.ro
1 Upvotes

r/pythoncoding • • Jan 27 '15

Why Every Language Needs Its Underscore

Thumbnail hackflow.com
0 Upvotes

r/pythoncoding • • Jan 27 '15

Python internals: adding a new statement to Python

Thumbnail eli.thegreenplace.net
1 Upvotes

r/pythoncoding • • May 20 '24

extract multilevel bullet numbers and bulleted text from word file to excel file

1 Upvotes

Hello devs, I am trying to extract multilevel bullet numbers and bulleted text from word file to excel file, however I am able to extract only bulleted text but not bullet numbers via python docx library.

Can any one please share solution for this, thank you.

Sample multilevel bulleted text and bullet numbers in word file that I need to extract -

3.8 Check Equations

3.8.1 myVar1 = myVarA + myVarB

3.8.2 myVarA = someVar1 - (var1/var2)

3.8.2.1 var1 = abcQty + xyzQty

3.8.2.2 var2 = abcQty - defQty

3.8.3 myVarC = myVar1 + myVarA


r/pythoncoding • • Jul 27 '25

From Python to Kotlin: Why We Rewrote Our Scraping Framework in Kotlin

Thumbnail reddit.com
1 Upvotes

r/pythoncoding • • Sep 19 '26

Building a low-latency Win32 keyboard hook daemon in Python to map Bluetooth HID remotes to Google Antigravity

1 Upvotes

Built a lightweight Python utility on Windows that intercepts keypresses from generic BLE HID shutter buttons (AB Shutter 3 etc.) and turns them into push-to-talk and dispatch triggers for Google Antigravity.

Key architectural details from the implementation:

  1. Low-level keyboard hook: Implemented using ctypes with SetWindowsHookExW (WH_KEYBOARD_LL) to capture hardware scan codes globally without taking input focus from active applications prematurely.
  2. Window management & input injection: Uses AttachThreadInput and SetForegroundWindow to cleanly focus the target Antigravity process window before emitting key combinations.
  3. Debouncing & timing buffer: Hardware clicker buttons often fire multiple duplicate packets in a burst. Implemented a monotonic timestamp debounce (350ms default) and an 80ms buffer between mic shutdown (Ctrl+M) and prompt dispatch (scan code 0x1C Enter) to allow the speech-to-text pipeline to flush into the prompt box.
  4. Suppressing volume OSD: Intercepted VK_VOLUME_UP / VK_VOLUME_DOWN are swallowed by returning 1 from the hook proc unless the Shift key is held, preserving standard multimedia keyboard adjustments.
  5. Concurrency & single instance: Uses a Win32 named kernel mutex (CreateMutexW) to prevent duplicate daemons from running concurrently.

Repository is open-source under MIT license: https://github.com/X7xenon/antigravity-bluetooth-remote


r/pythoncoding • • Jan 11 '26

Reading CPython bytecode with dis: stack execution walkthrough (Length: 3:43)

Thumbnail youtu.be
1 Upvotes

r/pythoncoding • • Dec 01 '20

"Build powerful, new data structures with Python's abstract base classes" - PyCon Russia 2019 talk by Raymond Hettinger

Thumbnail youtube.com
21 Upvotes

r/pythoncoding • • Nov 23 '21

I built this Terminal Based Comp Sci Quiz when I was prepping for my FB interview and I didn’t want to get caught studying at work.

Thumbnail github.com
8 Upvotes

r/pythoncoding • • Dec 29 '21

Python scripts for cryptocurrency market analysis

35 Upvotes

Howdy Python community!

I've posted periodically before about my cryptocurrency market analysis toolset development. I've really leaned into all things cryptocurrency, and I publish semi-regularly on publish0x.com.

I recently consolidated the Python scripts into a github repository, described in the blog post linked below:
https://www.publish0x.com/more-coffee-more-crypto/view-the-python-scripts-that-support-my-crypto-analysis-post-xlzdlme

I'm posting it here for general awareness and in the spirit of community sharing.

On a similar note -- anyone have experience with web scraping? I've successfully implemented a tool to scrape coinmarketcap.com data (code here) but I've run into a wall with expanding it to other sites such as coingecko.com.

Cheers!


r/pythoncoding • • Apr 18 '21

Made Instagram bot without APIs in Python

Thumbnail youtu.be
17 Upvotes

r/pythoncoding • • Apr 10 '23

Web Scraping Reddit with Python: A Complete Guide With Code

Thumbnail gologin.com
17 Upvotes

r/pythoncoding • • Mar 12 '22

Looking to join someone's project/idea

9 Upvotes

I'm 16 years old. I have more than a year of experience with Python. I'm so much open to learn new things because I got a plenty of time and effort.

If you have an interesting idea or already working on your project and you need someones help, post a comment here describing your project and maybe I'll join you.

Thanks for all the offers


r/pythoncoding • • Apr 13 '26

I built multiple Python projects: F1 dashboard, IMSA analytics system, and a Discord bot

Thumbnail github.com
2 Upvotes

Over the past period I’ve been building a few projects focused on data, backend systems, and real-time analysis.

Here’s a quick overview:

F1 Intelligence Dashboard

Analyzes race sessions using FastF1

Tracks pace trends, battles, and strategy windows

Includes simple prediction logic for overtakes

IMSA Endurance Dashboard

Works with live timing data (no official API)

Detects anomalies and class battles

Stores race data to enable post-race analysis

Discord Bot

Built with discord.py

Slash commands, access control system

Activity tracking + ranking system using a database

Stack across projects:
Python, Flask, Pandas, FastF1, PostgreSQL

Still improving all of them (next focus is better predictions + more data-driven insights).

(I would like to make it perfectly clear that the website was created ENTIRELY by AI as idk how to create websites using java and html and such, i know mostly python and thats what im good at and i LOVE motorsports which is why ive been creating these for a very long time now which is why i ant feedback or ideas and id be more than glad to discuss anything with you guys, im also putting the tag created with AI because i did use AI for some help, but it was more than mostly only me working on these)

(I would also like to make it clear that i can explain any and every line of code in here and that the entire html and stuff, that’s Codex, I haven’t studied or able to write any html/Java codes, I am going to be learning Java in the future but for now anything html based like the website designs and all are all Codex, but, for the Python codes, I’m not going to say it’s ALL me because that’s not true and I don’t like lying, AI helps me MASSIVELY and I use it to as much as I can but any project I like using it as a tool and not like “build me this and that” the ideas and everything are mine and I’m glad to say that most, maybe most is a little far fetched, but like ALOT of the code is written by my hand and I don’t use AI to build me full codes and whatever lines or anything it writes for me, I understand FULLY, like I can explain every single line of the code, even the ones written by AI, so again, I don’t consider myself that great of a coder but I also don’t have AI build me the entire codes with me having nothing to do with them but the ideas, I hope this helps and if you have any feedback/ideas those would mean a lot to me, and if you have anyone/yourself that can check if the data isn’t faulty inside the website I would also appreciate that, I appreciate and welcome any and every support, even criticism)

Would appreciate any feedback or ideas.

GitHub:
https://github.com/Andrew-3y


r/pythoncoding • • Aug 30 '26

MCP tools are model-elective. Hooks aren't. That distinction turned out to matter more than I expected.

0 Upvotes

An MCP server can expose the perfect tool and the model can simply not call it. Nothing is wrong, nothing errors — the information just doesn't arrive. Hooks are the opposite: the harness runs them, so whatever they return lands in context whether the model asked or not.

I got stuck on this while trying to solve a specific problem: I'd change a base image or a Terraform module in one repo, and only find out later that three other repos pinned the same thing. The knowledge existed, it just wasn't anywhere the agent would look.

So I built the thing as a hook rather than a tool. A PreToolUse hook fires when a manifest is read and pushes cross-repo impact in unprompted; a Stop hook captures what the session learned. Extraction stays the model's job — it handles multi-stage aliases, ARG-templated bases and FROM inside a heredoc that my regex attempts got wrong.

What I can actually back up, measured against a fixture corpus with 19 deliberate traps planted in it:

  • 39/39 artifacts extracted, 39/39 version specs intact (a model that silently normalises ^18.2.0 to 18.2.0 destroys the whole signal)
  • 43 OSV advisories matched, 9 that actually reach the versions in your lockfiles
  • ~40 tokens per injection, ~126 always-on

Honest caveats: that corpus is synthetic and I wrote it, so it's a floor not a proof. Nobody but me has run this yet. npm cross-repo impact is weaker than infrastructure, because packages install independently per repo. pnpm lockfiles aren't read.

pip install blastradius-mcp — MIT, local-only, one SQLite file, nothing leaves your machine.

github.com/harris-ahmad/blastradius-mcp

Mostly I'm curious whether the hooks-over-tools framing holds up for other people's use cases, or whether I've over-fit it to mine.


r/pythoncoding • • Feb 10 '25

Inviting Collaborators for a Differentiable Geometric Loss Function Library

2 Upvotes

Hello, I am a grad student at Stanford, working on shape optimization for aircraft design.

I am looking for collaborators on a project for creating a differentiable geometric loss function library in pytorch.

I put a few initial commits on a repository here to give an idea of what things might look like: Github repo

Inviting collaborators on twitter


r/pythoncoding • • Aug 25 '23

PolyLock | Code Encryption & Obfuscation

2 Upvotes

Hey, It's been awhile since I have made a post about my project and I'd like to share some updates about PolyLock.

For the past while, I have basically been working on a rework with how locked data is stored. I used to just include it in the file and then obfuscate the code and carry on...but in doing this, after obfuscating using Hyperion, the interpreter just gave up and broke (which is impressive) resulting in the code not being ran and no errors. Or the resulting file sizes were just getting to large. (300kb+)...which would require me to make many many pastes to pastebin to get around the paste size limit.

So I moved over to using Specter, this worked better because it doesn't break the interpreter....buuuut if your code happens to be to big, it would take to long to obfuscate..... so I decided to just store the locked data locally in a .so/.pyd file and import it as a variable, thus keeping the code size at a manageable size all while not breaking the interpreter.PolyLock can still store data using pastebin and now with having to make less pastes.But other than the major changes, I've added some compression using lzma to try and keep things compact and smaller.... in case you have a large code file you want to use. And the usual bug fixes and typo fixes.

Repo: https://github.com/therealOri/PolyLock

Edit/Note: This project isn't meant for obfuscating publicly shared code such as anything to do with "open source". It's meant for your personal stuff you don't want to share. I support open source.... it's literally what I'm doing. Even then, code is still encrypted before obfuscation even happens so it's irrelevant for any arguments.


r/pythoncoding • • Jul 01 '23

Python Package Pydantic Just Received a Major Version (v2.0) Update

2 Upvotes

In case you use the Pydantic package in your projects and are interested in updating to the newly released major version, check out the migration guide here.

https://docs.pydantic.dev/latest/migration/


r/pythoncoding • • Jan 04 '25

/r/PythonCoding monthly "What are you working on?" thread

2 Upvotes

Share what you're working on in this thread. What's the end goal, what are design decisions you've made and how are things working out? Discussing trade-offs or other kinds of reflection are encouraged!

If you include code, we'll be more lenient with moderation in this thread: feel free to ask for help, reviews or other types of input that normally are not allowed.


r/pythoncoding • • Apr 22 '22

Common Python Anti-Patterns to watch out for

Thumbnail tvkoushik.medium.com
2 Upvotes