r/pythoncoding 23d ago

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

5 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 3d ago

GossipSampling - A Standalone Peer Selection Service for Decentralized Networking

2 Upvotes

This library (tries) to make decentralized networking easy. I'm open to suggestions and contributors and would love to find others that are interested in this topic!

Github Repo

Blog Explaining High Level Theory


r/pythoncoding 10d ago

I created a Flask-based Blog App with Tons of Features! 🔥

5 Upvotes

Hey r/pythoncoding!

I just wanted to share a fun little project I’ve been working on – FlaskBlog! It’s a simple yet powerful blog app built with Flask. 📝

What’s cool about it?

  • Admin panel for managing posts
  • Light/Dark mode (because who doesn’t love dark mode?)
  • Custom user profiles with profile pics
  • Google reCAPTCHA v3 to keep the bots away
  • Docker support for easy deployment
  • Multi-language support: 🇬🇧 English, 🇹🇷 Türkçe, 🇩🇪 Deutsch, 🇪🇸 Español, 🇵🇱 Polski, 🇫🇷 Français, 🇵🇹 Português, 🇺🇦 Українська, 🇷🇺 Русский, 🇯🇵 日本人, 🇨🇳 中国人
  • Mobile-friendly design with TailwindCSS
  • Post categories, creation, editing, and more!
  • Share posts directly via X (formerly Twitter)
  • Automated basic tests with Playwright
  • Time zone awareness for all posts and comments
  • Post banners for more engaging content
  • Easily sort posts on the main page
  • Detailed logging system with multi-level logs
  • Secure SQL connections and protection against SQL injection
  • Sample data (users, posts, comments) included for easy testing

You can check it out, clone it, and get it running in just a few steps. I learned a ton while building this, and I’m really proud of how it turned out! If you’re into Flask or just looking for a simple blog template, feel free to give it a try.

Would love to hear your feedback, and if you like it, don’t forget to drop a ⭐ on GitHub. 😊

🔗 GitHub Repo
📽️ Preview Video

Thanks for checking it out!


r/pythoncoding 15d ago

How to convert model.h5 to TensorFlow; tensorflowjs_converter: command not found

3 Upvotes

I have a model.h5 and I want to use it on my site, so I want to convert it to TensorFlow JS. For this, I need to use the tensorflowjs_converter. I tried installing tensorflowjs with the following command:

sudo pip install tensorflowjs --break-system-packages

But when I try to run the command to convert, this is what I get:

ice@ice-Mint-PC:~$ tensorflowjs_converter --input_format keras "/home/ice/Downloads/handwritten (1).h5" \

/home/ice/Desktop

tensorflowjs_converter: command not found


r/pythoncoding Nov 23 '24

Steganography tool + algo in python

Thumbnail
4 Upvotes

r/pythoncoding Nov 04 '24

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

3 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 Oct 04 '24

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

1 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 Oct 03 '24

How Not to Use Python’s Walrus Operator

Thumbnail differ.blog
0 Upvotes

r/pythoncoding Sep 29 '24

I created FieldList: An alternative to List of Dicts for CSV-style data - Feedback welcome

Thumbnail
1 Upvotes

r/pythoncoding Sep 25 '24

SurfSense - Personal AI Assistant for Internet Surfers.

6 Upvotes

What my project does:

Whenever I'm researching or studying anything, I tend to save a ton of content. It could be a cool article link, a fact someone mentioned in my chats or a blog post about it. But organizing all this content and then effectively researching or learning from it is a difficult task. That’s where SurfSense comes in. SurfSense acts like a personal brain for any content you consume, allowing you to easily revisit, organize, and effectively research and learn from your saved content.

Check it out at https://github.com/MODSetter/SurfSense

Why I am posting here:

Well my project have 3 things where extension and frontend is made in JS but core backend is made in python with LangChain and FastAPI.

If any good python devs could go through my backend and suggest some tips to improve it would be great.

And if u know any good resources about WebSockets implementation with FastAPI do mention in comments.

Target Audience:

Researchers, Students or Anyone who consume a lot of content


r/pythoncoding Sep 23 '24

CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

Thumbnail
0 Upvotes

r/pythoncoding Sep 21 '24

Learn how to build the GUI for A Crytpo Tracking Application in Python - Tkinter

Thumbnail youtu.be
2 Upvotes

r/pythoncoding Sep 17 '24

Maelstrom 0.12.0: Isolate your tests, and run them fast.

5 Upvotes

We’re excited to announce Maelstrom 0.12.0, a test runner for Python that can run tests locally or on a cluster. Our new UI features real-time information about running tests, output from the build, and a new progress bar.

Maelstrom is a suite of test runners, built on top of a general-purpose clustered job engine. Maelstrom packages your tests into micro-containers, then distributes them to be run on an arbitrarily large cluster of test-runners, or locally on your machine using a custom-built, super-fast container runtime.

https://github.com/maelstrom-software/maelstrom


r/pythoncoding Sep 04 '24

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

6 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 Sep 03 '24

Why not just get your plots in numpy?!

Thumbnail
3 Upvotes

r/pythoncoding Sep 02 '24

PiDAR - a DIY 360° 3D Scanner

Thumbnail
6 Upvotes

r/pythoncoding Aug 19 '24

I Created the Definitive AUTOMATIC Shiny Hunter for Pokémon BDSP

2 Upvotes

Hey everyone! I am Dinones! I coded a Python program using object detection that lets my computer hunt for shiny Pokémon on my physical Nintendo Switch while I sleep. So far, I’ve automatically caught shiny Pokémon like Giratina, Dialga or Azelf, Rotom, Drifloon, all three starters, and more in Pokémon BDSP. Curious to see how it works? Check it out! The program is available for everyone! Obviously, for free; I'm just a student who likes to program this stuff in his free time :)

The games run on a Nintendo Switch (not emulated, a real one). The program gets the output images using a capture card, then, it process them to detect whether the pokemon is shiny or not (OpenCV). Finally, it emulates the joycons using bluetooth (NXBT) and control the Nintendo. Also works on a Raspberry Pi!

I don't make money with this, I just feel my project can be interesting for lot of people.

📽️ Youtube: https://www.youtube.com/watch?v=84czUOAvNyk
🤖 Github: https://github.com/Dinones/Nintendo-Switch-Pokemon-Shiny-Hunter


r/pythoncoding Aug 15 '24

SurfSense A Knowledge Graph Brain for your Web Browsing Sessions

1 Upvotes

Well when I’m browsing the internet, I tend to save a ton of content—but remembering when and what you saved? Total brain freeze! ❄️ That’s where SurfSense comes in. SurfSense is like a Knowledge Graph 🧠 Brain 🧠 for anything you see on the World Wide Web. Now, you’ll never forget any browsing session. Easily capture your web browsing session and desired webpage content using an easy-to-use Chrome extension. Then, ask your personal knowledge base anything about your saved content., and voilà—instant recall! 🧑‍💻🌐

The whole backend is made in FastAPI & Langchain in Python.

Do give it a try : https://github.com/MODSetter/SurfSense

and lmk what is your feedback/suggestions.


r/pythoncoding Aug 13 '24

Comments from my professor

7 Upvotes

I have been coding for a long time in Python, but I recently started college to get my bachelor's. My teacher made these comments, and I am not sure how to improve. While I did not get a bad grade, he deducted points, and dont want to make the same mistake.

Cmmments from my teacher:

Your code is clear and easy to understand—great job!

  • Consider adding more comments to explain complex parts of your code.
  • The readability of your code is good, but could be improved with more spacing and indentation

Questions:

How can I add more indentations with Python, as it needs to be indented in a certain way?

What comments can I make about the code, specifically the "complex " parts, as this is a basic example and not complex?

My code: 
class BudgetCalculator:
    def __init__(self):
        self.monthly_income = 0
        self.fixed_expenses = 0
        self.variable_expenses = []

    def gather_user_data(self):
        try:
            self.monthly_income = float(input("Enter your monthly income: "))
            self.fixed_expenses = float(input("Enter your fixed monthly expenses (e.g., rent, utilities): "))
            
            while True:
                var_expense = input("Enter a variable expense (or type 'done' to finish): ")
                if var_expense.lower() == 'done':
                    break
                expense = float(var_expense)
                if expense < 0:
                    print("Expense cannot be negative, please re-enter.")
                else:
                    self.variable_expenses.append(expense)
        except ValueError:
            print("Invalid input. Please enter numeric values.")

    def calculate_total_variable_expenses(self):
        return sum(self.variable_expenses)

    def calculate_remaining_budget(self):
        total_variable_expenses = self.calculate_total_variable_expenses()
        if self.fixed_expenses < 0 or total_variable_expenses < 0:
            raise ValueError("Expenses cannot be negative.")
        if self.monthly_income < (self.fixed_expenses + total_variable_expenses):
            raise ValueError("Expenses exceed income.")
        remaining_budget = self.monthly_income - (self.fixed_expenses + total_variable_expenses)
        return remaining_budget

    def display_result(self):
        try:
            remaining_budget = self.calculate_remaining_budget()
            print(f"Your remaining budget for the month is: ${remaining_budget:.2f}")
        except ValueError as e:
            print(e)

def main():
    budget_calculator = BudgetCalculator()
    budget_calculator.gather_user_data()
    budget_calculator.display_result()

if __name__ == "__main__":
    main()

r/pythoncoding Aug 04 '24

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

5 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 Jul 31 '24

Building code editor that puts an emphasis on learning. Would be great to hear your thoughts and ideas on how I could build it to better suit your use cases - I don't want to blindly add features that nobody needs.

5 Upvotes

You can find it at Stava.io, looking forward to the feedback! :)


r/pythoncoding Jul 30 '24

Maelstrom 0.11.0 – Clustered Test Runner, Now with Improved UI and Golang Support

Thumbnail self.Python
7 Upvotes

r/pythoncoding Jul 19 '24

Coming from Java, I am confused about whether Python has real threads or not.

8 Upvotes

I have read about the Global Interpreter Lock (GIL) and understand that it is a lock per interpreter in Python, which is historical. However, I still see thread packages in Python. Why are they there if the GIL exists? What's the point?

So, what is the verdict here?

Thanks


r/pythoncoding Jul 12 '24

PySkyWiFi: completely free, unbelievably stupid wi-fi on long-haul flights

Thumbnail robertheaton.com
8 Upvotes

r/pythoncoding Jul 12 '24

Shelly blu door and window sensor

2 Upvotes

I have a Shelly blu door and window sensor connected through a Shelly plus 2 PM. I’m trying to find a way to get the status open/closed using python or home assistant.


r/pythoncoding Jul 10 '24

Here’s how you can build and train GPT-2 from scratch using PyTorch

Thumbnail differ.blog
8 Upvotes