pythondaily | Образование

Telegram-канал pythondaily - Python Daily

1102

Daily Python News Question, Tips and Tricks, Best Practices on Python Programming Language Find more reddit channels over at @r_channels

Подписаться на канал

Python Daily

Udemy Fred's Python 3 course vs. GT Computing in Python course

I am an average Python programmer (I can do some OOP and simple scripts, but nothing really advanced) and wanted to improve my skills. I have narrowed down my Python resources to two courses, both in four parts:

1. Fred Baptiste Udemy course on Python 3 (in four parts)

2. Georgia Tech Computing in Python course (in four parts, too)

My employer should be able to reimburse both, so money is not an issue here - the question is which one would you suggest to choose to actually improve my Python skills and practice coding along the way? Meaning learning, but also implementing new concepts (so that they stick)? I assume the Georgia Tech is a nicer certificate to have (which is a plus for sure), but curious about actual content. Thanks so much!

/r/Python
https://redd.it/1ha7o5n

Читать полностью…

Python Daily

Introducing PyKick: A Python Project Generator for PowerShell

**Hello everyone,**

Even with the intention of sharing, it's always a bit stressful to expose personal work to the community =}

But well... Maybe someone has the same question or need as I did, so with that in mind, I'm sharing my modest work done during my free time in the evenings (when the whole family is asleep =D) As you can see, besides the templates, there isn't anything particularly special – PyKick does what it needs to do and voilà – unit tests were the most time-consuming, as always (the PowerShell module was quick to write).

# What My Project Does

PyKick is an installable PowerShell module (or can be sourced otherwise) that quickly generates a new Python project with Git management, a virtual environment, and Sphinx documentation (if requested). In my Python projects, I need CLI exposure. Therefore, the generated Python project is immediately functional (a `pip install .` results in a CLI providing package information and version - the structure is here, just to complete)

PyKick doesn't aim to replace anything. Not finding something that met my needs, I ended up writing it without realizing it =}

# Target Audience

I think it's quite clear =þ

* If you are a developer or need a

/r/Python
https://redd.it/1ha65l9

Читать полностью…

Python Daily

Convert Figma design into Python code

🔗 Link — https://github.com/axorax/tkforge

# What My Project Does

TkForge is a Python app that allows you to turn your Figma design into Python tkinter code. So, you can make a GUI design in Figma and use specific names like "textbox", "circle", "image" and more for interactable elements then use TkForge to get the code for a fully functional working GUI app from your design.

And it's free, open-source and regularly maintained!

# Target Audience

TkForge is made for anyone who wants to make a GUI with Python easily and efficiently. It's fast and you can make some really complex and beautiful GUI's with it.

# Comparison

There's another project similar to TkForge called Tkinter Designer. Personally without being biased, I think TkForge is better. TkForge supports everything Tkinter Designer does and more. TkForge generates better code, supports more elements, allows you to add placeholder text (which you can't by default in tkinter), automatically sets foreground color and a lot more! Placeholder text and foreground color generation is a bit buggy though. I use TkForge for most of my tkinter projects. You can get help in the Discord server.

# Updates

I updated the app to support multiple frames, fixed a lot of previous bugs and added checks

/r/Python
https://redd.it/1ha47wt

Читать полностью…

Python Daily

Python Quiz for Beginners and Experts

Curated a 40 questions quiz on Python coding. Test your knowledge with this quiz. Would love to know your score and feedback!!

I will keep updatig this quiz to make it more comprehensive.

Try this Python quiz here.

/r/Python
https://redd.it/1h9fg6x

Читать полностью…

Python Daily

Monday Daily Thread: Project ideas!

# Weekly Thread: Project Ideas 💡

Welcome to our weekly Project Ideas thread! Whether you're a newbie looking for a first project or an expert seeking a new challenge, this is the place for you.

## How it Works:

1. **Suggest a Project**: Comment your project idea—be it beginner-friendly or advanced.
2. **Build & Share**: If you complete a project, reply to the original comment, share your experience, and attach your source code.
3. **Explore**: Looking for ideas? Check out Al Sweigart's ["The Big Book of Small Python Projects"](https://www.amazon.com/Big-Book-Small-Python-Programming/dp/1718501242) for inspiration.

## Guidelines:

* Clearly state the difficulty level.
* Provide a brief description and, if possible, outline the tech stack.
* Feel free to link to tutorials or resources that might help.

# Example Submissions:

## Project Idea: Chatbot

**Difficulty**: Intermediate

**Tech Stack**: Python, NLP, Flask/FastAPI/Litestar

**Description**: Create a chatbot that can answer FAQs for a website.

**Resources**: [Building a Chatbot with Python](https://www.youtube.com/watch?v=a37BL0stIuM)

# Project Idea: Weather Dashboard

**Difficulty**: Beginner

**Tech Stack**: HTML, CSS, JavaScript, API

**Description**: Build a dashboard that displays real-time weather information using a weather API.

**Resources**: [Weather API Tutorial](https://www.youtube.com/watch?v=9P5MY_2i7K8)

## Project Idea: File Organizer

**Difficulty**: Beginner

**Tech Stack**: Python, File I/O

**Description**: Create a script that organizes files in a directory into sub-folders based on file type.

**Resources**: [Automate the Boring Stuff: Organizing Files](https://automatetheboringstuff.com/2e/chapter9/)

Let's help each other grow. Happy

/r/Python
https://redd.it/1h9wkuk

Читать полностью…

Python Daily

Deply 0.5.1 Released: New Collectors, 10x Performance Boost, and Stronger Architectural Rules

Hello everyone,

It's Archil again, checking in from Wrocław, Poland. I'm excited to announce the release of Deply 0.5.1, an updated version of my Python tool for enforcing architectural patterns and dependencies in larger codebases. I've noticed steady downloads since the previous post, and I'm genuinely grateful to everyone who has tried Deply or provided feedback.

# What My Project Does

For those new here here is my previous post, Deply analyzes your code structure and verifies that your Python project adheres to a defined architecture. You specify layers, set rules, and Deply enforces them—helping maintain clean, modular, and maintainable code as your project grows.

# Target Audience

Ideal for developers and teams building medium to large Python applications who need to maintain clear, enforceable architectural boundaries. It also suits those aiming to teach or learn best practices.

# Comparison to Other Tools

• pydeps:

Focus: Visualization of dependencies

Comparison: pydeps provides a visual map of imports, helping you understand how parts of your code relate. Deply goes further by actively enforcing rules on these dependencies, ensuring that your project structure adheres to architectural guidelines instead of merely displaying it.

• import-linter:

Focus: Import-based dependency constraints

Comparison: import-linter is excellent for managing import hierarchies and preventing forbidden dependencies. Deply builds on this

/r/Python
https://redd.it/1h9qjjj

Читать полностью…

Python Daily

How OAuth and normall user signup/login will work together

I know it's naive but I can't grasp the whole process of it.

I am creating a app (Django, React, Postgres) and I have normall Login/Signup via my own RESTful endpoints and I also want to give my users the option to signup with Fb/google etc.

For my own RESTful views I'm using Toke authentication but I am not sure how the OAuth Access token will work with that
Do I need to create a authentication token after successful authorization from Resource server ??

I hope It's not a bad question
Thanks

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

Читать полностью…

Python Daily

RedSage is a terminal-based pair programming assistant that integrates with LLMs. Opensource.

Need a junior developer that can program with you? I built one in Python.

What my project does?

After installing the program, you can start RedSage right from your terminal. It’s an AI-powered pair programming assistant that connects to LLMs like OpenAI and Claude to help you write code, explain concepts, and even review your changes in real-time.

Comparisons:

Unlike complex IDE plugins, RedSage is lightweight and works directly from the command line, giving you intelligent code suggestions, context-aware explanations, and seamless Git integration without the overhead. Think of it as having a junior developer by your side, but with no setup hassles and a super-fast workflow. Perfect for anyone looking for a simple, yet powerful coding companion.

LINK: https://github.com/chisasaw/redsage


Conclusion:

I'd like your feedback and project direction. It's entirely built in Python and available on Github. The link i above.



/r/Python
https://redd.it/1h9jd21

Читать полностью…

Python Daily

Stripe alternatives for subscription

Hi everyone! Recently I published my wife platform and we are using stripe.

The total cut by them is \~5% and I wonder if is there any alternative I am not aware that we can use which offers better rates.

Does anyone has an experience with other services?

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

Читать полностью…

Python Daily

I built PdfDing using Django

Hi,

over the past six months I have built PdfDing using Django. It is a selfhosted PDF manager and viewer offering a seamless user experience on multiple devices. You can it on GitHub. Some of its features include:

Remembers current position - continue where you stopped reading on any device
Share PDFs with an external audience via a link or a QR Code. Shared PDFs can be access controlled
Dark Mode, colored themes and custom theme colors
Inverted color mode for reading PDFs
SSO support via OIDC

PdfDing was my first real web app projects and my first using Django. The start was a bit rough, but afterwars it has been a blaze :). Feature development is fast and a lot of information is available online.

Other than Django the techstack includes:

the frondend is build using Alpine.js, htmx, jQuery and Tailwind CSS
authentication, registration, account management and OIDC is achieved by django-allauth
Mozilla's PDF.js is used for viewing PDF files in the browser

If you like PdfDing I would be really happy over a star. As the project is open source, if anyone is willing to contribute you are welcome!

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

Читать полностью…

Python Daily

Sunday Daily Thread: What's everyone working on this week?

# Weekly Thread: What's Everyone Working On This Week? 🛠️

Hello /r/Python! It's time to share what you've been working on! Whether it's a work-in-progress, a completed masterpiece, or just a rough idea, let us know what you're up to!

## How it Works:

1. Show & Tell: Share your current projects, completed works, or future ideas.
2. Discuss: Get feedback, find collaborators, or just chat about your project.
3. Inspire: Your project might inspire someone else, just as you might get inspired here.

## Guidelines:

Feel free to include as many details as you'd like. Code snippets, screenshots, and links are all welcome.
Whether it's your job, your hobby, or your passion project, all Python-related work is welcome here.

## Example Shares:

1. Machine Learning Model: Working on a ML model to predict stock prices. Just cracked a 90% accuracy rate!
2. Web Scraping: Built a script to scrape and analyze news articles. It's helped me understand media bias better.
3. Automation: Automated my home lighting with Python and Raspberry Pi. My life has never been easier!

Let's build and grow together! Share your journey and learn from others. Happy coding! 🌟

/r/Python
https://redd.it/1h95vc3

Читать полностью…

Python Daily

Python .gitignore

I'm sure a lot of you have done this:

1. Start new project
2. Need that generic Python .gitignore file on GitHub
3. Google "python gitignore" (though you probably typed "gitingore")
4. Click link and click raw
5. Copy all and paste in your local .gitignore

And I'm sure a lot of you probably just use curl and have it memorized or have it in your shell history or something (fzf ftw). But I can't be bothered to learn curl properly, and I got tired of the manual steps, so I just created a function in my .zshrc file:

function pgi {
curl -JL https://raw.githubusercontent.com/github/gitignore/refs/heads/main/Python.gitignore -o .gitignore
}

So now I can just run pgi whenever I start a new project, and boom, precious seconds of my life saved.

That's it, that's all I have, thanks for reading. I'm sure some of you have ever better solutions, but that's mine.

/r/Python
https://redd.it/1h8rc4g

Читать полностью…

Python Daily

Django-Q2 in Azure Web App

I'm trying to migrate an overgrown POC app from an ex-colleague's desktop to the cloud. It's urgent, so I had to just figure out a plan of action quickly and run with it.

The app is a Django application with management dashboard, along with a whole range of tasks that need to be run at specific times throughout the day.

My colleague used to just run the server on his machine and have some Cron jobs configured for the tasks.

I've turned the Cron jobs into Django-Q2 schedules, which seem to run fine locally.

I've made 2 Azure Web Apps, one that starts up the Django application and hosts the dashboard with the "runserver" command in the startup script,which runs fine.

The other should be responsible for running the jobs, so it sets up the schedules in the startup script and then runs the "qcluster" command.

This last app keeps restarting, with message "Site startup probe failed after X seconds" and the jobs are not being executed (correctly). I assume this is because this app does not host a web server that can be probed by Azure, but I'm not sure.

2 questions:
* How can I quickly work fix / work around this issue so the app

/r/djangolearning
https://redd.it/1h7z3dc

Читать полностью…

Python Daily

Async django, who is using it and why?

I am curious to know the use cases for async django, and whether there was a performance improvement in doing it.

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

Читать полностью…

Python Daily

Location of npm in my windows 11

I have been installing django-tailwind and when I was done. I somehow could run the

python `manage.py` tailwind install command because of the error below

CommandError:

It looks like node.js and/or npm is not installed or cannot be found.



Visit `https://nodejs.org` to download and install node.js for your system.



If you have npm installed and still getting this error message, set NPM_BIN_PATH variable in `settings.py` to match path of NPM executable in your system.



Example:

NPM_BIN_PATH = "/usr/local/bin/npm"


I am not sure how to solve this because I cannot find an npm.exe file anywhere

/r/djangolearning
https://redd.it/1h8p54m

Читать полностью…

Python Daily

Create a complete WORD SEARCH BOOK with a single click.

# [BOOP (Book Of Organized Puzzles)](https://github.com/Muneer320/BOOP)

# Description

BOOP is a Python-based automation project that generates a fully personalized puzzle book. With just a list of words as input, it creates a complete PDF with title pages, index pages, word search puzzles, and solutions.

Why did I make this? Honestly:

1. I was bored and needed something fun to work on.
2. I already had a script that could make word search puzzles, so I thought, "Why not take it up a notch?"
3. I’ve always wanted to write a book but lack the intellectual supremacy to do so. This project seemed like the next best thing!

# Links

* [Sample PDF Output](https://drive.google.com/file/d/1KkbCUuIuO8hmeHavUyO8e90r4qIQCxPc)
* [GitHub Repository](https://github.com/Muneer320/BOOP)

# What My Project Does

* **Word Search Puzzles**: Generates 17 puzzles per topic, categorized into Normal, Hard, and Bonus modes.
* Normal: 10 puzzles (13x13 grid).
* Hard: 5 puzzles (17x17 grid).
* Bonus: 2 challenging puzzles.
* **Fully Designed Book**: Includes title pages, a detailed index, puzzle pages, and solution pages.
* **Automation**: Users only need to input a list of 200 words per topic; the script handles everything else.

# Target Audience

* Puzzle enthusiasts looking for custom-made puzzle books.
* Educators creating engaging learning materials.
* Developers interested in Python-based automation

/r/Python
https://redd.it/1ha82ex

Читать полностью…

Python Daily

Question about best practices with ForeignKeys

I'm relatively new to django and i'm working on a project where I'm currently designing the model relationships, and I'm curious about the best practices for handling multiple foreign key references to the same model.

Here's my specific scenario:

I have an Assignment model
I want to track which users are assigned to this assignment (using a many-to-many field)
I'm also creating individual Job models for each assignee
Each Job will have a foreign key to a specific user

My questions for the community:

1. Is it considered an anti-pattern to have both a many-to-many relationship at the Assignment level and individual foreign key references in the Job model?
2. What are the performance implications of this approach?
3. Are there better ways to model this kind of workflow?

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

Читать полностью…

Python Daily

How can I host my dynamic Django website, which includes an ML implementation like a BERT model, for completely free?

Hey, I want to host my dynamic Django website, which includes ML implementations like a BERT model, an NSFW detector, and CNN, for free because I don’t have any money. I’m just a student, or you could say someone learning ML and DL from the internet. I’m not someone who’s completely mastered coding yet, so I haven’t landed a job—I’m still learning the code and math behind it all. I also come from a non-tech background.

With what I’ve learned so far, I want to expand my knowledge by implementing it in a website. However, I can’t afford to pay for hosting. I know some platforms, like AWS Free Tier, offer free services for 12 months, but what happens after that? From where would I pay? Also, I’m not expecting the website to become popular overnight—it might take more than a year to gain traction.

Can anyone suggest completely free hosting solutions for projects like this? Any advice or guidance would mean a lot!

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

Читать полностью…

Python Daily

Sharing Smoke Simulation Project I have Been Working On

Hello all, I have been working on this project for quite some time and found it to be very useful for my task as a software engineer trying to build Computer Vision applications. My daily job involves working with smokey images and finding models but getting smokey images on demand was not possible and hence I came up with an idea to make a simulator. I modified the existing solution from bijection/smoke.js and implemented it with Python.

Links:

GitHub Repo: [https://github.com/q-viper/SmokeSim/](https://github.com/q-viper/SmokeSim/)
Demo: https://q-viper.github.io/SmokeSim/ (This demo is from only the JavaScript Version.)

## What My Project Does

It simulates a reproducible smoke image using PyGame. The property of the smoke and its particles can be controlled by the properties like size, velocity, lifetime, color, etc. In addition to that, this package can act as an image augmentation and can return the overlayed smoke mask, overlayed image, and smoke too.

## Target Audience

The main target audience would be anyone who is working on Computer Vision projects or image augmentation and looking for a cool way to increase training images. However, anyone who is interested in building something fun with Python and collaboration might find it interesting.

## Comparison

There are packages like Torchvision and Albumentations and this feature

/r/Python
https://redd.it/1h9t8r7

Читать полностью…

Python Daily

Python Django Backend Developer | Software Engineering Student

Hi guys, I am looking for a job/internship as a Django backend developer. Tbh I think I am very highly qualified as a fresher. I am also learning React js. So, do you have any opportunities in mind for me?

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

Читать полностью…

Python Daily

I added Bootstrap templates to Neapolitan - Quick CRUD views for Django

I just contributed example templates to Neapolitan (Carlton Gibson's CRUD views library). Create full CRUD interfaces with 4 lines of code!

I Made it work with Bootstrap + Crispy Forms - would love your feedback!

https://github.com/carltongibson/neapolitan/pull/72

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

Читать полностью…

Python Daily

ARM Native Python execution time higher than x64 Python?

I am running below python code X Elite Surface Laptop 7. With python x64 and arm64 (3.11.8)
I get below execution speeds:

x64: 28.32 seconds
arm64: 33.34 seconds

I have run it multiple times, I get similar values. I was expecting native python to run much faster than emulated python.
What am I missing? Also please point to different sub if needed.

import time
import math

def calculatepi(iterations):
pi = 0
for i in range(iterations):
pi += 4 * (-1)**i / (2 * i + 1)
return pi

if name == "main":
iterations = 100000000
start
time = time.time()
pivalue = calculatepi(iterations)
endtime = time.time()
elapsed
time = endtime - starttime
print(f"Pi value: {pivalue}")
print(f"Elapsed time: {elapsed
time:.2f} seconds")

I am running below python code on X Elite Surface Laptop 7.
With python x64 and arm64 (3.11.8), I get below execution speeds:

x64: 28.32 seconds
arm64: 33.34 seconds

I have

/r/Python
https://redd.it/1h9o1ed

Читать полностью…

Python Daily

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/1h99kae

Читать полностью…

Python Daily

Getting error at the highlighted line. From what i was able to understand, it is something related to HTTP request methods, but everything seems fine to me.

https://preview.redd.it/gibvowhl2l5e1.png?width=923&format=png&auto=webp&s=f053b050cde1b3f5026c16d851f468f1bf7b2837

https://preview.redd.it/xtoj3wam2l5e1.png?width=932&format=png&auto=webp&s=731f1be789aff3c1c9cc0eda2233ea76f0534875

https://preview.redd.it/3sr1xi0n2l5e1.png?width=1920&format=png&auto=webp&s=c9194c52fafae79deb2e2405a6a0afecdcdc0264



/r/flask
https://redd.it/1h9e8ru

Читать полностью…

Python Daily

Dubt about what the user have to see on page source code.

Is it a problem if i see this on my page source code from browser?

<input id="csrftoken" name="csrftoken" type="hidden" value="ImY3N2E3MzMxNzBkMGY0MGNkYzRiYzIyZGZkODg2ZmFiNDA1YjQ1OWMi.Z1S5sg.5OTK7El82tJoEyCSGVGdahZyouc">

/r/flask
https://redd.it/1h92fch

Читать полностью…

Python Daily

For those that pay under $50 total in infra costs, what is your app doing?

I’ve seen a lot of people post about how they pay less than $50 in total costs so I’ve had a few questions for you.

What is the purpose of your app?
How much traffic does it see?
What kind of functionality does it support?
What are you using for your DB?
How’s the performance?
What’s the server config?

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

Читать полностью…

Python Daily

Astral (uv/ruff) will be taking stewardship of python-build-standalone

An interesting blog post explaining how python-build-standalone is used:

> "On 2024-12-17, astral will be taking stewardship of python-build-standalone ..."

- https://astral.sh/blog/python-build-standalone

/r/Python
https://redd.it/1h8qoxl

Читать полностью…

Python Daily

Anyone Using Temporal?

I recently learned about temporal.io through a tech talk. Does anyone in the Django community use this as an alternative to something like Celery? It sounds too good to be true.

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

Читать полностью…

Python Daily

Flet vs Streamlit PWA and conceptual questions

I'm new to flet, but I'm experienced Flutter developer plus I'm a Generative AI Engineer and worked with streamlit or Gradio. I have some conceptual questions.
Q1. If flet uses Flutter, then why does the flet Flutter plugin require a URL? Why cannot the flet UI "live" all together in Flutter?
Q2. Since there's a URL needed anyway, what's the advantage of using it vs for example having a Streamlit UI displayed in a PWA?
Q3. Let's say I develop a personal assistant in flet. Can the assistant access my location, heart rate, my camera (for multi-modal Gen AI), microphone and speakers (for voice assistant functionalities)?

/r/Python
https://redd.it/1h8nzyy

Читать полностью…

Python Daily

Creating a multiplayer quiz game. Cant figure out how to create a lobby.

I'm trying to make backend for an online multiplayer quiz game. front end will be done according to the finished backend by someone else. premise is simple, users log in. they initiate the game, the game will show them both questions and a timer (calculated at front end), at the end someone will win and game will end. Game logic is simple, user creation and log in process is also simple. but I am having hard time on starting on how the matchmaking/lobby and match start process will work. any insights?

/r/djangolearning
https://redd.it/1h81rf2

Читать полностью…
Подписаться на канал