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
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 noscripts, 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
D Has anyone managed to train an LLM with model parallelism?

Hello,

I am working on fine-tuning Llama-3.1 for my master’s thesis research. Unfortunately, my current situation forbids access to high-memory GPUs such as A100s. Instead, I have access to setups with multiple lower-memory GPUs, such as 4×3090 or 8×V100.

Therefore I need to implement model parallelism to train my model as it doesn’t fit into a single GPU. However, I’ve noticed that most frameworks primarily focus on data parallelism, which doesn’t address my needs.

Has anyone successfully trained a model by splitting it across multiple GPUs? If so, could you recommend frameworks or approaches I should explore? I am specifically looking for full training, although I am interested in hearing if someone managed this using LoRA.

Also, if there’s a more suitable subreddit for this type of question, please direct me to there.

Thank you!

/r/MachineLearning
https://redd.it/1habr8l
Best way to serve media files via flask?

Hello,

Working on a flask project currently which will serve a lot of media files. Photos aren't really an issue just videos, im not streaming them since the hadware isn't great enough to do so.

What would be the best way to serve them with low hardware? Use object storage? Or even use flask?

/r/flask
https://redd.it/1hae62n
Flask socketio production server

I have a flask application that is only accessed by me. It is hosted on a google cloud linux VM and I have a firewall set up to only allow my IP.

I've been using socketio.run(app) for now, but get the warning that this is a development server. I tried following tutorials for gunicorn and nginx but encountered problems with socketio and selenium chromedriver (there is so scraping that periodically runs in my app).

Since I don't have problems using the development server and I'm the only person accessing the web app, is there any problem with me leaving my app running like this? I've spent a whole day trying to get a production server up following various tutorials but always seem to have problems.

/r/flask
https://redd.it/1hacdg2
Tuesday Daily Thread: Advanced questions

# Weekly Wednesday Thread: Advanced Questions 🐍

Dive deep into Python with our Advanced Questions thread! This space is reserved for questions about more advanced Python topics, frameworks, and best practices.

## How it Works:

1. **Ask Away**: Post your advanced Python questions here.
2. **Expert Insights**: Get answers from experienced developers.
3. **Resource Pool**: Share or discover tutorials, articles, and tips.

## Guidelines:

* This thread is for **advanced questions only**. Beginner questions are welcome in our [Daily Beginner Thread](#daily-beginner-thread-link) every Thursday.
* Questions that are not advanced may be removed and redirected to the appropriate thread.

## Recommended Resources:

* If you don't receive a response, consider exploring r/LearnPython or join the [Python Discord Server](https://discord.gg/python) for quicker assistance.

## Example Questions:

1. **How can you implement a custom memory allocator in Python?**
2. **What are the best practices for optimizing Cython code for heavy numerical computations?**
3. **How do you set up a multi-threaded architecture using Python's Global Interpreter Lock (GIL)?**
4. **Can you explain the intricacies of metaclasses and how they influence object-oriented design in Python?**
5. **How would you go about implementing a distributed task queue using Celery and RabbitMQ?**
6. **What are some advanced use-cases for Python's decorators?**
7. **How can you achieve real-time data streaming in Python with WebSockets?**
8. **What are the

/r/Python
https://redd.it/1haod3g
How do we send email using django-allauth now when Less Secure Apps are disabled?

Is there any way to use Oauth2.0 with django-allauth to keep sending verification emails now? I cant find anything on how to do this ( too dumb to figure it out )

/r/django
https://redd.it/1haju0a
DNS server written in Python

Hi All

I am researching the DNS protocol in depth (security research) and have written a DNS server in Python that relies on responses from a upstream service (Quad9,for now). Hope you all like it. Do recommend improvements.

Link: https://xer0x.in/dns-server-in-python/

PS: I am aware of the Blocklist parsing inconsistency bug.

/r/Python
https://redd.it/1hagkql
Suggestions

I have been working with Django framework for like 1.5 years or more. Built couple of projects.However at this point i m confused, if i am eligible for the entry level job.What kind of code will we be writing in the actual workplace and what essential topics are required to master in backend frameworks like django or flask or restapi

/r/django
https://redd.it/1harpqr
Looking to Transition from Web Development to Python – Seeking Tips and Insights

I’ve been working as a JS web developer for over 8 years now, but I’ve found myself losing interest in it. I’m really looking to make a switch to something new, and I’ve been getting advice to get into Python and move into that field. However, I’m not entirely sure what the career opportunities in Python are like, or how I can best break into it.

Has anyone else made a similar transition? I’d love to hear about your experiences and any advice you have on how to make this switch successfully. Specifically, I’m curious about:

The job market for Python developers
The skills and projects I should focus on to get noticed. How much time would it take.
Any roadmaps or resources you’d recommend.

Thank you in advance!

/r/Python
https://redd.it/1hagupi
3rd year university student with solid skills developing in Django, looking to work on projects or under someone. I can send link to my resume and some projects I've worked if interested.

On winter break from university and looking for some things to do, hoping to learn and expand my skills. Been applying to internships, but no luck so far. Reach out if interested.

/r/django
https://redd.it/1hanfcf
I build PdfDing with Python

Hi r/Python,

over the last six months I have build PdfDing. You can find it on GitHub.

What My Project Does

PdfDing is a selfhosted PDF manager and viewer offering a seamless user experience on multiple devices. 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

 I have used the following tech stack:

the web app is build using Python (Django)
The frondend is build using Alpine.js, htmx, jQuery and Tailwind CSS
Mozilla's PDF.js is used for viewing PDF files in the browser

Target Audience

Homelabs or businesses who want a self-hosted solution for their PDFs.

Comparison

There are solutions like self-hosted ebook readers. However, they are using the inbuilt PDF viewer of the browser. This works fine on desktops and laptops but on smartphones it will simply download the PDF file and not display it in the browser (at least it is like this on my mobile devices). This solution also does not allow you to continue reading where you stopped on another

/r/Python
https://redd.it/1haxeb7
Django-tenant: Accessing tenant data in public domain

I was working on Django-tenant where I have tenant model called Appointment now I want to get the appointment of a specific tenant from the public domain but I'm having an issue when rendering it in the template

class OrganizationAppointmentList(LoginRequiredMixin, TenantMixin, ListView):
templatename = 'main/appointments/listappointment.html'
paginateby = 10

def get
queryset(self):
tenantid = self.kwargs.get('pk')
try:
tenant = Organization.objects.get(id=tenant
id)
self.schemaname = tenant.schemaname
with schemacontext(self.schemaname):
queryset = Appointment.objects.all()
return queryset


/r/django
https://redd.it/1hazu2h
Difference between get and filter? Cant understand even after reading several posts.

I am trying to write a function which requires to get some values from the database.

following is the model.

class Questions(models.Model):
    category = models.CharField(maxlength=50)
    question = models.CharField(max
length=255)
    answer1 = models.CharField(maxlength=255)
    answer2 = models.CharField(max
length=255)
    answer3 = models.CharField(maxlength=255)
    answer4 = models.CharField(max
length=255)
    answerkey = models.CharField(maxlength=25)

so in shell when I use Questions.objects.get(id = 1) I get <Questions: Questions object (1)>

but when I use

Questions.objects.get(id = 1).values() i get an error.

AttributeError: 'Questions' object has no attribute 'values'

When I use Questions.objects.filter(id = 1).values()

I will get <QuerySet [{'id': 1, 'category': 'gk', 'question': 'What is the 10th letter of english alphabet?', 'answer1': 'K', 'answer2': 'j', 'answer3': 'l', 'answer4': 'i', 'answer_key': 'answer2'}]>

So what's the difference? All articls/post answers say that filter will filter results and will give all objects where id = 1 (in this case id is default primary key so its only one), while get will get you exact match. But then why cant values() does not work with get if it has found

/r/django
https://redd.it/1hb2rj2
Pype - Python Desktop App Framework

I created a python framework that easily enables users to create reactive desktop applications with Python backend and HTML frontend.

What My Project Does

Easily enables the user to create desktop applications with a Python backend and a HTML frontend. Using the frameworks functions listed in the documentation reactive variables, state-management and dynamic UI-s can be created with ease.

Feel free to use it if you see fit. Also im very much open to discussion as this is my first public project that i published, errors have a very high chance of appering.

PyPI pype-framework

Pype Github


edit: I used a post template so i can post here and forgot the delete the post templates text...

/r/Python
https://redd.it/1hb0jr4
Looking for a mid-ish level web project in django or flash more info below

I am working on transitioning some data projects to the web. I know an okay amount of HTML CSS and a bit of JS so I could do it that way. I would rather build a couple sites just using python using flash or django. I just can't seem to find a repo or tutorial thats not super basic or advanced. Anyone have one that falls in the middle area they would be willing to share?

/r/Python
https://redd.it/1hb8f7h
Where would you host a web app expecting only about ~100 visitors per month?

Where would you suggest a relatively new dev host a django app expecting about \~100 users per month, with a postgres database containing about 100-200 entries? I have experience with Heroku and pythonanywhere but Heroku is a bit too expensive for now($5 hosting + $9 postgres). I've also used DO spaces but never hosted there and don't want to deal with DevOps right now. I've also seen Namecheap suggestions but not a lot of reviews.

/r/django
https://redd.it/1hb8hn4
Inventory management Schema

I figured this would be more appropriate asked in a database design group, but since I'm using Django, I'd like to get a better understanding with Django.

How would you handle items with different sizes and quantity in an inventory. For example, a pack of cigarettes has 12 pieces, a crate of eggs has 30 eggs. I procured 3 crates of eggs and 2 packs of cigarettes, how do I track that? How about if I have a liquid that comes in 20 liters, 30 liters and 10 liters bottles. How do I track these items including those properties in an inventory.




/r/django
https://redd.it/1hba5yb
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/1hbg7qh
Question about storing audio files

I am creating a web application where you can put music files inside that are added to a list where you can start, delete and eventually download in the future all your files that you have put. Now, what I was thinking of doing was using a database that keeps the path where each user's files are (divided into folders and subfolders; example: songs/Amanda56/song.mp3). I was thinking of creating these in urls that are added dynamically over time (example: when a user registers with the nickname Giorgio192, a url called: https:/www.mysite.com/storage/songs/Giorgio192/ will be created. The songs url already exists, the one that will be added is Giorgio192 (his username therefore). When Giorgio192 adds a new song to his list, this song will be stored in songs/Giorgio192/song.mp3 while the url that is used to extract the songs from there will be saved in my database. Is this method strange? Would it slow down my site a lot over time? If so, how? Is there a way to do what I want?

/r/flask
https://redd.it/1hb6fp0
D From Unemployment to Lisp: Running GPT-2 on a Teen's Deep Learning Compiler

A couple months ago I found myself unemployed, uncertain about what to do next. I wanted to learn more about deep learning, but from a systems prespective. Coming from Andrew's Ng course on supervised learning, I was eager to learn more about how deep learning frameworks (or deep learning compilers) like Pytorch or Tinygrad.

I started to poke around Tinygrad, learning from the tutorials I found online, and I found it fascinating because it was an actual compiler, it took conventional python code and translated them into an Abstract Syntax Tree that was parsed into UOps and ScheduleItems, to finally have a codegen layer. While the design was interesting, the code was hard to read.

That's when I stumbled across something completly unexpected, A deep learning compiler built on Common Lisp, maintained by a Japanese 18-year-old during his gap year. And currently we have acomplished something great, it can run gpt2!

For now, it just generates C-kernels, but in the future we would like to support cuda codegen as well as many other features, and serve as a learning tool for anyone who would like to get to work on deep learning compilers in Common Lisp.

This is an open source project and anyone

/r/MachineLearning
https://redd.it/1hb7v5h
D Why are the Stella embedding models so much smaller than other models of similar quality?

On the MTEB Leaderboard, stella_en_v5 is currently ranked 3rd overall, while using one fifth the memory of all non-Stella models in the top 10.

stella_en_400M_v5 is ranked 10th, while using 15-20 times less memory than the models ranked near it. This appears to be relatively consistent across several subtasks of the benchmark (for English).

What is the secret sauce here? Alternatively, what is the catch? There is no paper yet. Anyone know details?

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