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
Anyone open to Flask "chatting" with me?

I realize maybe this is a bit desperate, but I really don't know how else to approach this. I feel like I've hit a wall when it comes to Flask/Python. I'm a beginner and have maybe been learning for just a few short months when it comes to both Python and Flask. I created a little GUI project using Tkinter I'm very proud of then immediately discovered Flask and have been obsessed ever since. Creating webpages is the coolest thing ever, and Flask lets me do it in a language I love using.

The thing I'm missing is a Yoda. I have struggled through tutorial after tutorial and learned so much, but at a certain point I feel like if you can't openly communicate to ask basic questions, google can only do so much for you. My goal for ever since I picked up Flask has been relatively basic. All I've wanted to create is a Flask website that displays a table, read from SQLite (maybe later converted to MySQL) that then lets an authenticated user (username and password) look at and modify records for computer assets (i.e. machine name, serial, mac). I have literally gone through dozens of tutorials

/r/flask
https://redd.it/lh1c42
D Why did it took 3 years to use transformers in computer vision ?

When reading An image is worth 16\*16 words, its seems like a quite straight-forward adaptation of the transformer architecture : the main thing they changed was breaking the image into 16*16 patches so that it reduces the n² cost of computing self-attention.

I'm thus wondering why did it take 3 years to apply transformers to computer vision ?

/r/MachineLearning
https://redd.it/lh7iwp
D DL Surveyception: a survey of overviews, reviews and surveys in deep learning for computer vision, time-series, GANs, transformers, and others. I went through a total of 29 papers published in the last 4 years, with 15 since last year, and prepared slides summarizing what I learned from them.

https://hackmd.io/@arkel23/deeplearning\_surveyception

This is a densely packed review of reviews in different areas of deep learning including computer vision, time-series, GANs, transformers, not fully-supervised learning schemes, and others. I think it could be great as a starting point for discussion on recent advances in the field, and identifying long and short-term trends in the literature.

It's not for everyone since I use quite a few acronyms and abbreviations, and some of the slides are extremely packed in information. The idea was to include as much content as possible in a small amount of space, kind of like a cheatsheet, a personal one to compress everything I had learned; one small package to which I could always go back to when needing direction.

However, maybe someone, who like me is looking for a topic to delve deeper into, can also use this as a starting point to understand and get a general idea of how different areas of deep learning have been developing in the past years. And maybe, find something among the many topics that interests you, and which you can delve deep into.

/r/MachineLearning
https://redd.it/lh17d5
Restrict access to a url unless user is coming from a certain page

For example the user won't be able to access page 'b' unless they are coming from page 'a' (they can't just paste the link and go to the page)


Edit: I'm using django views to reset password and I don't want the user to be able to access the final page (success page) if he haven't actually changed his password


Any source/documentation/videos would be appreciated

/r/django
https://redd.it/lhe2gy
Thursday Daily Thread: Python careers!

Discussion of using Python in a professional environment, getting jobs in Python and more!

This thread is not for recruitment, please see r/PythonJobs or the thread in the sidebar for that.

/r/Python
https://redd.it/lh7r9e
R One-Shot Medical Image Segmentation using Deformable Registration Networks

Hello guys! Check out this article I've just published explaining how deep deformable registration networks can help us perform one-shot medical image segmentation!

Feedback welcome!
https://www.sicara.ai/blog/one-shot-medical-image-segmentation

/r/MachineLearning
https://redd.it/lguvk5
P Japanese genetic algorithm experiment to make a "pornographic" image

I don't have anything to do with this project myself, I've just been following it because I found it interesting and figured I'd share.

This guy made a project where anyone is welcome to look at two images and choose which one they think is more "pornographic" to train the AI. There isn't really a goal, but it started out with the guy saying that the project "wins" when Google Adsense deems the image to be pornographic.

The project "won" today with the 11225th iteration getting Google to limit the Adsense account tied to the project. That being said it's still ongoing.

You can also take a look at all previous iterations of the image here

I wouldn't consider the current version to be NSFW myself as it's still pretty abstract but YMMV (Google certainly seems to think differently at least)

/r/MachineLearning
https://redd.it/lhhe8e
D What do people use machine learning for at home?

Very new to posting anywhere so I'm sorry if questions like these aren't allowed.

I have been wondering this for a long time. I see questions on many machine learning and data science and build a PC subreddits asking about hardware requirements for machine learning projects at home. Some talk about training neural networks and lots of other things. This is coming from someone who is learning about the field and does not know much so please don't be hostile.

Why do people spend so much money to build extremely powerful machines to use at home for machine learning that is not work related? What kind of machine learning do they do? Is it only a hobby? Only learning? Do people make money with these projects? How do they do that? I am a software engineer very interested in hearing what the deal is and trying to learn the ropes on my own. Thanks for taking the time.

/r/MachineLearning
https://redd.it/lhh7mb
I made a Python app to prevent my dad from knowing if I am playing video games with Python and Flutter

I have a 5+ years experience in python and 2+ years in Flutter. I recently made an app that I installed in my and my dad's phone and set my home and dad's office location inside of it. I programmed it in a way that it notifies me when dad leaves office and when he is almost home. I can just close my video game and open up my school project then.

I used Flutter for the UI and Python for the backend, like sending notifications. I haven't posted it to github yet as I want it to have a lot more features before I do so.

However, I will post the current version depending on the response this post gets. This is the best project I made so far to help myself, and I am proud of it !

​

Edit 1 - Thanks for telling me that it's illegal, I ended up uninstalling the app from my dad's phone. And sure enough the app wouldn't have this feature if I release it to the playstore.

/r/Python
https://redd.it/lhksqe
Python turns 30 this month😎

Python was created by Guido van Rossum, and first released on February 20, 1991.

/r/Python
https://redd.it/lhm3pm
Why do I need to restart the script everytime I revisit the URL?

Hello reddit!

​

I am making a site where it reads the given video footage and decrypts a data and if the data is correct redirects to another URL.

@app.route("/scanner")
def scanner():
qrcodeReader.qrreader()
if (qrcodeReader.result == "authorized") and (qrcodeReader.loginCode != "004"):
print(qrcodeReader.loginCode)
return redirect(url_for("login"))
elif (qrcodeReader.result == "authorized") and (qrcodeReader.loginCode == "004"):
print(qrcodeReader.loginCode)
return redirect(url_for("admin"))
else:
return redirect(url_for("error"))

This is the code that I am using to read the video capture and redirect to another URL.
Now everytime I re-visit this URL I get this error: " TypeError: cannot unpack non-iterable NoneType object " . But when I restart the script and revisit this URL the problem goes away. How can I

/r/flask
https://redd.it/lhlt93
Friday Daily Thread: Free chat Friday!

Use this thread to talk about anything Python related! Questions, news, projects and any relevant discussion around Python is permitted!

/r/Python
https://redd.it/lhyl7i
Django and Stripe Payments Tutorial

Hey everyone!

I hope you're all doing well.

I've written a tutorial on how to integrate Stripe Payments and Django.

The aim of the tutorial is to create a basic way to sell access to a digital product. Things like e-books, PDFs, Notion templates, Airtable databases, etc.

A while ago I set up a landing page for a new product and used Stripe Checkout to handle payments. It's actually crazy how using just these two technologies you can sell your own product so easily.

You can find the written version here:

https://justdjango.com/blog/django-stripe-payments-tutorial/

Or you can watch it on YouTube:

https://www.youtube.com/watch?v=722A27IoQnk&ab\_channel=JustDjango

As always, I hope you enjoy it and love to hear your feedback!

/r/django
https://redd.it/lhsqh1
Noob question. Is it better to build your whole app in Flask or can one separate the Front-End entirely from Flask and use it for connecting the database and the Front- End.

What are the advantages and disadvantages of both? Which one is simple and/or better?

/r/flask
https://redd.it/lhvodd
Prelaunch: Definite Guide to Django and Webpack

## Background

For many people, it is not easy to make Django work with modern frontend tech, such as ES6, SCSS.

If we check online, many blog posts and tutorials are from view of frontend (such as building Single-page application), which might not work very well if we want to put JS, CSS files in Django template.

What is more, popular Django boilerplate projects on Github (such as cookiecutter-django) are still using a little outdated frontend tech (gulp workflow).

This is a PAIN, so I decide to help people solve it!

## Why Webpack

1. Webpack is the most popular bundle solution in the frontend community today, it has received 50k stars on Github.
1. It has a great ecosystem, many plugins, loaders. If we search webpack on npmjs.com, we can get 20k resulst.
1. If we do not need React, Vue, we can still use Webpack to help us compile ES6, SCSS and do many other things (Many people do not know that!)
1. With a proper config, Webpack can save time and let us build modern web application in quick way.

## Benefits

1. We can still use Django template syntax and HTML as we are familiar with
1. We do not need DRY (Django REST framework) and similar frameworks

/r/django
https://redd.it/lhga2u
Typos

Anyone ever go through hell because of a typo?
I kept getting a 'No Reverse Match with blah blah arguments' error.
I had this same error a few months ago and my problem was that I didnt configure my urls properly. So obviously I thought that was my problem again, but noo that didnt fix the issue.
So after about 4-5 hours of reading documentation and rebuilding my app with function based views. I finally decided to ask the question on stack overflow. Only to have someone point out that I pluralizes the context name in the view but not in my template...
I'm just a hobbyist and I'm fairly new to programming in General and I'm just wondering if anyone else had this sort of brain fart before.

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