Python Daily
2.57K subscribers
1.48K photos
53 videos
2 files
38.9K links
Daily Python News
Question, Tips and Tricks, Best Practices on Python Programming Language
Find more reddit channels over at @r_channels
Download Telegram
Tiny Python library that turns functions into GUI apps


Hey! I made a small tool that lets you create GUI applications just by writing normal Python functions. It's inspired by FastAPI-Typer, but for desktop-mobile GUIs.

# Basic example:

from functogui import App, intUi, boolReturn

def iseven(number: int = intUi(4)) -> boolReturn:
    return number % 2 == 0

App(is
even)

That's it - it creates a complete GUI with a slider and shows the result in real-time. Useful for quick tools and prototypes when you don't want to mess with UI code.

Built with Kivy, supports file handling, image preview, and different input types. Would love to hear your thoughts or suggestions!

Github Repo

/r/Python
https://redd.it/1hve7v7
Developing locally after deployment? (Oauth issues)

I built my flask app and just deployed it on python anywhere. I updated my oauth credentials to point to the real site rather than localhost.

My login functionality no longer works locally (I'm only supporting Google login, no passwords/email).

How do others get around this? Perhaps have something set in the code so if app is running in debug mode the user skips login?

/r/flask
https://redd.it/1hvppmk
Open sourcing our python browser SDK that allows you use LLMs to automate tasks on any website

# Use Dendrite to build AI agents / workflows that can:

* 👆🏼 Interact with elements
* 💿 Extract structured data
* 🔓 Authenticate on websites
* ↕️ Download/upload files
* 🚫 Browse without getting blocked

Check it out here: [https://github.com/dendrite-systems/dendrite-python-sdk](https://github.com/dendrite-systems/dendrite-python-sdk)

/r/Python
https://redd.it/1hvs9hw
Built a Drag-and-Drop GUI Builder for CustomTkinter – Check It Out and Share Your Thoughts!

Hey Python devs!

I recently built a drag-and-drop GUI tool for customTkinter to simplify designing interfaces. It lets you visually create UIs and export the code directly, which has been super helpful for my projects.

I’d love to hear your thoughts and feedback on it! You can check it out on GitHub https://github.com/Proxlight/Buildfy-Free.git

I’m particularly interested in:
• Usability: Is the drag-and-drop interface intuitive?
• Features: What could make it even better?

Feel free to give it a try and let me know what you think. Any feedback would be amazing!

Thanks!

/r/Python
https://redd.it/1hvnyxn
D Self-Promotion Thread

Please post your personal projects, startups, product placements, collaboration needs, blogs etc.

Please mention the payment and pricing requirements for products and services.

Please do not post link shorteners, link aggregator websites , or auto-subscribe links.

--

Any abuse of trust will lead to bans.

Encourage others who create new posts for questions to post here instead!

Thread will stay alive until next one so keep posting after the date in the title.

--

Meta: This is an experiment. If the community doesnt like this, we will cancel it. This is to encourage those in the community to promote their work by not spamming the main threads.

/r/MachineLearning
https://redd.it/1htw7hw
Asking about easy FRONTEND tools.

I have learnd django with REST Framework
Is it necessary to learn JS to build the front end or there is another easy tools.

I know thats important to learn JS, but I want a quick way to view my projects like other sites.


/r/djangolearning
https://redd.it/1hvq5tu
Vision, PDF reading and Python

Script to modify PDF file to make it read as you are looking at something at the distance.

https://github.com/ilevd/pdf-binocular

What My Project Does

Duplicate contents on every PDF page for binocular vision.

Target Audience

People that have eyes tension when reading books and want to try something to reduce tension.

Comparison

Probably it's similar to stereo/3d pictures.

/r/Python
https://redd.it/1hvy2ty
Where to host Flask App

Hi everyone! I just developed my first flask app, and needed some assistance in getting it deployed as I've never done it before. My app uses multiple databases (SQLite currently) to keep track of events and participation for an organization I am in. I originally was going to use render since it was free but since it seems like it refreshes it won't be a good fit since it will wipe my dbs. I then looked at creating a PostgreSQL database on render but their free tier only lasts a month. If there is a way to host this for free I'd love to do that since the org is only about \~100 people and the website wouldn't be in use constantly and the likelihood of concurrent writes is very low. I was wondering if anyone knew a place where I could host this web app (hopefully for free), or for low cost if I can use SQLite as I'd rather not update everything atp. If anyone has any advice or helpful resources I'd greatly appreciate it!

/r/flask
https://redd.it/1hvz0ov
Different values in group by columns before and after group by in pandas dataframe

I had following code:

sum_columns = ['p', 'q', 'r', 'Ax', 'Ay', 'Az']
avg_columns = ['Bx', 'By', 'Bz', 'G2 C03']
agg_map = {col: 'sum' for col in sum_columns}
agg_map.update({col: 'mean' for col in avg_columns})

df = df.groupby(['MAC C01', 'MAC C02', 'MAC C03'], as_index=False).agg(agg_map)

Dataframe before group by:

```
p q r Ax Ay Az Bx By Bz G2 C03 MAC C01 MAC C02 MAC C03
0 0.0 0.0 0.1 0 0 0 0 0 0 0.0 0.00000 0.00000 0.0
1 0.0 0.1 0.1 0 0 0 0 0 0 0.0 0.00000 0.00000 0.0
2

/r/Python
https://redd.it/1hw24sf
Logic in Views vs Logic on Models

Hey folks,

Apparently this is a frequently discussed topic.

Im doing a project using DRF. In this context i feel like the Views that are basically APIs should have logic, but my approach so far was that whatever touches a model, goes in the model.

Concrete example: one of my APIs has to change the Status of a Sales order. Then i will create a method in the SalesOrder model that will do the status change, along with any particular validation that it might want to do (example if you're changing it to completed/closed, ensure theres no open amount and the items were delivered)

Can you give me your thoughts about this approach and if its worth moving everything to either the views or to another "business logic" layer (or both)?

I dont really have crazy calculations or bigass logic for anything in particular, but i rather learn the proper way


Looking online i see all kinds of recommendations, the logic layer as well as the Thick Models, as well as "Model is simply the ORM". So i feel like it doesnt really matter as long as its consistent and is useful for the individual project?

/r/django
https://redd.it/1hw5066
Full-Stack Software Job at RegTech Startup

🚀 We’re Hiring: Full-Stack Software Developer 🚀

RegMetrics is a regulatory compliance software for medical devices. Our mission is to simplify the regulatory journey, saving MedTech innovators and academics time and money while helping bring life-changing medical devices to market.

We’re looking for an experienced Python/Django developer with strong frontend skills to help us in our journey. If you know Wagtail, that's even better.

The job is fully remote but right now we can only hire from Brazil or UK.

If you're interested, please apply through our website

/r/django
https://redd.it/1hw2o2c
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/1hw61sj
Open-Source & Free Django App Generator - Select Design, Edit DB Tables, Extended User Fields, Add Celery, Social Login (GitHub), Docker

Hello guys!

[App-Generator.dev](https://App-Generator.dev) service released a simple Django App Generator that might help to customize, generate, and download the code as a ZIP archive or from GitHub.



[https://app-generator.dev/tools/django-generator/](https://app-generator.dev/tools/django-generator/)



The users can customize:

* UI: AdminLTE, Soft Dashboard .. etc (10 designs)
* DB Driver: SQLite (default), PgSQ, MySql/MariaDB
* DB Tables - table relations supported
* Extended User Model
* (optional) Social Login: GitHub
* (optional) Celery - async tasks
* (optional) Dynamic API - each model can be managed via a secured DRF endpoint
* (optional) Docker
* (optional) Ci/CD scrips for Render

The generator code uses a combination of template code generation and Astor Library for AST manipulation - source code saved on GitHub as celery task



[https://github.com/app-generator/app-generator/blob/main/apps/tasks/tasks.py](https://github.com/app-generator/app-generator/blob/main/apps/tasks/tasks.py)



Currently, the tool generates around 20 apps/day and the code is automatically saved on GitHub:



[https://github.com/app-generator?tab=repositories](https://github.com/app-generator?tab=repositories)



In the long run, the plan is to integrate more OAuth providers, DataTables, and a visual page builder.

Thanks for feedback & suggestions.

/r/django
https://redd.it/1hwdqy3
D ML Engineers, what's the most annoying part of your job?

i just know a phd just inspecting datasets and that sounds super sad

/r/MachineLearning
https://redd.it/1hwbhuj
Need help hosting flask app

Hi,

I’m sure I’ll get hell for this as I often do, I’m an educator for a niche field and built a flask app with the help of ai, basically a flashcard tool to help me at my practice. App works great, no errors on the user side, now I want to host it so I can access it. Truth be told, I also want to share with others in my field.

I’m so frustrated with hosting, it’s true that ai led me down a road where I got lost, but it’s also true that I have a tool I couldn’t find anywhere else, a tool I’ve dreamed about since being in the field.

Any simple ways to get around this? Not opposed to fiverr, but I didn’t have great experience with them before. For the record I’ve tried PythonAnywhere, Heroku, and AWS and keep getting errors I cannot make sense of. I would LOVE to learn hosting so I could truly do it on my own, but tutorials go from “the back end talks to the front end” to “you need to configure the WSGI, route here route there” very quickly.

/r/flask
https://redd.it/1hwamy0
Flowkeeper -- a PySide6 (Python + Qt6) application

Greetings! Meet [Flowkeeper](https://flowkeeper.org/), a cross-platform desktop Pomodoro timer, which took me about a year to reach its current state. It is implemented in Python and relies on Qt6 for its UI. It supports recent macOS, Windows 10 and 11, and any mainstream Linux released within a couple of years, e.g. Ubuntu 22.04.

Feel free to reuse parts of it, or ask me any questions about how things are implemented.

# What My Project Does

It allows you plan your work for the day, and then execute it using Pomodoro Technique.

# Target Audience

Power users -- mainly creative professionals and students. Flowkeeper can be used in production and enterprise environments.

# Comparison

Compared to a typical Pomodoro timer, Flowkeeper:

* Implements Pomodoro Technique exactly as described in the [original book](https://www.google.com/url?sa=t&source=web&rct=j&opi=89978449&url=https://www.amherst.edu/system/files/media/Pomodoro%252520Guide_0.pdf&ved=2ahUKEwjNsqig_eWKAxW7U6QEHZQMA-8QFnoECAsQAQ&usg=AOvVaw20GKwRpyxshlCpBzcw7-40),
* Supports a wider range of desktop operating systems, including diverse Linux environments,
* Is more lightweight and performant (it's not based on Electron, and I routinely test it on a Core 2 Duo machine),
* Has portable versions and does not require admin rights to install,
* Is optimized for power users (keyboard shortcuts and rich set of settings),
* Does NOT have a paid version,
* Does NOT have a mobile version,
* Does NOT synchronize data across devices,
* Is NOT

/r/Python
https://redd.it/1hwhvns
Combining ThreadPoolExecutor and threading.Thread in the same python application

Is it okay to use both the threading.Thread and ThreadPoolExecutor class for managing tasks in application using threads. For example some part in the application using threading.Thread and other parts of the application using ThreadPoolExecutor. I think the latter will have its own thread pool and the former would create ad-hoc threads without using the thread pool.

/r/Python
https://redd.it/1hwk104
Help! Is there no LSP and auto completions in Python & Django?

I have a code base running on Python 3.10.
I have tried pylsp, pyright & ruff but the moment I try and use something Django, The auto completions doesn't exist.

Users.objects() ? No completions or LSP documentations. Is this normal for python?

I have tried Golang, NodeJS and even C. It gives me atleast something to work with. Even to know type of a variable, I need to print with type().

Just want to know if there's something that I can do to make things easier.

/r/django
https://redd.it/1hwlwrt