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
Modern ttk theme

​

Azure theme for ttk

Hi!

I just hate the look of tkinter and the built-in themes of ttk are ugly too, so i made my own ttk theme in beautiful azure and gray colors. Check it out on GitHub!

/r/Python
https://redd.it/liytrm
Corona Virus UK dashboard powered by Flask

I just found a link to the Public Health England Corona Virus Dashboard on github ( from /r/CoronavirusUK ). It looks like the core of the code is in Flask. https://coronavirus.data.gov.uk/

https://github.com/publichealthengland/coronavirus-dashboard-frontend-server/blob/master/requirements.txt

/r/flask
https://redd.it/lj0wt1
Folders structure for hexagonal architecture in Flask

Hi guys, I have been reading the Leonardo Giordani book about Clean Architecture and I want to start building some app with python and Flask, my doubt is how I can organize my folders, is there any standard way to do it? Thanks in advance

/r/flask
https://redd.it/lizetu
Spend 1 minute a day to improve your Python skills

I have a youtube channel called ProgrammingWithYash where I publish a short Python tutorial every day. My goal is to teach a common pattern or technique in under 60 seconds.

I try to be respectful of the viewers time and make the videos terse and clear with as little unnecessary fluff as possible. The content is mostly aimed at beginners, I hope it can help some of you to get into the habit of learning something new every day.

As I'm just starting out with this youtube thing, I'd love to hear your feedback regarding the format, content, anything... (topic suggestions are highly appreciated as well).

/r/Python
https://redd.it/lj0t0z
Sunday Daily Thread: What's everyone working on this week?

Tell /r/python what you're working on this week! You can be bragging, grousing, sharing your passion, or explaining your pain. Talk about your current project or your pet project; whatever you want to share.

/r/Python
https://redd.it/ljcnj2
connecting Vue/React with django

im working on a blog project with a simple template , and after i finish it i wanna connect it to a front end template using vue , how i do that ? i will have just to import vue files inside template or i should convert my blog to and api ? [im new in django i have only basics\]

/r/django
https://redd.it/ljd1os
So I Accidentally Made a (Harmless) Virus...

I was messing around with python (specifically pynput) and got bored, and thought "wouldn't it be cool if I made a virus?" Now, when I thought this, I was doing purely for shits and giggles, and I had/have no harmful intent.

So the virus consists of a basic forever loop, which just takes control of your mouse, and prevents you from moving. Really basic, I know. So I run the file, and to my surprise is works! Except I didn't implement a fail safe, so nothing would work to stop the program. I obviously couldn't use task manager, and Alt + F4 didn't work. So I ended up just turning off my PC lmao. I wanting to see if my computer would detect it as a virus, and it sure did. It didn't delete it, but it did warn me, which is reassuring but also funny.

But yeah I didn't send the code to anyone or anything, just a harmless thing that took me less than 5 minutes.

/r/Python
https://redd.it/ljghmz
SQLAlchemy - calculate a default value during instance creation

Hi all,


I'm creating the following table.
I would like to automatically populate the value for createdAt from the period DateTime + a time delta from duration in seconds. (I want to avoid doing this in my PGCRs instantiation).

So this would look like, outside the DB table:

createdAt = period + datetime.timedelta(seconds=duration)


Here is my model for reference:

class PGCRs(SurrogatePK, Model):
"""
A table to store a list of players PGCR's.
PGCR's are linked back to user via 1 to many relationship.
"""

tablename = "pgcrs"
instanceId = Column(db.Integer, nullable=False, default=666)
duration = Column(db.Integer, nullable=False, default=666)
period =

/r/flask
https://redd.it/lj94uh
How to embed a simple-prompt ipython?

How ca I pass the --simple-prompt argument in IPython.embed()?

If I add to my code

from IPython import embed ; embed()

This drops me into a standard ipython which causes issues for me, while a simple prompt version would work OK.

Thank you!

/r/IPython
https://redd.it/ljk9t1
Why you should use Django in 2021

Building a backend for a web application is tricky. It involves selecting a language that you are comfortable with and then picking a web framework built on top of that language to avoid writing things from scratch.

There are a ton of web frameworks out there, each designed to address specific needs. The Django web framework addresses all of those needs to a reasonable extent and hence it is preferred by companies like Spotify and Instagram.

## What is Django?

Fun fact: Django was named after the jazz guitarist *Django Reinhardt*.

Django is an open source web framework built on top of python. The primary purpose of Django is to enable super fast development of backend applications. 

A backend application is nothing but an interface to a database meant for reading the data models and presenting it to a user in a form that they understand. It is also responsible for creation of new entries in the database and updating existing data.

Why use a web framework?

If one has to do this from scratch here is what will happen. First you will realise that raw SQL queries would have to be written to manipulate the database and this stops scaling pretty quickly.

You might then resort to

/r/django
https://redd.it/ljgpqn
We made a tool to prevent merge conflicts before they even happen - GitHub app + VSCode extension, would love feedback from the Python community

Hi everyone, I’m Kiril and together with my co-founder we are building developer tools we wish existed.

Our og idea was building a new version control system (and we do have it bootstrapped), but now we are making tools that are easier to be plugged into an existing workflow.

We built two tools we heard from other devs might be cool:

​

A plugin for VSCode that detects in real time if your \_local\_ and even \_uncommitted\_ code conflicts with other on your team. Check it out here [http://getsturdy.com/](http://getsturdy.com/)

A Pull Request bot that will write a comment in the PR if it conflicts with other PRs https://getsturdy.com/changelog

The thinking there is by giving early heads up about conflicts, people can make more informed decisions (eg. pull latest code, work on another file, coordinate with colleagues etc.)

The tool installs as a GitHub app and similar to a CI tool it requests access to code to do it’s job (responding to web hooks and continuously making checks).

The VSCode plugin is open source https://github.com/sturdy-dev/sturdy-vscode and we would like to have the backend open source too, as soon as we clean up the code.

I would be super thankful for any feedback the community might

/r/Python
https://redd.it/ljlj8e
Is sqlalchemy pagination work for 100k rows?

I have a sql returning about 100k rows.
I want to use bootstrap table with sorting to display all the rows.
Is sqlalchemy able to do so ?

If not,What is the optimal number of rows?

/r/flask
https://redd.it/ljq7kq
QR code that is also a quine

I recently found out you can generate QR codes with Python, so I made a quine out of it. The source code is located here.

/r/Python
https://redd.it/ljv23e