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
I learned how to make an online Multiplayer game using Python!!

I am interested in game development but am very new to it. I've messed around with unity and C# for a bit but decided I wanted to learn how to create an online multiplayer game like Agario or Draw my things. I decided to use Python since it is my favorite language!

The whole process was pretty difficult. I had to learn to make web apps (flask), web sockets (socketio), manage databases, and a bunch of other stuff.

[If you are interested in the process or want to see how it turned out, check out my video here!](https://www.youtube.com/watch?v=DrYXpVLQY_E)

Thanks

/r/Python
https://redd.it/ii1tnj
[R] Extended blog post on "Hopfield Networks is All You Need"

My colleague Johannes Brandstetter wrote an awesome blog post on our new paper "Hopfield Networks is All You Need": [https://ml-jku.github.io/hopfield-layers/](https://ml-jku.github.io/hopfield-layers/)

It illustratively introduces traditional, dense, and our modern Hopfield neworks, and provides explained code examples of the Hopfield layer.

Highly recommended!

/r/MachineLearning
https://redd.it/ii319z
PyWeek 30 starts on the 20th September!

***PyWeek 30 will begin on the 20th September (00:00 UTC) and end on the 27th September (00:00 UTC).***

# What is PyWeek?

PyWeek is one of the longest running events in the Python community – it's been run twice a year for the past 15 years! During the jam, competitors are given a theme which is decided by the community through a vote. You must build a game from scratch in a week using Python that relates to this theme. After the jam, your fellow competitors vote on submissions to decide a winner. You can see hundreds of previous submissions to PyWeek at [https://pyweek.org/all\_games/](https://pyweek.org/all_games/)

# How can I join?

You can enter PyWeek as an individual or as a team. If you are looking for teammates, you can find fellow PyWeekers in #pyweek on [Python Discord](https://discord.gg/python)! If you want to compete in PyWeek, check out the information on the PyWeek website at [https://pyweek.org/](https://pyweek.org/), you need to register with this site before September 27th (00:00 UTC) in order to participate!

# Where can I find out more?

You can find all the necessary rules and documentation at [https://pyweek.readthedocs.io/](https://pyweek.readthedocs.io/). There are no restrictions on what game library you use as long as the game logic is written in

/r/Python
https://redd.it/ii5r6d
Build Your Own Flight Tracking Application with Python and Open Air Traffic Data

I wrote a tutorial how to build a flight tracking application with Python and Open Air Traffic Data from OpenSky Network. Check out the tutorial and the code.

[https://www.geodose.com/2020/08/create-flight-tracking-apps-using-python-open-data.html](https://www.geodose.com/2020/08/create-flight-tracking-apps-using-python-open-data.html)

[filght tracking application](https://i.redd.it/vg1z387kzpj51.gif)

/r/Python
https://redd.it/ii4oga
APIs.

I recently joined as a Intern in a company mainly assisting in Back End. Now, last day, my frontends developers came to me and asked me to provide the Api . So, does that mean I should be providing all the codes that I have written for APis.?? I developed simple apis using serialization of some models. Now, I should provide the source code and endpoints to that frontend developer? I mean cant he looked into my Github and download the code? I am totally lost.

/r/django
https://redd.it/ii3isd
[News] Apple's AI/ML Residency Program

Apple just announced it's new AI/ML residency program! More details about the program can be found at [https://machinelearning.apple.com/updates/introducing-aiml-residency-program](https://machinelearning.apple.com/updates/introducing-aiml-residency-program). The program is available in multiple locations -- details [here](https://jobs.apple.com/en-us/search?search=%23aimlresidency&sort=relevance).

I'm an ML engineer at Apple Special Projects Group (SPG) in the Applied ML team led by Ian Goodfellow, and I'll be a resident host for this program. To apply to work on my team, please check out [https://jobs.apple.com/en-us/details/200175569/ai-ml-residency-program?team=MLAI](https://jobs.apple.com/en-us/details/200175569/ai-ml-residency-program?team=MLAI).

/r/MachineLearning
https://redd.it/ii18ae
Why Django and Not...

Hey all, I work for a company that's considering a major redo of their e-commerce platform. We're considering a bunch of frameworks for this: Rails, Laravel, Django, and Node. So I thought I'd ask the community here what would be some good reasons for Django over these others? Thanks so much in advance. :)

/r/django
https://redd.it/iiaelg
I created a webapp for generating mock data
https://www.mockerdata.com/

/r/flask
https://redd.it/iiadxc
How to run all cells?

I tried to create a keyboard shortcut for it, but it doesn't work...

​

https://preview.redd.it/l0kzylrsyij51.png?width=879&format=png&auto=webp&s=c6309c76b35effba03f903480745af5d4a245010

/r/JupyterNotebooks
https://redd.it/ihitfy
This post has

961 upvotes,

197 downvotes,

and 125 comments!

Credit to u/Krukerfluk and Tom Scott!

Code: https://github.com/CalvinMiller190/reddit-post

This post uses the [praw module](https://praw.readthedocs.io/en/latest/) to get the information about the post, then edits the post every second based on the information that it got!

/r/Python
https://redd.it/iiamfv
Saturday megathread: Share your resources!

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/iiihwe
Is it worthy to use frontend framework like react or vue with Django?

Django comes up with DTL which has enough power to create pretty much everything.

But in the world full of JS frameworks I'd like to know is there any benefit if using javascript frontend frameworks along with Django?

Also give some use cases!

/r/django
https://redd.it/iilow7
NOT NULL constraint failed: mysite_customer.created_at.

I am getting this NOT NULL error when I try to submit data to my database from a default form ModelForm. My customerform is as follows: Please help!

​

def customerform(request):
if request.method == **'POST'**:
form = CustomerForm([request.POST](https://request.POST))
if form.is\_valid():
created\_at = request.POST.get(**"Created\_at"**, **''**)
name = request.POST.get(**"Name"**, **''**)
address = request.POST.get(**"Address"**, **''**)
Cell\_no = request.POST.get(**"Cell\_no"**, **''**)
*# image = models.ImageField(upload\_to='blog')*
description = request.POST.get(**"Description"**, **''**)
cust\_info= Customer( name = name,address = address,Cell\_no = Cell\_no, description =
description)
cust\_info.save()
return redirect(**'customerform'**)

/r/django
https://redd.it/iipgn9
Can't access image from media loaction

Hello ,

I configured media location to keep images (like several times already) for a project i am currently working on.

just to add that current project i am using on top of [Django Dashboard AdminLTE](https://github.com/app-generator/django-dashboard-adminlte)

In addition i extended the user properties for user image , when i upload the user related image its loading correctly to the path designated , but when i using in HTML tag to show current user image , don't get anything html tag is

 <img src="{ request.user.profile_image.url }" class="img-circle elevation-2" alt="User Image">

When i click show image its seems to follow the correct path but i get error that pic not found

I posted below my [settings.py](https://settings.py) and main [urls.py](https://urls.py) below , i run out of idea

Please advice

Thanks

&#x200B;

https://preview.redd.it/ih2hbf1drwj51.jpg?width=674&format=pjpg&auto=webp&s=b74440430e9e6602ba254d34c43b87a284ab92f6

the settings file is looks like following

# SECURITY WARNING: don't run with debug turned on in production!

DEBUG = config('DEBUG', default=False)

BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
 Static files (CSS, JavaScript, Images)
 https://docs.djangoproject.com/en/1.9/howto/static-files/
STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles') STATIC_URL = '/static/'
 Extra places for collectstatic to find static files.
STATICFILES_DIRS = (     os.path.join(BASE_DIR, 'core/static'), )
#######################################################
#######################################################


/r/django
https://redd.it/iipg83
Configure environment-specific settings in Django framework.

Wrote a short blog on implementing environment-specific settings in Django Framework. Hope this will be useful!

[https://thequickblog.com/how-to-configure-environment-specific-settings-in-python-django-framework/](https://thequickblog.com/how-to-configure-environment-specific-settings-in-python-django-framework/)

/r/django
https://redd.it/iip1eq
Tasks - is APScheduler better than Cron/Schedule modules?

I want the best one to automate a task, my function makes an API call every 15 minutes and saves data to csv and then calculates that CSV data to show on a chart. What task module would be the best in my case? APScheduler/Cron/Schedule/Celery?

PS: I'll be deploying to Heroku, so I'd appreciate anyone telling me about compatibility issues with Heroku.

/r/flask
https://redd.it/iiu14x