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 made a terminal-based presentation tool with colors and effects!

Hey everyone, I made `present` which is a terminal-based presentation tool with some extra goodies! You can write slides using Markdown (I also plan to add Jupyter notebook support) and also play codios (pre-recorded playable code blocks) which can be useful for live demos! Here's the [code on Github](https://github.com/vinayak-mehta/present). And here's a demo:

​

https://i.redd.it/ei6flui6i5k51.gif

/r/Python
https://redd.it/ijdmca
Monday megathread: 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/ijnjcu
Django and react

Hi there,

I'm a senior ruby developer who is now working on a fair big project made in django.

With ruby on rails there are many ways to integrate a react project inside the common views and I'd like to know what's the best practice within the django community?

​

I don't want to move everything on react because just a small part of the project really need it and moving everything to react would mean an heavy rewriting.

/r/django
https://redd.it/ijvuz0
[D] Simple Questions Thread August 30, 2020

Please post your questions here instead of creating a new thread. Encourage others who create new posts for questions to post here instead!

Thread will stay alive until next one so keep posting after the date in the title.

Thanks to everyone for answering questions in the previous thread!

/r/MachineLearning
https://redd.it/ijkivz
Tuesday megathread: 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 megathread tomorrow (Wednesday) where you can ask any question! We may remove questions here and ask you to resubmit tomorrow.**

/r/Python
https://redd.it/ik9o9r
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