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
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
YouTube
Pandemic Simulation using Python & Pygame
Small example on about my project simulating the pandemic and why we should flatten the curve. Using this small simulation environment I want to show why we all should keep our distance. My goal is to make people aware on how fast and easily the virus could…
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
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
reddit
What are some reasons why you might include...
I'm trying to understand some common use cases for needing to subclass `AppConfig` and include `myappname.apps.MyAppConfig` in `INSTALLED_APPS`...
I talk about general stuff that you probably we're looking at on your Flask Project, How to create a logout route and trigger it from navbar, force users to log in before accessing some page, automatically log in users that have just registered. Enjoy! :)
https://youtube.com/watch?v=e5EN8i-PaAg&feature=share
/r/flask
https://redd.it/kuffp6
https://youtube.com/watch?v=e5EN8i-PaAg&feature=share
/r/flask
https://redd.it/kuffp6
YouTube
Python Flask Full Series - Web Application Development - Logout and Customizations - Episode 13
Python Flask
#Python
👍Welcome to my Python Flask tutorial
In this episode, we will do the following things:
- Enabling logout from navigation bar
- Force users to log in before they access the market page, so visit this page anonymously will be forbidden.…
#Python
👍Welcome to my Python Flask tutorial
In this episode, we will do the following things:
- Enabling logout from navigation bar
- Force users to log in before they access the market page, so visit this page anonymously will be forbidden.…
Don't pay to learn Flask with python! Just watch this free course of Flask with python!!
https://www.youtube.com/watch?v=AAtUS0lLjvQ
/r/flask
https://redd.it/kurwxh
https://www.youtube.com/watch?v=AAtUS0lLjvQ
/r/flask
https://redd.it/kurwxh
YouTube
Web development with flask and python | Setting up your website | Tutorial 1
Don't Forget to subscribe and turn on the notifications and also like the video so you can help me beat the YouTube algorithm
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
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
reddit
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...
aliev/aioauth Asynchronous OAuth 2.0 framework for Python 3
https://github.com/aliev/aioauth
/r/Python
https://redd.it/kunnow
https://github.com/aliev/aioauth
/r/Python
https://redd.it/kunnow
GitHub
GitHub - aliev/aioauth: Asynchronous OAuth 2.0 provider for Python 3
Asynchronous OAuth 2.0 provider for Python 3. Contribute to aliev/aioauth development by creating an account on GitHub.
Using django templates and vue components am I better using the vue cdn?
/r/djangolearning
https://redd.it/kup9o1
/r/djangolearning
https://redd.it/kup9o1
Numpy Gem: Vectorizing Ragged Arrays
My friend asked me about vectorizing k-means. Algorithms like k-means typically require doing the same calculation (distances between sets of points and centroids), but across unevenly-sized sets. However, turns out you can express this naturally with numpy, and the technique seemed generally applicable. Vectorization is crucial: on my mini-benchmark, it gets a 300x speedup on my python code.
​
For something like k-means, most of the time this means you have to either do extra work (compute all pairwise distances between every centroid and every point across all sets) or use an un-vectorized python loop.
​
I've found myself using the same vectorization technique several times so I decided to write it up. See more on this post.
/r/Python
https://redd.it/kurcl6
My friend asked me about vectorizing k-means. Algorithms like k-means typically require doing the same calculation (distances between sets of points and centroids), but across unevenly-sized sets. However, turns out you can express this naturally with numpy, and the technique seemed generally applicable. Vectorization is crucial: on my mini-benchmark, it gets a 300x speedup on my python code.
​
For something like k-means, most of the time this means you have to either do extra work (compute all pairwise distances between every centroid and every point across all sets) or use an un-vectorized python loop.
​
I've found myself using the same vectorization technique several times so I decided to write it up. See more on this post.
/r/Python
https://redd.it/kurcl6
Vlad Feinberg
Vectorizing Ragged Arrays (Numpy Gems, Part 4)
Vlad's Blog
Google sign in Error 403: disalloweduseragent only in iOS
I used django-allauth to implement a Google sign in, and everything works fine across major browsers on computer, Android, and iOS. The problem is when someone on iOS opens my link inside an app like messenger or instagram. I don't know what the browser is called (WebView on Android I believe), but the Google sign in gives an Error 403: disallowed\useragent. Doing the same thing on Android works fine, so I think it's an iOS issue. When I looked it up, I didn't find any clear solution. Anyone have an idea for a workaround?
/r/djangolearning
https://redd.it/kv038o
I used django-allauth to implement a Google sign in, and everything works fine across major browsers on computer, Android, and iOS. The problem is when someone on iOS opens my link inside an app like messenger or instagram. I don't know what the browser is called (WebView on Android I believe), but the Google sign in gives an Error 403: disallowed\useragent. Doing the same thing on Android works fine, so I think it's an iOS issue. When I looked it up, I didn't find any clear solution. Anyone have an idea for a workaround?
/r/djangolearning
https://redd.it/kv038o
reddit
Google sign in Error 403: disallowed_useragent only in iOS
I used django-allauth to implement a Google sign in, and everything works fine across major browsers on computer, Android, and iOS. The problem is...
How to master Django and get a job (6 min video)
Hi!
I just published a short (6 min) video where I talk a little bit about the most important (at least in my opinion) concepts to know and some other things you can do to get a job.
If you think this sounds interest, you can find the video here:
https://www.youtube.com/watch?v=dFnQ9gDz0pM
I would love to hear your opinion on it (quality and content) :-)
/r/djangolearning
https://redd.it/kv0w9a
Hi!
I just published a short (6 min) video where I talk a little bit about the most important (at least in my opinion) concepts to know and some other things you can do to get a job.
If you think this sounds interest, you can find the video here:
https://www.youtube.com/watch?v=dFnQ9gDz0pM
I would love to hear your opinion on it (quality and content) :-)
/r/djangolearning
https://redd.it/kv0w9a
YouTube
Become A Django Developer And Get A Job
I often get asked how people can become a better Django developer, how to go beyond the basics and what they need to know to get a job.
In this video, I will go over the most important steps and other things you can do to get a job.
Django is one of the…
In this video, I will go over the most important steps and other things you can do to get a job.
Django is one of the…
Trying a college bus tracking project for my college. Is Django appropriate for such a task? And also, what kind of APIs will I need for this? Thanks.
/r/djangolearning
https://redd.it/kv23jx
/r/djangolearning
https://redd.it/kv23jx
reddit
Trying a college bus tracking project for my college. Is Django...
Posted in r/djangolearning by u/bmtkwaku • 1 point and 0 comments
Flask user management
Hi there!
I am working on a project of mine where I want the user to visit his profile and make changes but if the user is visiting another person's profile then he should see a slightly different version of the page. Like we have on any social media site.
The idea is pretty simple basically I want to determine if the user visiting another person's page is a different person or the owner of the profile. Depending on that the contents will be different on the profile page. For example the ability to edit the profile or follow a user
I hope I made my point clear there. Could someone help me out as to what all tutorial should I refer for this.
/r/flask
https://redd.it/kv762b
Hi there!
I am working on a project of mine where I want the user to visit his profile and make changes but if the user is visiting another person's profile then he should see a slightly different version of the page. Like we have on any social media site.
The idea is pretty simple basically I want to determine if the user visiting another person's page is a different person or the owner of the profile. Depending on that the contents will be different on the profile page. For example the ability to edit the profile or follow a user
I hope I made my point clear there. Could someone help me out as to what all tutorial should I refer for this.
/r/flask
https://redd.it/kv762b
reddit
Flask user management
Hi there! I am working on a project of mine where I want the user to visit his profile and make changes but if the user is visiting another...
As a Gift to the Community, I'm Making my Python Book Free for 72 hours!
**Python 101 2nd Edition** is the latest version of Python 101. This book is meant to help you learn Python and then go beyond the basics. I've always felt that a beginner's book should teach more than syntax. If you'd like to try out Python 101, you can do so for **FREE** for the next 72 hours by using the following link: [https://leanpub.com/py101/c/mvp2021](https://leanpub.com/py101/c/mvp2021)
If you have a Gumroad account, you can get the book here ([https://gumroad.com/l/pypy101](https://gumroad.com/l/pypy101)) for free using this coupon: **mvp2021**
The last time I made Python 101 free for 3 days, I got 30-40,000 new readers. Let's see if we can beat that!
The second edition of **Python 101** is completely rewritten from the ground up. In this book, you will learn the Python programming language and lots more.
This book is split up into four sections:
1. The Python Language
2. Intermediate Topics
3. Creating Sample Applications
4. Distributing Your Code
Check out [Leanpub](https://leanpub.com/py101/c/mvp2021) or [Gumroad](https://gumroad.com/l/pypy101) for full details on what all is in the book.
I have several other Python books, so if you like Python 101, you should check out my other works:
* [Pillow: Image Processing with Python](https://www.kickstarter.com/projects/driscollis/image-processing-with-python)
* [Creating GUI Applications with wxPython](https://leanpub.com/creatingapplicationswithwxpython/)
* [Jupyter Notebook 101](https://leanpub.com/jupyternotebook101/)
* [ReportLab: PDF Processing with Python](https://leanpub.com/reportlab)
* [Python 201: Intermediate Python](https://leanpub.com/python201)
Or just check
/r/Python
https://redd.it/kv5iby
**Python 101 2nd Edition** is the latest version of Python 101. This book is meant to help you learn Python and then go beyond the basics. I've always felt that a beginner's book should teach more than syntax. If you'd like to try out Python 101, you can do so for **FREE** for the next 72 hours by using the following link: [https://leanpub.com/py101/c/mvp2021](https://leanpub.com/py101/c/mvp2021)
If you have a Gumroad account, you can get the book here ([https://gumroad.com/l/pypy101](https://gumroad.com/l/pypy101)) for free using this coupon: **mvp2021**
The last time I made Python 101 free for 3 days, I got 30-40,000 new readers. Let's see if we can beat that!
The second edition of **Python 101** is completely rewritten from the ground up. In this book, you will learn the Python programming language and lots more.
This book is split up into four sections:
1. The Python Language
2. Intermediate Topics
3. Creating Sample Applications
4. Distributing Your Code
Check out [Leanpub](https://leanpub.com/py101/c/mvp2021) or [Gumroad](https://gumroad.com/l/pypy101) for full details on what all is in the book.
I have several other Python books, so if you like Python 101, you should check out my other works:
* [Pillow: Image Processing with Python](https://www.kickstarter.com/projects/driscollis/image-processing-with-python)
* [Creating GUI Applications with wxPython](https://leanpub.com/creatingapplicationswithwxpython/)
* [Jupyter Notebook 101](https://leanpub.com/jupyternotebook101/)
* [ReportLab: PDF Processing with Python](https://leanpub.com/reportlab)
* [Python 201: Intermediate Python](https://leanpub.com/python201)
Or just check
/r/Python
https://redd.it/kv5iby
Leanpub
Python 101
Python 101 teaches you the basics of Python, how to write multiple prototype applications and how to distribute your code
Open sourcing Django project of my 2 years of failed entrepreneurship
I had built an Options/Derivatives trading platform for Indian stock market. Learned both Python and Django as I built it. So tonnes of bad practices 🙂. But its still a relatively complex product which uses -
​
Celery for backround caculation every 10 seconds
Redis for caching real time calculations
PostreSQL for database
Ctypes for faster calculation
/r/django
https://redd.it/kv5sgd
I had built an Options/Derivatives trading platform for Indian stock market. Learned both Python and Django as I built it. So tonnes of bad practices 🙂. But its still a relatively complex product which uses -
​
Celery for backround caculation every 10 seconds
Redis for caching real time calculations
PostreSQL for database
Ctypes for faster calculation
/r/django
https://redd.it/kv5sgd
GitHub
TrakBit/Option-Trading-Backend
Contribute to TrakBit/Option-Trading-Backend development by creating an account on GitHub.
A Complete Guide to Testing Python Applications with Pytest
https://stribny.name/blog/pytest/
/r/Python
https://redd.it/kv92km
https://stribny.name/blog/pytest/
/r/Python
https://redd.it/kv92km
stribny.name
Testing Python Applications with Pytest
A complete guide to testing Python applications with Pytest, pytest plugins and other test libraries.
Running .ipynb files stored in a server folder on local machine without downloading the scripts to local machine
Has anyone had success running .ipynb files that are saved on a server on their local machine without downloading them all to your local machine?
/r/JupyterNotebooks
https://redd.it/kvbins
Has anyone had success running .ipynb files that are saved on a server on their local machine without downloading them all to your local machine?
/r/JupyterNotebooks
https://redd.it/kvbins
reddit
Running .ipynb files stored in a server folder on local machine...
Has anyone had success running .ipynb files that are saved on a server on their local machine without downloading them all to your local machine?
Tuesday Daily Thread: Advanced questions
Have some burning questions on advanced Python topics? Use this thread to ask more advanced questions related to Python.
If your question is a beginner question we hold a beginner Daily Thread tomorrow (Wednesday) where you can ask any question! We may remove questions here and ask you to resubmit tomorrow.
This thread may be fairly low volume in replies, if you don't receive a response we recommend looking at r/LearnPython or joining the Python Discord server at https://discord.gg/python where you stand a better chance of receiving a response.
/r/Python
https://redd.it/kvfm16
Have some burning questions on advanced Python topics? Use this thread to ask more advanced questions related to Python.
If your question is a beginner question we hold a beginner Daily Thread tomorrow (Wednesday) where you can ask any question! We may remove questions here and ask you to resubmit tomorrow.
This thread may be fairly low volume in replies, if you don't receive a response we recommend looking at r/LearnPython or joining the Python Discord server at https://discord.gg/python where you stand a better chance of receiving a response.
/r/Python
https://redd.it/kvfm16
Discord
Join the Python Discord Server!
We're a large community focused around the Python programming language. We believe that anyone can learn to code. | 412982 members
VirtualPianoBot, a virtual piano bot player that can play (virtually) any song!
https://github.com/azh412/VirtualPianoBot
/r/Python
https://redd.it/kvh78s
https://github.com/azh412/VirtualPianoBot
/r/Python
https://redd.it/kvh78s
GitHub
GitHub - azh412/VirtualPianoBot: A virtual piano player that you can train to play different songs, as well as the built-in songs.
A virtual piano player that you can train to play different songs, as well as the built-in songs. - azh412/VirtualPianoBot
2 AI's Playing Tag Made In Python
I made my first visual machine learning piece today in python. I used 2 neural nets for each agent, one for vision and one for movement. The black agent chases the green agent.
GIF:
https://media.giphy.com/media/Bt2LjoHoWnrlR4RdVn/giphy.gif
https://media.giphy.com/media/96zqCL5Ac2f7POiAPQ/giphy.gif
/r/Python
https://redd.it/kvf62e
I made my first visual machine learning piece today in python. I used 2 neural nets for each agent, one for vision and one for movement. The black agent chases the green agent.
GIF:
https://media.giphy.com/media/Bt2LjoHoWnrlR4RdVn/giphy.gif
https://media.giphy.com/media/96zqCL5Ac2f7POiAPQ/giphy.gif
/r/Python
https://redd.it/kvf62e
GIPHY
Animated GIF - Find & Share on GIPHY
Discover & share this Animated GIF with everyone you know. GIPHY is how you search, share, discover, and create GIFs.