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
My First GUI Application

I know it's not anything special, but GUIs have always been one of my biggest weaknesses. I haven't had any good projects to show off because whenever I get to the point where I need a GUI, I get discouraged and start working on a different project. I finally sat down and forced myself to learn Pygame this past week and today I spent the whole day coding up this beauty.

Okay, maybe it's not that beautiful, but you've gotta start somewhere. I busted my ass making this thing all day and I'm damn proud of it. Hope you all like it too =)

https://reddit.com/link/ikbcaz/video/6d3qy2hpyfk51/player

/r/Python
https://redd.it/ikbcaz
I created a collection of notebooks related to Computer Vision.

Hi everyone!

I have been putting together all my personal stuff of everything related to **Computer Vision** and organizing them in a collection of *python notebooks* as neat as possible. (I am always updating this project with new content)

I hope someone find it useful.

Link to the collection page: [Computer Vision Notebooks](https://diegoinacio.github.io/computer-vision-notebooks/)

​

https://preview.redd.it/9c3yddh77fk51.png?width=1280&format=png&auto=webp&s=8fc79b63f8312bb7b99d80a27e2a8046fc017bc3

/r/Python
https://redd.it/ik91eq
Django Channels - Is better to isolate the WebSocket Server?

So I have a Django application with React front-end through an API (django-restframework) and I would like to implement some websocket action (real time events) with Django Channels, is it better to create another server, just to websocket connections or integrate all in one application? I know it would change to ASGI, but don't know what it can causes or malfunction with HTTP connections after that. Thanks in advance.

/r/django
https://redd.it/ikkcm0
What are best options for pure Flask API schema UI

I am using flask for making an API with various endpoints so I wonder how to showcase my API beautifully documented as I don't plan on developing frontend for it.
I am avoid hight level extensions for the restful endpoints functionalities as I am trying to learn more about what's going under the hood.
So, I wanna use an extension only for schema UI generation and I wonder what are the best options there !

/r/flask
https://redd.it/ikh5u7
URL not found

Hey!

I've just started my first problem and I've run into a problem. I get a 404 when trying to run the given code with the given template. Does anyone see the issue?

https://preview.redd.it/0uprbg4e2kk51.png?width=434&format=png&auto=webp&s=0dcfe3ed359fb97248e1d960d849585ab02e6273

https://preview.redd.it/7fmbxk4e2kk51.png?width=545&format=png&auto=webp&s=96227087d1981dce3b99d92a09eba237e65b8678

The issue occured when I added {content} (i have no idea how this is called) in the html file.

/r/flask
https://redd.it/ikn4z3
HW help

Hey there,

I'm taking a programming class (zero experience with programming) as an elective and ran into some difficultly. My professor is asking to me to use the quadratic formula by plunging in the values given. For some context, leading up to this assignment we have discussed f strings, different types of print functions, and conversion functions. I'm not asking for someone to just give me the necessary code language, but rather hints and clues so I can figure it out on my own. I find programming really interesting and I want to be able to nail the fundamentals.

/r/IPython
https://redd.it/ikwww2
Class 'builtins.list' is not mapped

@seller_bp.route('/dashboard/products/', methods=['GET'])
def product_page():
return render_template('/seller/products.html', message=get_flashed_messages(), products=Products().queryProducts('sellerID', current_user.get_id()))

@seller_bp.route('/dashboard/delete/product/<productID>', methods=['GET'])
def delete_product(productID):
Products().delete(productID)
ProductDelivery().delete(productID)

flash('Product Deleted')
return redirect(url_for('seller_bp.product_page'))

def delete(self, productID):
query = self.query.filter_by(productID=productID).all()
for item in query:
db.session.delete(query)
db.session.commit()

It deletes the product(s) from the database. However it returns an error of:

`sqlalchemy.orm.exc.UnmappedInstanceError: Class 'builtins.NoneType' is not mapped`

I can't figure out what is causing this error

/r/flask
https://redd.it/ikmy45
Wednesday megathread: Beginner questions

New to Python and have questions? Use this thread to ask anything about Python, there are no bad questions!

/r/Python
https://redd.it/ikw1d1
installed pillow but still get ( users.Profile.image: (fields.E210) Cannot use ImageField because Pillow is not installed) eror

&#x200B;

https://preview.redd.it/9qqa6blxjnk51.png?width=1366&format=png&auto=webp&s=5e77546028639cfdaf901d8f53500dfce42987de

for makemigrations it needed to install pillow ( for ImageFiled) and i installed but i get the same eror , anyone knows solution?

&#x200B;

&#x200B;

EDIT : i solved it myself . apparently pillow didn't isntalled so i used comamnd and ran cmd and i installed it there .

/r/django
https://redd.it/ikz51w
[D] Machine Learning - WAYR (What Are You Reading) - Week 94

This is a place to share machine learning research papers, journals, and articles that you're reading this week. If it relates to what you're researching, by all means elaborate and give us your insight, otherwise it could just be an interesting paper you've read.

Please try to provide some insight from your understanding and please don't post things which are present in wiki.

Preferably you should link the arxiv page (not the PDF, you can easily access the PDF from the summary page but not the other way around) or any other pertinent links.

Previous weeks :

|1-10|11-20|21-30|31-40|41-50|51-60|61-70|71-80|81-90|91-100|
|----|-----|-----|-----|-----|-----|-----|-----|-----|------|
|[Week 1](https://www.reddit.com/4qyjiq)|[Week 11](https://www.reddit.com/57xw56)|[Week 21](https://www.reddit.com/60ildf)|[Week 31](https://www.reddit.com/6s0k1u)|[Week 41](https://www.reddit.com/7tn2ax)|[Week 51](https://reddit.com/9s9el5)|[Week 61](https://reddit.com/bfsx4z)|[Week 71](https://reddit.com/d7vno3)|[Week 81](https://reddit.com/f1f0iq)|[Week 91](https://reddit.com/hlt38o)||||||||
|[Week 2](https://www.reddit.com/4s2xqm)|[Week 12](https://www.reddit.com/5acb1t)|[Week 22](https://www.reddit.com/64jwde)|[Week 32](https://www.reddit.com/72ab5y)|[Week 42](https://www.reddit.com/7wvjfk)|[Week 52](https://reddit.com/a4opot)|[Week 62](https://reddit.com/bl29ov)|[Week 72](https://reddit.com/de8h48)|[Week 82](https://reddit.com/f8fs6z)|[Week 92](https://reddit.com/hu6zq9)||
|[Week 3](https://www.reddit.com/4t7mqm)|[Week 13](https://www.reddit.com/5cwfb6)|[Week 23](https://www.reddit.com/674331)|[Week 33](https://www.reddit.com/75405d)|[Week 43](https://www.reddit.com/807ex4)|[Week 53](https://reddit.com/a8yaro)|[Week 63](https://reddit.com/bqlb3v)|[Week 73](https://reddit.com/dkox1s)|[Week 83](https://reddit.com/ffi41b)|[Week 93](https://reddit.com/iaz892)||
|[Week 4](https://www.reddit.com/4ub2kw)|[Week 14](https://www.reddit.com/5fc5mh)|[Week 24](https://www.reddit.com/68hhhb)|[Week 34](https://www.reddit.com/782js9)|[Week 44](https://reddit.com/8aluhs)|[Week 54](https://reddit.com/ad9ssz)|[Week 64](https://reddit.com/bw1jm7)|[Week 74](https://reddit.com/dr6nca)|[Week 84](https://reddit.com/fn62r1)||
|[Week 5](https://www.reddit.com/4xomf7)|[Week 15](https://www.reddit.com/5hy4ur)|[Week 25](https://www.reddit.com/69teiz)|[Week 35](https://www.reddit.com/7b0av0)|[Week 45](https://reddit.com/8tnnez)|[Week 55](https://reddit.com/ai29gi)|[Week 65](https://reddit.com/c7itkk)|[Week 75](https://reddit.com/dxshkg)|[Week 85](https://reddit.com/fvk7j6)||
|[Week 6](https://www.reddit.com/4zcyvk)|[Week 16](https://www.reddit.com/5kd6vd)|[Week 26](https://www.reddit.com/6d7nb1)|[Week 36](https://www.reddit.com/7e3fx6)|[Week 46](https://reddit.com/8x48oj)|[Week 56](https://reddit.com/ap8ctk)|[Week 66](https://reddit.com/cd7gko)|[Week 76](https://reddit.com/e4nmyk)|[Week 86](https://reddit.com/g4eavg)||
|[Week 7](https://www.reddit.com/52t6mo)|[Week 17](https://www.reddit.com/5ob7dx)|[Week 27](https://www.reddit.com/6gngwc)|[Week 37](https://www.reddit.com/7hcc2c)|[Week 47](https://reddit.com/910jmh)|[Week 57](https://reddit.com/auci7c)|[Week 67](https://reddit.com/cj0kyc)|[Week 77](https://reddit.com/eb4lxk)|[Week 87](https://reddit.com/gcx3uf)||
|[Week 8](https://www.reddit.com/53heol)|[Week 18](https://www.reddit.com/5r14yd)|[Week 28](https://www.reddit.com/6jgdva)|[Week 38](https://www.reddit.com/7kgcqr)|[Week 48](https://reddit.com/94up0g)|[Week 58](https://reddit.com/azjoht)|[Week 68](https://reddit.com/cp1jex)|[Week 78](https://reddit.com/ehbfst)|[Week 88](https://reddit.com/glm6sv)||
|[Week 9](https://www.reddit.com/54kvsu)|[Week 19](https://www.reddit.com/5tt9cz)|[Week 29](https://www.reddit.com/6m9l1v)|[Week 39](https://www.reddit.com/7nayri)|[Week 49](https://reddit.com/98n2rt)|[Week 59](https://reddit.com/b50r5y)|[Week 69](https://reddit.com/cvde5a)|[Week 79](https://reddit.com/entcxy)|[Week 89](https://reddit.com/gu5t0d)||
|[Week 10](https://www.reddit.com/56s2oa)|[Week
PostgreSQL with Flask-SQLAlchemy Security - '?' Sign

So in a databases like SQlite3 we use the following to avoid SQL Injection

`select * from database WHERE column = ?`

What is the equivalent for it while using SQLAlchemy?

Is something like this acceptable while using PostgreSQL with SQLAlchemy?

`table.query.filter_by(column = ?)`

/r/flask
https://redd.it/ikox1t
All You Need to Know about WSGI

Hi!

Here is a [screencast](https://www.youtube.com/watch?v=UklcIDgHtwQ) \- Titled All You Need to Know about WSGI. It is my informal way of explaining what is WSGI. This screencast used to be paid, but I will release all PRO lessons for free, since I am busy with my main project - [Papermerge](https://www.papermerge.com) (<- Django based free and open source document management system).

Thank you Django community for fantastic support, I really love Python, Django and your community in general!

/r/django
https://redd.it/il2qfw
Editing Unicode text in a notebook

I am currently transcribing a lot of audio files which are in a remote server. I use IPython audio to listen to them in the browser and loop over them

I want to be able to see and edit the text on that notebook too. I installed a keyboard for my local language on my computer.
Is there a better method instead of using an input method, more like a built-in text editor so I can do editing in the browser?

It's a huge hassle to switch between screens and I want to do it all in a browser.

Edit: It has to support Unicode.

Thank you!

/r/IPython
https://redd.it/ikmpmt
Is there a full on boilerplate for flask development?

I’m been working on a project where I done most of the front end but can’t seem to really optimize the backend as I’m new and still getting into flask. Is there a possibility that a boilerplate exists and I can just plug everything in? The only hard part in my website is receiving data from a form and storing it in SQLite, other than that everything else is static and super simple! Thanks in advance guys.

/r/flask
https://redd.it/il31va
ALT key Menu commands

Hi, do ALT key menu commands work somehow? For example, ALT+F for the "File" menu, ALT+E for the "Edit" menu, and so on.
I've searched to no avail, so I just want to make sure I'm not missing something easy. Thanks!

/r/JupyterNotebooks
https://redd.it/il6u5c
How to deal with compromised user accounts?

Hi guys,

I'm taking care of a Django applications. It's a fairly large application, it's a social network. The application staff reported compromised user accounts posting porn spam. There are at least 1100 accounts posting spam.

I'm getting this kind of messages on the comment comments section:

¡Las chicas jóvenes y hermosas quieren conocerte! El mejor sitio de citas sexuales gratis! entra y únete http://sexdating.webjx.site

How to deal with this kind of problem?

/r/django
https://redd.it/il8ph4
Accessing Windows located Firebird Database from Docker contained Django

I am trying to access Firebird Database files located in C:/ drive from Docker Contained Django Application.
I am using Python fdb package for accessing this.

self.conn = fdb.connect( host='192.168.0.108', port=3050, database='/FIREBIRD_DB/TEST.FDB', user=usr, password=pswd
)

It generates error:
Exception: The location of Firebird Client Library could not be determined.


Deseperately looking for help on how can i access the firebird database. Thanks in advance

/r/django
https://redd.it/ilcyv0