Python Daily
2.57K subscribers
1.48K photos
53 videos
2 files
38.8K links
Daily Python News
Question, Tips and Tricks, Best Practices on Python Programming Language
Find more reddit channels over at @r_channels
Download Telegram
Monday Daily Thread: 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! If you're looking for project ideas, you might be interested in checking out Al Sweigart's, "The Big Book of Small Python Projects" which provides a list of projects and the code to make them work.

/r/Python
https://redd.it/wiu0so
Text generation using my own dataset of titles/content?

I have a csv file containing article titles and article content. I'm trying to find a way to take a new title as input and use the training model to generate content. I've found a bunch of resources on how to use GPT2 or transformer pipelines to do complete sentences, etc. but I'd like to be able to provide my own data/model instead of using something from e.g. HuggingFace.

Can anyone point me in the right direction?

/r/pystats
https://redd.it/wejqfo
Python libraries or ideas on how you would go about solving this?

So there's this dating show where there are 12 guys and 12 girls. Each person has a "perfect pair" and they're supposed to try to find out who it is. So every trial they match up with someone and then we find out how many of those pairs are correct (but not which ones they are). Also one of the pairs is randomly chosen, and we find out if they are a pair or not.

I basically want to build a python app using that data, and show how many possible combinations there are after each trial.

I've only done one intro to stats course in college, so I don't really know where to begin. I know this is a super broad question, but can anyone give me any advice on how to start? Maybe some formulas or concepts I should look into? Thanks!

/r/pystats
https://redd.it/w9z2n5
Saturday Daily Thread: Resource Request and Sharing! Daily Thread

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/wmzx0f
Sunday Daily Thread: What's everyone working on this week?

Tell /r/python what you're working on this week! You can be bragging, grousing, sharing your passion, or explaining your pain. Talk about your current project or your pet project; whatever you want to share.

/r/Python
https://redd.it/wnsaun
Just learned how to code the game: rock,paper,scissors as a complete beginner

Hey everyone! I began learning Python from zero last week and today I finally learned how to code a rock,paper, and scissors game. This might not be a big accomplishment to some, but it’s crazy to me as a complete beginner!

/r/Python
https://redd.it/wnynqq
Ploomber Convert: A free online tool to convert Jupyter notebooks to PDF

Hi, r/IPython!

We’re launching Ploomber Convert today, a web-based application that allows data scientists to convert notebooks to PDF, no setup required. We don't store notebooks or PDFs.

Ploomber convert demo

As data scientists, we have to share our work with non-technical colleagues to communicate results. To allow them to read our findings, we've used nbconvert, which enables us to export notebooks to PDF or HTML. Unfortunately, nbconvert requires Pandoc, TeX/XeLaTeX, Pyppeteer, Chromium, and other packages, whose installation is complicated. Members of our community kept asking for help to get all the packages installed so we decided to build something to fix this: Ploomber Convert provides the nbconvert functionality without installing a single package.

Ploomber Convert is built on top of AWS and runs all the necessary packages in a docker container. Since notebooks often contain sensitive information, we do not store any notebooks or PDF files.

Ploomber Convert is free to use. Go to https://convert.ploomber.io, drop your Jupyter Notebook to convert, hit ‘Convert to PDF’, and save it.

We want to make Ploomber Convert the go-to tool for data scientists to turn their notebooks into shareable reports. We’re working on adding support for Quarto, custom CSS templates, export to HTML, and other features. Let us

/r/IPython
https://redd.it/wk93py
Flask Boilerplate and Mini Guide to Flask

Hey guys. I made a Flask boilerplate: Flask-Backbone. It comes with SQLAlchemy, Alembic, Flask-Debug, Flask-Caching, and Sentry. Blueprints are the main concept in this boilerplate. I also incorporated Flask commands, since I use it pretty often in my projects. This way you can create custom commands both for application or for individual blueprints.

I tried to organize everything in a clean and easy-to-understand way. As with every boilerplate, it's a WIP, but I already use it for my new projects.

https://preview.redd.it/r51wqam5mhi91.jpg?width=2400&format=pjpg&auto=webp&s=2ddd3ac4be64f3bf95ac9e8f5dbcb68f4fee40bc

Boilerplate is based on Flask 2.2, so keep in mind that python 3.7 or newer is required.

You will not find any bootstrap or front-end-related stuff inside, because I wanted to keep it clean, and anyway, usually, most developers use a custom front-end stack. If you don't need database support then this boilerplate will work out for you as well.

I also wrote an article about how and why I created this boilerplate. It might be a good starting point for newbie developers or for those who are new to Flask. Don't forget to check it.

Source code: https://github.com/abstractkitchen/flask-backbone

Article: https://abstractkitchen.com/blog/flask-backbone/

Hope you'll like it.

/r/flask
https://redd.it/wrm8lo
R is not auto-indenting in JupyterLab

I'm using R in JupyterLab. Whenever I create functions with ggplot, JupyterLab does not auto-indent my script after the '+' operator. The same holds for when I'm piping: JupyterLab does not auto-indent my script after the '%>%' operator.

What could I do to change this? Is there, perhaps, a GitHub repository out there with a catalog of user settings to make R behave more like it does in RStudio - but in JupyterLab?

Thank you!

/r/JupyterNotebooks
https://redd.it/wtnna5
Sunday Daily Thread: What's everyone working on this week?

Tell /r/python what you're working on this week! You can be bragging, grousing, sharing your passion, or explaining your pain. Talk about your current project or your pet project; whatever you want to share.

/r/Python
https://redd.it/wtl976
2022 State of Django Panel @ DjangoCon US

2022 State of Django Panel Topic ideas?
\#Django #News #Events #Releases


\+ Python relationship
\+ hot packages + stack trends
\+ people!
\+ learning
\+ contributions & releases


What do YOU think needs center stage attention? You can use this form to reply anonymously http://forms.microsoft.com/r/n5aKPx3QCw or reply to post.

/r/django
https://redd.it/wwn12e
Im trying to clone the repository in vs code and this is the error please guide me

/r/flask
https://redd.it/x2m5ch
Sunday Daily Thread: What's everyone working on this week?

Tell /r/python what you're working on this week! You can be bragging, grousing, sharing your passion, or explaining your pain. Talk about your current project or your pet project; whatever you want to share.

/r/Python
https://redd.it/wzhaf7
A take on the Jupyter UI (crosspost r/python)

This is an OSS project we’ve been working on to improve the UX for data scientists using Jupyter notebooks. A lot of this stems from things we wanted: coding in native .py format, easier data exploration and experiment management. We’d like to build out a holistic ecosystem for data scientists so they don’t have to deal with context switching between multiple tools. Feel free to try our beta release and share any feedback. Site: www.cnext.io Docs can be found at: docs.cnext.io.

https://preview.redd.it/5k7aad2rihm91.jpg?width=2840&format=pjpg&auto=webp&s=45e04c2f2227a8597bfdb96f4742e601cbece601

/r/JupyterNotebooks
https://redd.it/x8dgnw
Does Jupyter take input for Bash in VS Code?

I'm creating a .ipynb file in VS Code that is using Bash. I have the Jupyter extension installed in VS Code.

I want to create an input in the .ipynb file with the following code:


read input

echo $input




However, when I run the cell, VS Code does not give me a box for input.


How do I do input in Bash for the Jupyter notebook file?

/r/IPython
https://redd.it/x7shnd
Provider for sending emails in Django application

SOLVED: Thanks for your suggestions. Very helpful. Turns out I only needed to add an app password to get it to work again.

For a long time I used Gmail to send emails in my Django applications. I used their service to:

- Send emails to new users that were added to the system.
- Send error logs to my own email so I would notice errors occuring in my application.
- For resetting passwords

Since may 31st Google has stopped support for sending emails through an application. Does anyone have a recommendation for a replacement?

/r/django
https://redd.it/xakcgw
What is the point of request.content_md5 / Content-MD5 Header?

Flask has a `request.content_md5` which corresponds to the `Content-MD5` header. The [docs](https://flask.palletsprojects.com/en/2.2.x/api/#flask.Request.content_md5) say:

> The Content-MD5 entity-header field, as defined in RFC 1864, is an MD5 digest of the entity-body for the purpose of providing an end-to-end message integrity check (MIC) of the entity-body. (Note: a MIC is good for detecting accidental modification of the entity-body in transit, but is not proof against malicious attacks.)

What is the point of this?

I tried sending a request with a bogus value in the Content-MD5 header, and flask did not automatically fail the request.

Am I supposed to write some code that computes the hash of the request body and compare it against Content-MD5, if this is present, and then ask my clients to compute the MD5 and put it in the Content-MD5 header?

I would have assumed that clients would automatically do this as part of the client library, and the flask would automatically compare the md5 and fail with an error. It seems like this does not happen.

/r/flask
https://redd.it/xatptz
Sending E-Mail to the customer

Hi, devs. I am using Flask-Mail and I want to send the mail-like photos to the client. I can send plain text, but I want to make it better. WHere should I put this HTML code? Can someone guide me?

​

​

https://preview.redd.it/6uw5lnxoq1n91.png?width=521&format=png&auto=webp&s=a65e572b2683b4bd3312f4d967a62ae4fdaa87e8

/r/flask
https://redd.it/xarkgw
Sunday Daily Thread: What's everyone working on this week?

Tell /r/python what you're working on this week! You can be bragging, grousing, sharing your passion, or explaining your pain. Talk about your current project or your pet project; whatever you want to share.

/r/Python
https://redd.it/xb3w16