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
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/lfpln1
Writing a book on autonomous quadcopter projects? Latex vs Jupyter Book?

Hi, So I finished my masters in computer science with a focus on deep learning and computer vision. Now I want to write a book showcasing some useful and popular things in this field. Here's a small list of libraries that I use in some chapters:

1. Eigen (3D geometry, Linear algebra)
2. Sophus (3D geometry, Lie algebra)
3. Ceres Solver (3D geometry)
4. ROS (Robotics software)
5. OpenCV (computer vision)
6. Tensorflow (deep learning)
7. Pandas, numpy, matplotlib (Data science)

I want to explore concepts in papers and showcase examples and projects which use these libraries. In Latex, I can simply add a code block in `listing` environment. But I want the code to be executable so that users can try it out themselves. Can the top 4 libraries be used along with Jupyter book so that the code I specify (which is written in C++ 14 btw, not python) is executable? These libraries are installed natively and not in a conda (or virtual) environment.

/r/JupyterNotebooks
https://redd.it/lg0exy
Is there a way for Django to secure the connection to a Postgres DB using one of Postgres's supported authentication methods?

When Django uses the Postgres credentials configured in the settings..py file to connect to the DB, is there a way to secure this connection that Django provides?

Postgres's supported authentication methods

/r/django
https://redd.it/lfyxrs
PEP 634 (Structural Pattern Matching) is approved! Welcome match statement,
https://realworldpython.hashnode.dev/structural-pattern-matching-pep-634-in-python

/r/Python
https://redd.it/lfz5af
The 22 Most-Used Python Packages in The World

Hi Reddit, I assembled the **top 22 most used Python packages in the world** (medium, link bypasses the paywall).

I did some research and wrote about each of them. I had a lot of fun writing this. I'd love to hear your comments!

/r/Python
https://redd.it/lfzbcg
Sending full html link through rendertemplate?

Hi all,
It is possible to send an html link through flask render\
template?

\-----------------------
app.route('/site1')
def site1():


data = '<a href="/info?id=12345">12345</a>'
return render_template('site1.html', data=data)
\-----------------------
I've tested the above, but it comes out as a string and not recognized as a link.

I can send the data and format it as <a href="/info?id={data}">{data}</a> within the html, but i'm using a table loop and the first entry is an id that I'd also like to be a link for drill down purposes. Fairly new to web design and hope I'm asking the question accurately.

Thank you!

/r/flask
https://redd.it/lg68xd
Django as a pure backend independent of the frontend or Django alongside the frontend when using React.

I've already built some parts of the frontend using React, and I was wondering now that I am going to start building the backend, which of the two approaches is more suitable.

&#x200B;

I know that both approaches are useable, but I am not sure about the trade-offs between using Django as an independent backend or using react as an app of a Django project.

&#x200B;

I am hoping that someone could point of the trade-offs between the two approaches or provide some resource to learn about the topic if possible.

&#x200B;

Thank you

/r/djangolearning
https://redd.it/lg50u2
Wednesday Daily Thread: Beginner questions

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

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/lgh38f
Whats the role tools like django-environ, python-dotenv etc when using django with docker?

I'm wondering what's the role/benfit of using the tools mentioned above when using django with docker? Is it mainly for local use without docker?

/r/django
https://redd.it/lghy32
A little jab at C in PEP 20 that I just noticed

In "The Zen of Python", PEP 20, the thirteenth guideline is written

There should be one-- and preferably only one --obvious way to do it.

Based on how those em-dashes are formatted, it feels like the guideline is poking fun at C (and other languages with C-like syntax). For those that aren't aware, in C you can decrement a variable by one, either with var-- or --var. (The difference being that the first expression evaluates, then increments, and the second increments, then evaluates, if that brief explanation makes any sense.)

In other words, there are two ways to do it; it's not Pythonic. I don't know if I'm a moron for not seeing this in the PEP until now, but in my defense I learned Python before I learned C. Also, it seems like the Wikipedia editors missed it, too, based on the formatting.

/r/Python
https://redd.it/lgeb8m
If you use Poetry and github actions 🏄‍♂️

If you use Poetry and Github actions, and don't already use an action for combining these, please check out our poetry install action!

https://github.com/snok/install-poetry

The action itself can be useful, but most of all I hope the repo docs might be helpful to people, as we've put a lot of work into providing useful example workflows that people can use as starting points for crafting their own.

We also recently put some extra effort into improving our Windows documentation - an area that people generally seem to struggle with.

Hope this can be of use to you - and feel free to raise issues, make contributions, or leave a comment here with any feedback! It would be much appreciated 👏

/r/Python
https://redd.it/lgryif
Vuejs with django

Best way to use vuejs with django, is it possible to club both and run vuejs as if its part of django?

/r/django
https://redd.it/lgtxgp
I made auto-steering project

It was my dream since I started to learn Python. It was a long journey. Finally I did it :)

I used OpenCV and Keras. I drove car 1 hour and I trained model. It's running on Euro Truck Simulator 2.
Here is the results
Detailed information and files

/r/Python
https://redd.it/lgvojf
How to prevent users from downloading video files?

Using the HTML5 video tag, how do you prevent users from viewing the source code and clicking the video file and downloading it from source?

I would like the user to see the video file publicly without viewing the source code but not be able to view the source code and download it that way. In javascript, I could prevent users from downloading the file on the front end. But once someone views the source code and clicks the video file, the javascript protection does not exist.

Is there a way in nginx or django to password protect each video file link but still show it on the front end to users?

/r/djangolearning
https://redd.it/lh0nf0
How to create flask sqlalchemy models of existing database that has 35 tables?

Is there any option to automate that process or do I have to create it manually one by one.
Please answer this asap.

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