Python Daily – Telegram
Python Daily
2.56K subscribers
1.49K photos
53 videos
2 files
39.1K links
Daily Python News
Question, Tips and Tricks, Best Practices on Python Programming Language
Find more reddit channels over at @r_channels
Download Telegram
D Monthly Who's Hiring and Who wants to be Hired?

For Job Postings please use this template

>Hiring: [Location\], Salary:[\], [Remote | Relocation\], [Full Time | Contract | Part Time\] and [Brief overview, what you're looking for\]

For Those looking for jobs please use this template

>Want to be Hired: [Location\], Salary Expectation:[\], [Remote | Relocation\], [Full Time | Contract | Part Time\] Resume: [Link to resume\] and [Brief overview, what you're looking for\]

​

Please remember that this community is geared towards those with experience.

/r/MachineLearning
https://redd.it/1ftdkmb
PyUiBuilder: The only Python GUI builder you'll ever need.

Hi all,

Been working on a Python UI Builder project for a while and wanted to share it with the community.

You can check out the builder tool here: **https://pyuibuilder.pages.dev/**

Github Link: **https://github.com/PaulleDemon/PyUIBuilder**

What My Project Does?

PyUIBuilder is a framework agnostic GUI builder tool for python. You can output the code in multiple UI library based on selection.

Some of the features:

While there are a lot of features, here are few you need to know.

Framework agnostic - Can outputs code in multiple frameworks.
Easy to use.
Pre-built UI widgets
Plugins to support 3rd party UI libraries
Generates python code.
Upload local assets.
Generates requirements.txt file when needed

Supported frameworks/libraries

Right now, two libraries are supported, other frameworks are work in progress

Tkinter - Available
CustomTkinter - Available
Kivy - Coming soon
PySide - Coming Soon

Roadmap

You can check out the roadmap for more details on what's coming [Roadmap](
https://github.com/PaulleDemon/PyUIBuilder/blob/main/roadmap.md)

Target Audience:

People who want to quickly build Python GUI
People who are learning GUI development.
People who want to learn how to make a GUI builder tool (learning resource)

Comparison (A brief comparison explaining how it differs from existing alternatives.)

Right now most available tools are library/framework specific.
Many try to give you code in xml instead of python making it

/r/Python
https://redd.it/1ftlhvy
Rant of the Day

3 years ago I was working in tax when I got a taste for the potential of Python for problem solving. I got hooked and spent as much time as possible to understand Python for data analytics. I love using Python, idk but the feeling I get when a piece of code (written shitty) actually works....ahhh its amazing.
Kinda like Frankenstein.... "IT LIVESSSS!" Basically i really enjoy creating and solving problems with it.

Fast forward 3 years, and I managed to get a position of Senior Manager on Data Management, thinking ah yes finally I get to work on the things I like.

8 months in and I have YET to write a piece of code. Literally my entire time is spent replying to emails, fixing problems other people cause, having to deal with office drama, never ending meetings and top management seem to never be able to decide on anything. The amount of issues that come up on a daily basis is nuts and I never have time to sit down and be creative. Yesterday I lost my shit during a useless 4 hour meeting that could have been solved easily with a well

/r/Python
https://redd.it/1ftl52n
Any state machine fans​ out there?​ Got any fun/awful stories?

I first started to appreciate finite state machines about 15 years ago when I was creating a custom radio protocol for low speed long distance links. Nothing too fancy, but the protocol had retries and acknowledgements. Like a tiny TCP stack.

About 8 years ago I became a state machine nerd out of necessity at work. Sink or swim. Although it was hectic, it pushed me to create a very useful state machine tool.

# The frickin huge LCD GUI

My first project at a new company was very ambitious for a solo dev. In a short amount of time, I needed to create a custom user interface for a 2x20 character LCD that had a lot of different menu pages. 107 pages in total, arranged into different hierarchies. Some of the menus were calibration and setup wizards. Some showed live data. Some were interactive and allowed editing parameters. Each of those 107 pages also needed to support multiple languages (English, German, Russian, Spanish).

A previous developer (that quit before I joined) had tried a data driven menu approach. They defined the entire menu layout and page transitions in data. This made perfect sense for a while until the client started adding tricky requirements

/r/Python
https://redd.it/1ftndij
What Database should I use if I get to nearly 10k users?

If you were building a website with Django, would you stick with the Mysql bundled with Django to serve as database for over 10k users or use another DBMS?

/r/django
https://redd.it/1ftl839
ryp: R inside Python

Excited to release ryp, a Python package for running R code inside Python!

[https://github.com/Wainberg/ryp](https://github.com/Wainberg/ryp)

ryp makes it a breeze to use R packages in your Python projects.

**What My Project Does**

ryp is a minimalist, powerful Python library for:

* running R code inside Python
* quickly transferring huge datasets between Python (NumPy/pandas/polars) and R without writing to disk
* interactively working in both languages at the same time

**Target Audience**

Data scientists and engineers, bioinformaticians, Python package developers, ...

**Comparison**

ryp is an alternative to the widely used [rpy2](https://github.com/rpy2/rpy2) library. Compared to rpy2, ryp provides:

* increased stability
* a much simpler API, with less of a learning curve
* interactive printouts of R variables that match what you'd see in R
* a full-featured R terminal inside Python for interactive work
* inline plotting in Jupyter notebooks (requires the `noscriptlite` R package)
* much faster data conversion with [Arrow](https://arrow.apache.org/) (also provided by [rpy2-arrow](https://github.com/rpy2/rpy2-arrow))
* support for *every* NumPy, pandas and polars data type representable in base R, no matter how obscure
* support for sparse arrays/matrices
* recursive conversion of containers like R lists, Python tuples/lists/dicts, and S3/S4/R6 objects
* full Windows support

ryp does the opposite of the [reticulate](https://rstudio.github.io/reticulate) R library, which runs Python inside R.

/r/Python
https://redd.it/1ftuqhj
Need some advice on how to proceed with a project for multiple users on same network

so, im making a data entry form, where, the users can see all the data they've entrered, but the admin can see the data entries of all the users,

i started making the project yesterday, but was stuck in the authentication part, using mysql.

would appriciate the tips / pointers to move ahead

/r/djangolearning
https://redd.it/1ftgukn
Get clean markdown from any data source using vision-language models in Python

I have found that quality data preprocessing for LLMs from raw data sources can be an incredibly difficult task, so I'm sharing a new project I began working on this summer to solve this problem.

What My Project Does:

The package in question is an open-source project designed to simplify the process of scraping clean data from various sources (PDFs, URLs, Docs, Images, etc). Whether you're working with PDFs, web pages, or images, it can handle the extraction into a clean markdown format. Unlike traditional scraping tools, it is able to understand the context and layout of documents, thanks to vision-language models. It even handles complex tables and figures.

The beauty of The Pipe is that it's not just a black box. It's open-source so you can peek under the hood, understand how it works, customize it to fit your specific needs, etc. The Python library is quite thoroughly documented for this kind of stuff.

Comparison:

Look at existing Python packages for document scraping such as PyPDF2, Unstructured, PyMuPDF (fitz), PDFMiner, Tabula-py, Camelot, pdfplumber, and marker. While these tools are great at basic text extraction, they often struggle with more complex tasks like handling scanned PDFs, irregular data tables, tables that span multiple pages, and documents

/r/Python
https://redd.it/1ftwu2p
ryp: R inside Python

Excited to release ryp, a Python package for running R code inside Python! ryp makes it a breeze to use R stats packages in your Python projects.

https://github.com/Wainberg/ryp

/r/pystats
https://redd.it/1ftvafi
CORS and CSRF Configuration for a Separate Frontend and Backend? Willing to Pay

I have a website I am working on that uses Django and Svelte. Django acts as an API using Django Ninja. The frontend uses Svelte's SvelteKit framework and makes API calls to the Django backed. I have already created a github repo to hopefully make this easier and quicker: https://github.com/SoRobby/DjangoSvelteCookieAuth/tree/main.

The site is intended to be hosted on Digital Ocean (DO) on potentially two separate domains. Example of this would be below, where the frontend and backend are on separate subdomains.

Backend: https://example-backend-8lntg.ondigitalocean.app/

Frontend: https://example-frontend-gbldq.ondigitalocean.app/


Issue: I have been experiencing CORS and CSRF related issues that I can't seem to resolve. The site will use cookie-based authentication.

I have reached my threshold and am willing to pay ($200, via paypal or venmo) the first person that is able to solve these issues without sacrificing security, while remaining on Digital Ocean and deploying as an app and not a Docker container.

----

More details about the problem:
On the backend in settings.py, I have configured CORS, CSRF Cookies, and Sessions.

I am experiencing an issue that I cannot resolve and it relates to an error message of Forbidden (CSRF cookie not set.). On the frontend in Svelte, inside the hooks.server.ts file, whenever the frontend page is loaded,

/r/django
https://redd.it/1fu4qgs
django learning curve

how much time does it takes to learn django if i put in 1 hour per day is it doable by the end of this year given that i have done some leetcode problems and machinelearning basics using python.



and how does django compares to other frameworks in backend devolopment is it widely used in the industry


mods please delete this if its not allowed here

/r/django
https://redd.it/1fu5yb3
Wednesday Daily Thread: Beginner questions

# Weekly Thread: Beginner Questions 🐍

Welcome to our Beginner Questions thread! Whether you're new to Python or just looking to clarify some basics, this is the thread for you.

## How it Works:

1. Ask Anything: Feel free to ask any Python-related question. There are no bad questions here!
2. Community Support: Get answers and advice from the community.
3. Resource Sharing: Discover tutorials, articles, and beginner-friendly resources.

## Guidelines:

This thread is specifically for beginner questions. For more advanced queries, check out our [Advanced Questions Thread](#advanced-questions-thread-link).

## Recommended Resources:

If you don't receive a response, consider exploring r/LearnPython or join the Python Discord Server for quicker assistance.

## Example Questions:

1. What is the difference between a list and a tuple?
2. How do I read a CSV file in Python?
3. What are Python decorators and how do I use them?
4. How do I install a Python package using pip?
5. What is a virtual environment and why should I use one?

Let's help each other learn Python! 🌟

/r/Python
https://redd.it/1fu2yo4
Cannot send JSON with template

I have a problem where it keeps escaping the quotation marks.

This is my code:

@app.route('/')
def home():
    gameslist = {"message": "Welcome to the Game Submission Page!"}
    dump = json.dumps(games
list)
    return rendertemplate('index.html', initialdata=gameslist)

and in my html

    <noscript>
        const initialData = "{{ initial
data }}"
        console.log(initialData)
    </noscript>

Console.log(initialData) produces "{\&#39;message\&#39;: \&#39;Welcome to the Game Submission Page!\&#39;}" regardless if I use json.dumps or not.

When I try "{{ initial_data | tojson }}" (also with "| safe") I get "Unexpected token '{'" when using json.dumps and without json.dumps I get "Unexpected identifier 'message'"

What am I doing wrong? Thanks.

/r/flask
https://redd.it/1ftu59h
Heads up - until October 7, you can get 30% off PyCharm while donating to Django

Every year JetBrains and the Django Software Foundation partner on a great deal for everyone. You get a 30% discounted year of PyCharm, AND the DSF gets 100% of the money. It's basically making a donation to help support Django and getting a great product in return.

This is the DSF's biggest fundraising event of the year, and a great way to contribute back to Django while also picking up a world-class Python IDE in the process.

Django blog: https://www.djangoproject.com/weblog/2024/sep/23/pycharm-django-campaign-2024-encore/

Direct link to discount: https://www.jetbrains.com/pycharm/promo/support-django/

/r/django
https://redd.it/1fubnpx
Looking for a Django package to quickly add a blog to my existing project

Hey everyone!
I'm currently running a Django project and would like to add a blog feature to it. Is there a package or app that I can install to quickly set up a blog? Ideally, I'd want something that is easy to integrate into my existing project and doesn't require a full rebuild. Any suggestions for good blog packages, or should I just build one from scratch? Thanks in advance!

/r/django
https://redd.it/1fudqnv
Yami - A music player made with Tkinter

This is my high school project and wanted to share it
**Github Link:** [https://github.com/DevER-M/yami](https://github.com/DevER-M/yami)
**Image:** [**https://imgur.com/a/rfL41xg**](https://imgur.com/a/rfL41xg)

**Some of the features:**

* ***mp3 , flac, and many audio formats supported for playback***
* ***Clean UI***
* ***Can download music with art cover***
* ***it is also asynchronous***

**Libraries used:**

* customtkinter
* spotdl
* mutagen

**Target audience:** This project will be useful for people who do not want ads and want a simple user interface to play music

**Comparison: There are currently no projects that have all the features covered and is made with tkinter**

To use this install all requirements in the .txt file and you are good to go

**RoadMap:I will not be actively developing it but i will update it now and then**

A follow would be nice! [https://github.com/DevER-M](https://github.com/DevER-M)

/r/Python
https://redd.it/1fu9kox
Having trouble deploying with Vercel, would appreciate any help

https://github.com/MHussein311/text-behind-image

Above is the repo, below is the error.

Error: A Serverless Function has exceeded the unzipped maximum size of 250 MB. : https://vercel.link/serverless-function-size

I was suspecting it had something to do with rembg and onxruntimegpu but I don't think they're gonna be anywhere near 250 MB.

/r/flask
https://redd.it/1fugw3w
Looking for back end devs (specifically python flask devs) to help a team of programmers and designers build a dating app marketed towards Ethically non-monogamous people. This is Revshare.



Currently we have a base app with some swiping functionaility. We have a lot of features in mind that cater to the ENM community, such as group chats and a calendar where you can schedule dates. We also have other features that we feel are good to put in a dating up.

Currently our active team members are mostly from asia so it would be great to have someone from asia as well(though this isnt a hard requirement, just a preference.)

/r/flask
https://redd.it/1fuetqa
[P] Just-in-Time Implementation: A Python Library That Implements Your Code at Runtime

Hey r/MachineLearning !

You know how we have Just-in-Time Compilation? Well, I thought, "Why stop there?" So I created Just-in-Time Implementation - a Python library that writes your code for you using AI. Yes, really!

Here's a taste of what it can do:

from jit_implementation import implement

@implement
class Snake:
"""Snake game in pygame. Initializing launches the game."""

if __name__ == "__main__":
Snake()

# Believe it or not, this actually works!

I started this as a joke, but then I got carried away and made it actually work. Now I'm not sure if I should be proud or terrified.

# How it works:

1. You write a function or class signature and a docstring.
2. You slap the `@implement` decorator on it.
3. The implementation is generated on-demand when you call the function or instantiate the class. Lazy coding at its finest!

# Some "features" I'm particularly amused by:

* It's the ultimate lazy programming tool. The code doesn't even exist until you run it!
* You can define

/r/MachineLearning
https://redd.it/1fujbuz