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
SSHaMan: A TUI for Managing SSH connections using Python & Textual

Good evening everyone. I just wrapped up my first open source project. It's functional at the moment, but definitely still alpha. It's a tool that you can use to manage SSH connections from inside the terminal.

I'm a pretty avid self-hoster with... a lot... of self-hosted services and keeping track of all my VMs is kind of painful with a .bashrc file. So I thought I'd feed two birds with one scone here and make an application to help that and also learn the Textual framework. This application presently doesn't do much that their demos don't do (I was able to repurpose their FileTree and just extend a few buttons), but I plan on digging in and learning Textual in subsequent versions to make this even more useful.

I would welcome any feedback! If anyone would like to contribute, I am absolutely open to PRs as well!

EDIT: D'oh! Forgot the link!

https://github.com/cornyhorse/sshaman

/r/Python
https://redd.it/18a9w1m
Visual Explanation of Python Panda Library

Coveres all the basic concepts of panda library like import/export create modify dataframe, add/edit/update/delete rows/coloumns, select through columns names, index, loc, iloc, iat, query and other advance methods, group by, multi-level index, and much more.

https://solothought.com/tutorial/python-pandas-visual/

\#pandas #quickreference

https://preview.redd.it/83x7u8rty74c1.jpg?width=2693&format=pjpg&auto=webp&s=4d5090f0703fded41dae3b2e41af6aab173971c6

/r/Python
https://redd.it/18adyz9
map-nl: Quickly create PC4 maps of the Netherlands

I just released a new small hobby project: map-nl

[Github](https://github.com/fpgmaas/map-nl)

It is a Python package that helps users quickly create maps of the Netherlands at the Postal Code 4 level. Nothing groundbreaking, but fun to develop and hopefully useful to some nonetheless. For example, creating a choropleth map of the Netherlands becomes as simple as:

import pandas as pd
from map_nl import ChoroplethMapNL

df = pd.read_csv("https://raw.githubusercontent.com/fpgmaas/map-nl/main/data/woz-pc4.csv")

m = ChoroplethMapNL(geojson_simplify_tolerance=0.0001).plot(
df,
pc4_column_name="pc4",
value_column_name="WOZ",
legend_name="Average WOZ Value"
)
m.save("map.html")

Curious for your thoughts, please let me know if you have any feedback!

/r/Python
https://redd.it/18afn9r
Flashcard app

Hey all. I built a flashcard app but am having issues with it loading in my browser. It works on phone so I’d like to see if it will load in your browser. Please take a peek.

www.flashcardzz.com

/r/djangolearning
https://redd.it/18a1yy4
What's new in Django 5.0 video

Made an overview of Django 5.0 key features and community updates: https://youtu.be/lPl5Q5gv9G8?feature=shared

This is my first video and I want to deliver value to the community, so please tell me what you liked and what I can do differently next time.

I feel truly honored to be part of the Django community. Hoping I will be warmly welcomed while I fumble my way through video content 💚

/r/django
https://redd.it/18aj6ep
Where do you get your images from?

I am building this flask web app and want to put in some images, but I don't know where from. To be specific: do I just put the URL of an image from online, do I download them and just use the local path or do I just do something else like make a public git-repo and use that URL. Any help is appreciated!

/r/flask
https://redd.it/18a0fo9
Why is ´print´ not recommended in linters?

I am writing a mini-program for basic payment calculation, and after the calculation the results are printed in the terminal. However, I get the following warnings from Ruff (the Python linter that I use):

src/pfexample/foodpayment.py:39:5: T201 print found
src/pfexample/foodpayment.py:51:5: T201 print found
src/pfexample/foodpayment.py:52:5: T201 print found
src/pfexample/foodpayment.py:54:5: T201 print found
src/pfexample/foodpayment.py:56:9: T201 print found

I know that I can turn off this check in the settings, BUT I don't why print is bad in the code. What would be the alternatives if not using print?

/r/Python
https://redd.it/18aiy0v
When should I start learning flask?

So basically I am a 12th grade student who have a sound knowledge of python basics, functions, file handling and exception handling. I am planning to move on to OOPs and making some projects after I finish my final examinations. But before I do that i have a doubt like what are the exact pre requisites I need to learn in python before moving to any python framework(like flask).

/r/flask
https://redd.it/18ararx
Highest Paying Django Companies

I was doing some scraping and now have a db of about 4k job openings. About 200 of those are specifically hiring for Django Developers. I created a page that list the companies that pay the most for Django Developers.

Check it out here: https://gettjalerts.com/jobs/django/highest-paid/

P.S. You can also create an alert that will notify you of any new Django jobs on the market (on the home page).

/r/django
https://redd.it/18alhqy
The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.

Hello everybody for days ive been receiveing The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again. its so irritating because it was working perfectly fine before. i wanna see what updates i've made to my project. heres my app.py file

from flask import Flask,redirect,url_for,render_template,request
app = Flask(__name__)
u/app.route('/home')
def hello_world():
return render_template(about.html)
if __name__ == "__main__":
app.run(debug=True)

/r/flask
https://redd.it/189xprn
If you like to have (different) music on the background while coding, here’s a good retro synth playlist with NO VOCALS. If you also have a playlist, post yours!
https://open.spotify.com/playlist/77ykD3pb0otPIgVpzarriY

/r/flask
https://redd.it/189vv2h
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/18aybv2
Will Pandas have streaming in Future??

As Pandas has switched to arrow backend from version 2.0, is there a possibility that we can see Lazy Evaluation or streaming in Pandas so that we'll be able to process datasets larger than memory on a machine as we have in Polars??

/r/Python
https://redd.it/18b5bsg
D Simple Questions Thread

Please post your questions here instead of creating a new thread. 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.

Thanks to everyone for answering questions in the previous thread!

/r/MachineLearning
https://redd.it/189wh8y
Use cases of Django

Hello guys. I have a little IT business, we create different web applications. I'm also a CTO in this firm, so I understand something in programming. We write frontend on Vue, backend on Asp.net/spring/fastapi. Also we use some clean architecture patterns. We use c#/java for big, complex applications and fastapi for e-commerce.
I discovered Django, and it's possibilities look interesting for short time to market, compared to other frameworks. What best use cases can Django offer in context of my organization? Share your experience please

/r/django
https://redd.it/18b6n21
DataStack: The Fastest way to build apps in python



Hey Python devs,

Excited to share my latest creation – **DataStack**! 🎉 It's a new open-source, event-driven Python web app framework that's here to streamline your development process.

**Key Differentiator:** Unlike Streamlit, DataStack doesn't run your entire Python script on every change. It's designed to be lightning-fast and efficient, responding only to the events that matter. Say goodbye to unnecessary processing!

**Why DataStack?**

* 🌐 **Event-Driven:** Enjoy a responsive and dynamic web app experience.
* 🚀 **Lightning-Fast Updates:** Only processes what's needed, making it super quick.
* 💻 **Minimal Syntax:** Simple, intuitive code for maximum impact.
* 🎨 **Customization:** Tailor your apps exactly the way you want.
* 🔓 **Open Source:** Contribute, customize, and use it freely in your projects.

Github : [https://github.com/data-stack-hub/DataStack](https://github.com/data-stack-hub/DataStack)

Pypi: [https://pypi.org/project/pydatastack/](https://pypi.org/project/pydatastack/)

Share your view on DataStack

/r/Python
https://redd.it/18b5qle
How will you use the new Django 5.0 GeneratedField?

I'm pretty exciting by this new feature and I was wondering how I could benefit from it.

My first question: are properties still relevant?

For example, something like:

@property
def full_name(self) -> str:
return f"{self.first_name} {self.last_name}"


could be easily replaced by a generated field. However, as it's not a CPU intensive task, I'm not sure I'd benefit from it.

Then I was thinking of annotations. In some cases, they can be a little painful to write, and I always have to remember if my queryset is contains the annotation or not. However, what if I replace annotation by a generated field, will it create an overhead, in a sense that it will compute stuff when I may not require it. Maybe the persist_db is the answer to this question?

I'd be glad to know how are you going to use this welcome feature.

/r/django
https://redd.it/18b8pk6
Flask for Video Site

I have this collection of short mp4 video clips (ranging from 30s-2min) coupled with images of explanations of the videos.

The files all organised pretty well, using a letter for categories and an integer for the video number (A1-A52, B1-B40 etc) then the corresponding images use the same format with .png instead of mp4.

Obviously S3 is the place for these.

I've been working on a flask app that runs locally it consists of a index home page with menus/submenus to select the video category which takes you to a new page and displays the videos in a menu which you can hover to display a gif of the video and click to expand the video and play it.

I'm wondering what the best way to implement this using Flask:

* On the front-end side too, is there any tools that make developing this type of site easier? I'm bashing away at CSS and JS to glue the video player and display a button to show the explanation of the clip.

Is **Flask** the best tool to use for this HTML/CSS/JS site or should I be using something else?

I would also like to implement a 'test' scenario that would run through 20 clips and have you

/r/flask
https://redd.it/18bao77