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
Application data flow between browser, Nuxt and Django for simple CRUD app with session authentication (repo, article & diagram in comments)

/r/django
https://redd.it/kts9xw
This media is not supported in your browser
VIEW IN TELEGRAM
[P] [D] ML algorithm that can morph any two images without reference points.

https://redd.it/ktnwcv
@pythondaily
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/ku2q3e
As a thank you to the community, here is my new book: Slither into Data Structures and Algorithms

Hi everyone!

A couple of years ago I released "Slither into Python" for free online which was an introduction to Python for complete beginners. I released it for free as a thank you to the Python community in general. You can view that here.

The feedback was amazing (thank you all, I'm delighted you enjoyed it!). It inspired me to write another book that I felt was the natural extension to it - focusing on data structures and algorithms. In fact, I had a lot of requests for it after the last two chapters of that book so that inspired me even more to write this.

I had started on it a while back but work became super busy and last year happened so I kind of forgot about it. However I recently came across the files and decided to pick it back up.

It's now complete: "Slither into Data Structures and Algorithms: A concise guide to the backbone of the digital world through Python" and you can check it out here: slitherintoalgorithms.com.

The chapter on Graphs is up and free to read on the site! Again, I'd like to thank everyone on this subreddit that gave such amazing feedback and improvements for my last

/r/Python
https://redd.it/ku09n3
D Color coding equations

I've seen this done in a few places and wanted to give it a try - where you color code parts of mathematical equations so that it's easier to follow them around, or to group them.

At a glance it seems easier to follow around and see some relationships. Wonder whether it can be a distraction when reading the text. What are your opinions on it?

Example: (screenshot from https://lab-ml.com/labml\_nn/transformers/relative\_mha.html)

https://preview.redd.it/ir7zouvns8a61.png?width=1062&format=png&auto=webp&s=c603bb1681a83efbbbacf382ccf8e511c51efafb

/r/MachineLearning
https://redd.it/ktkuay
Sane: Makefile for Humans

Despite being a great and flexible tool (proof of which is how long it's been around for!), I've always been a little frustrated by Make in two aspects:

1. How cumbersome and opaque the grammar of Make is ($* $< $@?!)
2. How hard it is to keep state (which usually ends up in having a recipe be a single long bash line with a lot of \s --- and that's ugly and hard to read.)

`Sane` (`sane-build` in PyPI) is an attempt to create an alternative that incorporates the ideas of Make, but provides the full flexibility of Python in terms of writing logic.

From the project's README:

> - Recipes are python functions with recipe/file/hook dependencies.
> - If a recipe A depends on recipe B, recipe B is checked. If B is ran, then A is ran afterwards.
> - Recipes are ran if its dependency files are newer than its target files (or if either cannot be found).
> - Recipes with no dependencies are always ran.
> - Hooks are a way to tag dependencies. Recipes depending on a hook depend on all recipes with that hook.
> - Everything else is standard Python.

Like its name indicates, sane tries to be as uncomplicated as possible

/r/Python
https://redd.it/ktxk80
A list of tutorials for beginners

I have been working on a series of videos to show the basics of Python Programming to beginners. If you are new to the language, programming in general, or would like a quick reference to some basic concepts, this will hopefully be a good resource for you!

[Introduction](https://youtu.be/eJt-leDZqls)
Creating, Using, and Manipulating Variables
[Working with Arrays and Dictionaries](https://youtu.be/BsgfRXaVTik)
Controlling Program Flow with Loops
[Recycling Code with Functions](https://youtu.be/Dwkb2rcoT2U)
Creating Abstract Objects through Classes
[Relating Objects to One Another with Inheritance](https://youtu.be/POkIYB1vlcA)
Replacing Parent Methods by Overriding Functions
[Utilizing Static and Class Variables](https://youtu.be/u55vEYcMWko)
Creating Virtual Environments

The tutorials follow a long-term series where I build bigger projects, so the list will grow over time. I would love to hear suggestions for more videos to make!

/r/Python
https://redd.it/ktqnce
How to use Billplz secret key for FPX payment in Flask



Hi there good day, I am new to payment gateway and would like to integrate it with Flask. I am currently using Billplz as my FPX payment gateway. I do not have any examples on using Billplz with flask and hence I am stuck at here currently. They have provided a secret key with a few API references on payment methods. Can I use to call the payment gateway like this http/API/secretkey/bank. Is my understanding wrong? Appreciate if can share any guidelines on how to setup payment gateway with only secret key.

This is their website by the way. https://www.billplz.com/api#introduction

/r/flask
https://redd.it/ku9nnc
I finally did something I feel was worth while

I work in the public health sector, an area with very bad technology debt. A lot of data is still on paper, scattered throughout spreadsheets, or somewhere else and deemed to exist so it's fine we don't need to track that. It's totally fine.

Well, I work in research and evaluation and for a very large grant, I needed to connect our student records to a federal database that tracks where they are out in the field once they have started medical residency and become established as doctors.

We only had names of students, and many python headaches later I ended up with a script to write all of the results for each API call to an Excel file, except I had to enter each first and last name manually.

We were going to make a graduate student do the manual entry of it all. It probably would've taken months. But then I realized I could just make a little script to do the entries instead.

It was very stitched together, and it almost certainly could have been more elegant, but it worked and only took a couple of days for it to go through all of it.

/r/Python
https://redd.it/kty4h3
Pyradox: State of the Art Neural Networks for Deep Learning

🎉 Introducing pyradox: a python library that helps you with implementing various state of the art neural networks in a totally customizable fashion using TensorFlow 2.

Check out how it can be used to Detect location of Keypoints on face images: https://ritvik19.medium.com/facial-key-points-detection-using-pyradox-f2a6cf6a862f

You can find pyradox here: https://github.com/Ritvik19/pyradox

Don't forget to the repo!

/r/Python
https://redd.it/kubmlz
How to mask a domain name with another?

I created a web app, where a user get a pre-made website upon signup (e.g. www.webapp.com/user1) I would like users to use custom domains for their websites.

For example, I'd like www.webapp.com/user1 to be accessible via a new custom URL www.user-custom-domain-name.com.

I know both WordPress and Wix allow users to do this.

Does anyone know? Any help or pointer would be appreciated. Thank you.

&#x200B;

P.S. I'm using PythonAnywhere's paid service and PythonAnywhere is using uWSGI as server layer.

/r/flask
https://redd.it/ku3q6q
PyPLANE - open source ODE solver written in Python

Hey everyone! Introducing our new app PyPLANE: your new favourite GUI-based solver for ordinary differential equations. https://github.com/m-squared96/PyPLANE

&#x200B;

PyPLANE is built using NumPy, SymPy and Matplotlib in the backend, with a PyQt frontend. As it's an app it's not up on PyPI, but if you run Linux it can be installed via the Snap store using `sudo snap install pyplane`. Windows users: we don't have the executable ready yet, but watch this space. Mac users: sorry bro.

&#x200B;

This is an early release, so expect some stability issues. But fear not! We plan on rolling out a full, stable V1 release before too long. If you want to get involved, join us on GitHub. This is a great opportunity to do something novel with some of the cornerstone modules used in data science, and a great project to include in any portfolio.

/r/Python
https://redd.it/kughg4
I created a pandemic simulator using Python & pygame

I recently started working on a pandemic simulator. My goal is to make people aware on how fast and easily the virus could be spread. The green dots are safe people, red infected and blue are the immune. My code will be available later to run some simulations yourself!

https://www.youtube.com/watch?v=bD258\_Tz8ME

Keep safe!

/r/Python
https://redd.it/kufbao
What are some reasons why you might include 'myappname.apps.AppConfig' in INSTALLED_APPS rather than just 'myappname'

I'm trying to understand some common use cases for needing to subclass `AppConfig` and include `myappname.apps.MyAppConfig` in `INSTALLED_APPS` rather than just `myappname`. I have been looking at [https://docs.djangoproject.com/en/3.1/ref/applications/](https://docs.djangoproject.com/en/3.1/ref/applications/), but I haven't seen any specific examples of why you might want to do this.

The one use case I have ever needed this for is for importing signals defined outside of `models.py`, like this:

from django.apps import AppConfig


class MyAppConfig(AppConfig):
name = "myappname"

def ready(self):
import myappname.signals

Does anyone have some practical examples of other things you might do with a subclassed `AppConfig`? I understand that this might used when making reusable Django applications (something I haven't done yet), so this might be more relevant for that type of use case, so I'm mostly asking about use cases for non-reusable apps.

/r/django
https://redd.it/kuinrq
Monday Daily Thread: Project ideas!

Comment any project ideas beginner or advanced in this thread for others to give a try! If you complete one make sure to reply to the comment with how you found it and attach some source code!

/r/Python
https://redd.it/kuqhej
Using django templates and vue components am I better using the vue cdn?

/r/djangolearning
https://redd.it/kup9o1