Python Daily

Description
Daily Python News
Question, Tips and Tricks, Best Practices on Python Programming Language
Find more reddit channels over at @r_channels
Advertising
We recommend to visit

Community chat: https://t.me/hamster_kombat_chat_2

Twitter: x.com/hamster_kombat

YouTube: https://www.youtube.com/@HamsterKombat_Official

Bot: https://t.me/hamster_kombat_bot
Game: https://t.me/hamster_kombat_bot/

Last updated 3 months, 1 week ago

Your easy, fun crypto trading app for buying and trading any crypto on the market

Last updated 3 months ago

Turn your endless taps into a financial tool.
Join @tapswap_bot


Collaboration - @taping_Guru

Last updated 4 days, 5 hours ago

3 months, 2 weeks ago

Astral.sh (the company behind uv) paid product: is it going to be a Heroku replacement?

As you might know Astral, the company behind uv and ruff, are a small company but have venture capital funding. And right now they are not making money at all (but of course they're building awesome tools!)

I listened to the Talk Python podcast episode 476 where u/mikeckennedy & Charlie Marsh discuss the new capabilities uv has.

And it got me thinking, since uv is now able to install specific python versions, and since they stated they don't want to charge for features in uv ever, but are planning on charging for features adjacent to it that you might need to get your code up and running, could it be they'll be building a Heroku replacement? Certainly when you're wanting to build a Heroku-like thing it can be beneficial to allow users to specify their exact python version and have ways to install it.

I think it might be very cool and I'm sure there's a lot of opportunity in that space.

Does anybody know if Charlie Marsh or other Astral people ever discussed their plan to make money in more detail?

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

astral.sh

Astral: Next-gen Python tooling

Astral builds high-performance developer tools for the Python ecosystem, starting with Ruff, an extremely fast Python linter, written in Rust.

[Astral.sh](http://Astral.sh/) (the company behind uv) paid product: is it going to be a Heroku replacement?
3 months, 2 weeks ago

Announcing Djangonaut Space Session 3 Applications Open!
https://djangonaut.space/comms/2024-opening-session-3/

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

djangonaut.space

Announcing Djangonaut Space Session 3 Applications Open!

Are you ready to embark on a celestial journey through the Django universe? We’re elated to open the doors for …

3 months, 2 weeks ago

Yes another question

when i try to run this command :
for label in labels:
!mkdir {'Tensorflow/workspace/images/collectedimages//'+label}
cap = cv2.VideoCapture(0)
print('Collecting images for {}'.format(label))
time.sleep(5)
for imgnum in range(numberimgs):
ret, frame =
cap.read()
imagename = os.path.join(IMAGES
PATH, label, label+'.'+'{}.jpg'.format(str(uuid.uuid1())))
cv2.imwrite(imgname, frame)
cv2.imshow('frame', frame)
time.sleep(2)

if cv2.waitKey(1) & 0xFF == ord('q'):
break
cap.release()

it shows this error:
The syntax of the command is incorrect.

Does anyone know why?

/r/IPython
https://redd.it/1fb6v04

Reddit

From the IPython community on Reddit

Explore this post and more from the IPython community

Yes another question
6 months, 1 week ago

Website with dynamic pages

For something like a discussion website (like reddit).

When the user makes a post. whats the best way to create the page.

Right now, i have 1 html file in the statics folder. It works as a template for all posts. When a user clicks on a specific post. It populates that template with all the respective data for that post.

The only thing im thinking is since there is no specific page for each post. lets say someone was to search directly for a post using its title through google. they wouldnt find it since there is no designated html page.

Im thinking. would it be a good idea to change the way the posts are made and instead - make a specific html page for each post. This will end up taking up a lot more space in the static folder as more and more html pages are added.

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

Reddit

From the flask community on Reddit

Explore this post and more from the flask community

Website with dynamic pages
6 months, 1 week ago

Load Tests Python Task Queues

What My Project Does

While looking for task queues, I found that there are many options available in the Python ecosystem, making it really hard to choose the right one. To get a sense of how each library performs and to help make an informed decision, I conducted a load test on some of the most popular ones: Python-RQ, ARQ, Celery, Huey, and Dramatiq.

Target Audience

I hope my findings can help those who are also looking for a task queue solution in Python.

Comparison

Most articles out there seem to focus on comparing the features of these libraries but rarely discuss performance. While there could be a lot of improvements on my tests, I think it still provide some different insights into how each library handles heavy loads and concurrency.

Links:

You can read my findings on my blog

Check out the source code: on Github

Thanks

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

Tech Notes from Steven

Exploring Python Task Queue Libraries with Load Test

Task queues play a crucial role in managing and processing background jobs efficiently. Whether you need to handle asynchronous tasks, schedule periodic jobs, or manage a large volume of short-lived tasks, task queue libraries can help you achieve these goals.

6 months, 1 week ago

Problem with accessing cookies and custom headers in Django Rest

Hello. So these past few days I've been trying to solve a problem with no avail - I do not receive cookies or custom headers from my react frontend to my django backend, even though when I try with postman it works.

This is my relevant react code: https://pastebin.com/1iemmgAD
And this is my relevant django code: https://pastebin.com/pebfH2Yd

Plus my settings.py: https://pastebin.com/4Lyp3H3e

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

Pastebin

export const getGuestCart = () => { if (readCookie('cart_token')) { - Pastebin.com

Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.

6 months, 2 weeks ago

Look what library I've build for Django - Django SuperApp

https://django-superapp.bringes.io/

The idea behind SuperApp is to encapsulate everything within apps (including settings.py and urls.py) to ensure high reusability. You simply copy an app into your project, and it's ready to use.

Feedback is highly appreciated!

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

django-superapp.bringes.io

SuperApp – SuperApp

Build your app faster with Django SuperApp.

Look what library I've build for Django - Django SuperApp
6 months, 2 weeks ago

Made a Minimalistic Router for Uvicorn

Hey everyone,

I've been working on a simple router for Uvicorn called ASGIRouter. If you like how Flask handles routing but want to stick with ASGI, you might find this useful.

# What My Project Does

ASGIRouter provides a minimalistic routing solution for ASGI applications. It offers a straightforward way to define routes, similar to Flask, but is built to work any asgi compatible webservers mainly uvicorn.

This project is aimed at developers who prefer a minimalistic approach to routing in their ASGI applications. It's suitable for both toy projects and production use, depending on your needs.

Compared to existing ASGI routers, ASGIRouter stands out for its simplicity and ease of use. While other routers might offer more features or complexity, ASGIRouter focuses on providing a minimalistic, Flask-like experience for those who want to keep things straightforward.

Check it out and let me know what you think.

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

GitHub

GitHub - achaayb/ASGIRouter: ASGIRouter is a lightweight and flexible ASGI routing library.

ASGIRouter is a lightweight and flexible ASGI routing library. - achaayb/ASGIRouter

Made a Minimalistic Router for Uvicorn
6 months, 2 weeks ago

Can i redirect to a specific section of a html page using return template in flask ?

Instead of displaying section 1 i want to display section 3 .Is it possible ?

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

Reddit

From the flask community on Reddit

Explore this post and more from the flask community

Can i redirect to a specific section of a html page using return template in flask ?
6 months, 3 weeks ago

What quantifiable metrics do you consider when deeming good code?

Basically imagine someone asks you to review code. What kind of quantifiable metrics (i.e. efficiency, readability, test cases, etc.) would you take into consideration when looking at it?

Edit: For more context, this would be for if you were to compare two pieces of code from two different people answering the same issue. What are your thoughts on how someone can essentially “grade” both pieces of code to figure out which ones better than the other

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

Reddit

From the Python community on Reddit

Explore this post and more from the Python community

What quantifiable metrics do you consider when deeming good code?
We recommend to visit

Community chat: https://t.me/hamster_kombat_chat_2

Twitter: x.com/hamster_kombat

YouTube: https://www.youtube.com/@HamsterKombat_Official

Bot: https://t.me/hamster_kombat_bot
Game: https://t.me/hamster_kombat_bot/

Last updated 3 months, 1 week ago

Your easy, fun crypto trading app for buying and trading any crypto on the market

Last updated 3 months ago

Turn your endless taps into a financial tool.
Join @tapswap_bot


Collaboration - @taping_Guru

Last updated 4 days, 5 hours ago