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
Simple word-replacer script

Hi guys new to python and i made this simple script. Any advice regarding code quality and other stuff will be highly appreciated.


https://github.com/ginop-1/word-replacer

/r/Python
https://redd.it/ld5hfp
Any interesting open projects to join? Or anyone want with some good ideas want to start one?

Edit - making a virtual assistant. Anyone wanting to contribute dm:)

/r/Python
https://redd.it/ld82ds
Creating an RPG Character Builder

By popular demand from last weeks event, today I'm going to step into a realm of Python that I'm not comfortable with \~ classes. I never need to build classes in my daily life so tonight for the code along challenge I'm going to attempt to build an RPG Character Creator using classes and make the characters fight each other to the death. So in order to prepare for this I've spent the week thinking about different approaches and training relentlessly. . .

​

Training Python in the Gym

Thinking about Python while training with Cat

​

If you're interested in learning about classes, python, ask questions, hanging out with nerds, or want to come help me figure my way through this code - Join the code along and hang out with us tonight or join us in discord! We have a few folks who have been working with python daily for years and are throwing ourselves out there to help python noobies or be there for people while they learn on their own.

​

Discord for casual Python shenanigans: Minimoose Lodge

Stream for the funzies: M1N1M00SE (Tonight at 6PM EST)

/r/Python
https://redd.it/ldfaka
Nginx for static HTML?

Hey guys! I'm relatively new to server-side rendering and all the best practices, so I have a question surrounding static content.

Assuming I'm working on a Flask app with some server-side rendered content, if I have a page that requires no templating or server-side rendering, should I defer from Flask and opt for a CDN or Nginx for serving that content?

My login page, for instance, is completely static, so I'm not sure if I should be serving it from Flask.

I'm sure it would be more performant, but I'm unclear as to the best way to separate routing for Flask -served pages and the static pages. I'm sure a reverse proxy could do this, but adding configuration for static sites at this level seems arduous. Is this common? And it's just a matter of configuring proxy routing for each of the static pages? Or is this overkill, and I should just render the static HTML, given that all the other pages will be server-rendered anyway.

Also, even if Flask still serves the login page, I assume all JS and CSS would ideally be served from something more suited for static content? This one seems easier to configure.

I should mention that I'm thinking in

/r/flask
https://redd.it/ldlwn6
P Sense: Open Source Framework for Video Understanding & Action Recognition with Deep Learning

Very happy to share with the community the news that the team I work for recently released an inference engine called sense that enables developers to use RGB camera input to predict human actions. No pose estimation, no skeleton tracking, just end-to-end deep learning.

We strive to make it the all-in-one toolkit to collect and clean video data, train powerful and efficient video classifiers, and deploy to any device (with iOS and Android support).

The inference engine is accompanied by our pre-trained weights that individuals can download for free. The models are small, efficient, and run smoothly on CPUs. With the pre-trained weights, our stack supports demos such as gesture recognition, fitness tracking, fitness repetition counter and calorie counting out of the box.

You can perform transfer learning on the weights to train your own video classifier and customize the model to your use cases.

Feel free to give it a try, open an issue, give us feedback! We want to make it more fun and exciting for you to use 👉 https://github.com/TwentyBN/sense

/r/MachineLearning
https://redd.it/ld8yjz
Any good tutorials on pairing Vue with Django?

Ive been using Bootstrap and straightforward HTML files to make everything work but I wanted to start using JS and work with more languages/frameworks. I'm a little confused on how to have django interact with Vue since not only does the framework use HTMLs, but apps/components too. Im still new to Vue frankly so Im not expecting to pop out a beautifully made UI out my ass but I hope I can learn enough from a good tutorial. Thanks for any tips.

/r/django
https://redd.it/ldm7wq
Saturday Daily Thread: Resource Request and Sharing!

Found a neat resource related to Python over the past week? Looking for a resource to explain a certain topic?

Use this thread to chat about and share Python resources!

/r/Python
https://redd.it/ldkzyi
New to Django, Need help accessing python manage.py runserver

Hey all,

I just started to learn Django to help build a portfolio that I wish to build. However, as I go through the steps in this website, I run into a bit of a problem that I am not sure how to address. I have managed to make a virtual environment though when trying to run

python manage.py runserver

in the cmd prompt, I am getting an error suggesting that it can't open the file, and there is no such file or directory. I believe I am running Python as an administrator but I can check again if that matters. Below is a picture of what I am getting. If anyone here could lend a hand that would be great!

https://preview.redd.it/cm5kslglzpf61.png?width=1920&format=png&auto=webp&s=7d2a6c92713ee820cb1e7d97f31c96edad108bd0

/r/djangolearning
https://redd.it/ldgnh5
P Building an End-to-End Machine Learning Application From Idea to Deployment

Hey all,

A lot of beginner tutorials out there for using machine learning don't really go beyond copy-pasting some sample code off the Tensorflow website and running it through an overused benchmark dataset.

So I thought I would describe a viable sequence for carrying a machine learning product through a more realistic lifecycle from initial idea to a deployed solution.

The domain is fake news detection and in a series of blog posts I describe:

\- project setup

\- exploratory data analysis

\- building a training/evaluation pipeline

\- error analysis

\- deploying a server and creating a Chrome extension for browser-side interaction

\- building a continuous integration/deployment solution.

Here's the first post in the series and source code. Hope you find it helpful!

/r/MachineLearning
https://redd.it/lds3z1
I've made a really good webcam-based 3x3x3 rubik's cube solver program

TL;DR: here's the project: https://github.com/kkoomen/qbr

The idea came after many years of me solving rubik's cubes in combination with my programming knowledge. I did want to make a program so that even my friends could solve a rubik's cube without knowing anything about it. Hence that I've also added a humanized-notation where all the rubik's cube notation gets converted into humanized sentences such as:

1. Turn the back side 180 degrees.
2. Turn the top layer 180 degrees.
3. Turn the front side a quarter turn to the left.
4. Turn the right side a quarter turn away from you.
...


I've started this project almost 6 years ago when I was still studying and got a decent-working version, but the color detection only worked for my room and my lightning setup. Many things were hard for me since I was still studying programming.

After roughly 6 years (and working professionally for already 6+ years), I got a nice suggestion from someone else on one of my issues on how to improve the color detection using LAB colors + the CIEDE2000 color-distance algorithm. This worked insanely good and got my really accurate results (assuming a room had regular lighting). Due to my knowledge I've built up in the

/r/Python
https://redd.it/ldx3ii
How do you add reactivity to Django templates?

I want to add some reactivity to my website, but I don't want to go the full SPA route. Moreover, I believe Django already does a great work at rendering templates, routing views, etc. So why adding more complications?

I looked into Svelte, but couldn't figure out how to combine it with Django templates, especially in cases where Svelte should display context information from the Django app.

The best I could gather was that Vue, for instance, can combine its own template tags and django tags. Perhaps React can do the same, but must check.

So I wonder, if you want to add some reactivity to the website, what route do you follow? Is there a way of integrating instead of splitting (i.e. instead of making your django app serve an API and your frontend consume it, etc.) that you think is worth exploring?

/r/django
https://redd.it/lduj9l
Moving up from sqlite

I am running a flask web app which requires a lot of database activity. At the moment I am getting around 250,000 database writes and 300,000 database queries a day.

It’s growing fast (20% a day at the moment, with potential for big spikes) and I’m worried that the current setup I have (local SQLite database) will start to creak soon. (I’ve read that 100k a day is the recommended limit).

Questions for you:

- When does SQLite actually start to struggle in a flask setup? What will happen when it does? Performance slowdown or massive explosion with data loss?

- Where is the natural place to graduate to? MySQL? Postgres? Ideally I would like something which requires the absolute minimum of code changes vs the current sqlalchemy/SQLite setup I have. I know zero about database admin/setup.

- How should I think about running the DB server? Run it locally? Cloud? Database access needs to be super quick and intuitively I’m worried that running in the cloud will introduce additional delay - but maybe I’m worried about nothing.

/r/flask
https://redd.it/ldvner
How to Start Machine Learning in python in 2021 for free & 100% online

Here's a complete guide to start and improve in machine learning (ML), artificial intelligence (AI) in 2021 without ANY background in the field. I also share my tips on how I stay up-to-date with the latest news and state-of-the-art techniques.

Video: https://youtu.be/RirEw-uaS\_8
Full guide: https://medium.com/towards-artificial-intelligence/start-machine-learning-in-2020-become-an-expert-from-nothing-for-free-f31587630cf7
GitHub repo with all the links: https://github.com/louisfb01/start-machine-learning-in-2020

/r/Python
https://redd.it/ldyods
I made a data dashboard web app which you can interactively build by writing python code IN the dashboard. It's available as a python package, and contributors are very welcome! (and I actually need some)

https://github.com/phillipdupuis/dtale-desktop

And here is a quick little demo, since a picture is worth a thousand words and all that jazz:

​

https://reddit.com/link/le6lfm/video/f15q4w5f5xf61/player

You can install it via pip install dtaledesktop, and you can run it by either entering dtaledesktop into a terminal or via python code like import dtale_desktop; dtale_desktop.run(). The visualizations are provided primarily by dtale, an amazing tool for exploring pandas DataFrames.

The motivation is to make it simple for researchers/analysts/etc. to organize their python scripts into a functional dashboard. It allows them to run those scripts and explore the data visually by simply clicking a button. They can edit the code or add new scripts at any time, and results/insights can be shared with peers by simply sending them a link.

If anyone is interested in contributing, as long as you know how to use pandas you're probably qualified. What I'm currently looking for help with is building out a library of 'template' data sources for less python-savvy individuals. An example of this could be a template for loading csv files from a remote server -- the user would click "Add Data Source", they would pick the "Remote CSV Files" template, and then they would just plug in the paths to the files

/r/Python
https://redd.it/le6lfm
Outdated Flask extensions

I basically love Flask and its open source culture.

But what I noticed is that some important extensions don't seem to be maintained anymore. For example, flask-restful had its last commit in October last year, and currently 78 issues and 35 pull requests. That looks like that the owners of the repo are not working anymore on this extension. Doesn't that even impose security risks if nobody fixes possible flaws?

/r/flask
https://redd.it/le6htu
I built a URL Shortening Tool which provides Smarter Analytics!

TLDR: Looking for reviews on my first side project: **https://tracer.syscape.live/**

It is a minimal app, which does what it says. Shortens your URL, and provides you with analytics.

Analytics Include:

IP Address
Location of ISP
RAM
OS
Device Brand and Name
Battery Percentage when URL was clicked

​

https://preview.redd.it/hds13y2fawf61.jpg?width=1265&format=pjpg&auto=webp&s=53bb212903289da4eb6d13078ff5b8712a8b0e30

Hey guys, so this lockdown, I built a url shortening service using Flask, DynamoDB, AWS SES, Nuxt.js, AWS Amplify and AWS Lambda.

We also provide these analytics on a user friendly dashboard.

I would much appreciate your feedback on the website. We plan to add much more stuff like map based UI for location, etc.

/r/flask
https://redd.it/le2nap
CONFETTI - The way to start a Django project with Docker

I tried to accumulate best practices that I used for a long time in one project. I hope you'll learn something new from this. It's not a template, it's more like 'copy some piece if you need this'. I will add more stuff, e.g. Redis, Celery... If you find it useful)

Source: https://github.com/funnydman/confetti

Don't hessite to make any improvement, pull requests are welcome.

/r/django
https://redd.it/le15j1