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 tried to make automated YouTube videos using python

Hi everyone, We at Codingbridge tried to use AI to deliver Tech News Everyday, Here is how we did it

1) Use python and selenium to scrape tech related news

2) Preprocess textual data and add additional script

3) Create your own avatar using DeepFake .

4) Use text to speech model to convert textual data to wav format

5) Use MoviePy to cut the video in parts

6) Use Transformer Model to lip sync Video and Audio

7) Use MoviePy to add transitions and merge them in a single video file

8) Use Text to Image for Thumbnail

Here is the result please give your feedback
https://youtu.be/-sxZ2am4nRY

/r/Python
https://redd.it/132ichv
Introducing surveydown - an open source, markdown-based survey framework (that doesn’t exist yet)

Hi folks, I am developing a markdown-based survey platform, and before I go further in the dev work I wanted to carefully think about frameworks and goals, so I laid out my thoughts of the goals and features for this package in this blog post:

https://www.jhelvy.com/posts/2023-04-06-markdown-surveys/

I have a working prototype using Shiny (I am more experienced in R than Python), and I've put it up here: https://github.com/jhelvy/surveydown

But the more I tinker, the more I'm starting to thing that Python may be the better language for this given the many well-developed Python web frameworks out there. Here are some important desired features:

1. Ability to run code: This is perhaps the most important feature. A critical reason I want to build this is so that a user could use code to define aspects of their survey, e.g. randomizing information shown in questions, etc. I haven't seen a survey framework that allows users to run code inside the survey.
2. Markdown-based user interface: A user should be able to quickly define their survey using mostly plain markdown. Then they should be able to run a single command to compile those files into a live web-based survey.
3. Built-in database: Once the survey is compiled, it should

/r/Python
https://redd.it/1332tsx
You can't use pip on Ubuntu 23.04 anymore

so long story short you won't be able to run pip install x anymore. The reason why the command doesn’t work in Ubuntu 23.04 is because of an intentional shift in policy to avoid conflicts between the Python package manager(pip) and Ubuntu’s underlying APT. You can now only use pip by creating a virtual environment with venv. My question is, is this a good thing or a bad thing? is it a good move from Ubuntu's team or not? being able to use pip only from a virtual environment. idk what do you guys think about the whole thing?

/r/Python
https://redd.it/1338oge
Case insensitive username with djangos built user creation?

I noticed when I create a dummy user with capitals and then I got to log in with all lower. it says user doesnt exist.

How can I default username to lower case? I am using Widget_Tweaks to style the form.

Here is my forms.py

from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth.models import User
from django import forms

class RegisterForm(UserCreationForm):
email = forms.EmailField(label='', widget=forms.TextInput(attrs={'class:':'form-control', 'placerholder':'Email Address'}))
firstname = forms.CharField(label='', widget=forms.TextInput(attrs={'class:':'form-control', 'placerholder':' First Name'}))
last
name = forms.CharField(label='', widget=forms.TextInput(attrs={'class:':'form-control', 'placerholder':'Last Name'}))

class Meta:
model = User
fields = ('username', 'firstname', 'lastname', 'email', 'password1', 'password2')

def init(self, args, kwargs):
super(RegisterForm, self).__init__(
args, kwargs)



/r/djangolearning
https://redd.it/1339yi2
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/133amkc
Use database or Pandas for a data that won't be manipulated

So I got some data which I need to fetch for operation in my Django process. It's currently stored in a Google sheet, and since there's multiple sheets Pandas can clean the data by passing the sheet link everytime it is asked for.

I can use a database, but would involve multiple steps to convert it into CSV and then download it and then import it to models

So which option is the more efficient way here?

/r/django
https://redd.it/133bmml
Trying to deploy Flask app to render.com

Hi there! Flask newbie here.

I am trying to deploy a simple Flask app (just a hello world route for now) to render.com. I know that I'll need PyAudio for this project. So I already included it in the dependencies. Now when I deploy to render.com I get the following error message:

src/pyaudio/device_api.c:9:10: fatal error: portaudio.h: No such file or directory

If I understand it correctly portaudio is a C library that is needed by PyAudio. Which means I have to rely on portaudio being installed on the system I want to deploy to? Or alternatively use Docker (very limited knowledge)?

Any pointers into the right direction would be much appreciated!

EDIT:

Another thing that really confuses me is that, when I a generate a requirements.txt it adds Flask==2.3.1 as a dependency, which is current version. But the in the render.com logs I get

ERROR: Could not find a version that satisfies the requirement Flask==2.3.1 (from -r requirements.txt (line 9)) (from versions: 0.1, 0.2, 0.3, 0.3.1, 0.4, 0.5, 0.5.1, 0.5.2, 0.6, 0.6.1, 0.7, 0.7.1, 0.7.2, 0.8, 0.8.1, 0.9, 0.10, 0.10.1, 0.11, 0.11.1, 0.12, 0.12.1, 0.12.2, 0.12.3, 0.12.4, 0.12.5, 1.0, 1.0.1, 1.0.2, 1.0.3, 1.0.4, 1.1.0, 1.1.1, 1.1.2, 1.1.3, 1.1.4, 2.0.0rc1, 2.0.0rc2, 2.0.0, 2.0.1,

/r/flask
https://redd.it/132q7s1
Flask API - CSRF and JWT implementation with frontend

Hello,

I am creating an SPA using Flask for the API endpoints. I want to secure the app using CSRF tokens and JWT tokens to prevent all types of XSS and CSRF attacks.
The front end is Vue. I am using axios to perform the requests.
I am a bit lost on how to do this implementation. When should the CSRF token be sent and how will it be stored on the frontend? What about the JWT and how to implement it with the csrf ? Too many questions and I can't seem to find anything complete online.
Does anyone have any implementation examples or knows how to do it correctly? I would appreciate any help on this matter.

Thank you.

/r/flask
https://redd.it/131nljo
I have a username_or_email_form is there any way to query flask-sqlalchemy query for username or email at the same query?

I could query both separately but it would make my life easier if I could query 2 possible columns and return 1 query.

​

/r/flask
https://redd.it/1326agw
Media is too big
VIEW IN TELEGRAM
[R] Video of experiments from DeepMind's recent “Learning Agile Soccer Skills for a Bipedal Robot with Deep Reinforcement Learning” (OP3 Soccer) project

https://redd.it/132w40c
@pythondaily
This media is not supported in your browser
VIEW IN TELEGRAM
I made a Python package to do adaptive learning of functions in parallel [P]

https://redd.it/133ew06
@pythondaily
TemplateDoesNotExist: bootstrap4/uni_form.html

how to solve this, im getting this error while usng {{form|crisp}}. i've successfully intalled django-crispy-forms and added to the installed app and also used to bootstrap4 for crispytemplate. help me out guys

/r/django
https://redd.it/133s4j9