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
Course that can help you with the deployment part of things

Hello everyone,

I've created a course that I think might be of use to some of you who are interested in the deployment part of things.
It's a DevOps course and it has a section where I dockerize a Python application,
create a CI/CD pipeline in GitLab, and then run the program on the VPS via GitLab Runner.

Here's the link to 100% OFF coupon (1000 of those):
https://www.udemy.com/course/real-world-devops-project-from-start-to-finish/?couponCode=FREEDEVOPS2301DJF8A

There's around 30 minutes you can watch before enrolling to decide if it's for you or not.
If it doesn't appeal to you, please leave it for the next guy.

Happy learning,
Predrag

/r/Python
https://redd.it/10fw95c
What's the best advanced project 8 can write

Hello guys. Senior dev here.

I want to start working on a new python project to add to my portfolio.

The main motivation of this project will be to demonstrate super solid knowledge and skills.

I'm ok with it taking time if it's a big one.
I'm ok with writing a vanilla oop app if it demonstrate my knowledge better.
I'm comfortable with web / IoT devices / network communication.
I wrote some complex frontend apps with frontend frameworks etc.
Comfortable with docker containers.

I just want to write something that whenever a dev interviewer sees it his response will be "I want that dude on my team".

Please help me find the perfect project!

/r/Python
https://redd.it/10fxu0a
Cnverting a Liststring into a Listlist...

Hello everyone, first post ever... can someone point me in the right direccion? I need to format the firt list into the same format as the second one. Python

print(incorrentformatlist)
'AsKh', '2sAc', '7hQs',...........

print(correctformatlist)
['As', 'Kh', '2s', 'Ac', '7h', 'Qs',..............]

\#I tried:

for h in incorrect_format_list:

split_lines = h.split(", ")

\#but the print output is this:

'AsKh'
'2sKh'
'7hQs'
... #rather than what i need: ['As', 'Kh', '2s', 'Ac', '7h', 'Qs'..............]

/r/Python
https://redd.it/10fvovh
How to host flask alongside a Wordpress site?

I have a wordpress site hosted mycoolsite.com Now I have developed a small web app that I want to be associated with this site. How do I add it to app.mycoolsite.com or mycoolsite.com/app? The site is hosted on namecheap shared hosting.

/r/flask
https://redd.it/10bpf1j
Why do we need models? Why can't we just use views with custom functionality?

Might be a dumb question, but I'm working on a django project right now and had this question. In my case - we're making a new app that takes in a CSV and does some analysis, etc. as part of a larger django project. My question - why do I need to make a new django model at all? Why can't I just make a new view in the older app, make a button, and do some backend code to store / analyze the CSV?

Am I missing something conceptual here about how models work / why they're used? Or is this more of a convention thing (i.e. my idea also works but it's better to separate stuff into models)?

/r/django
https://redd.it/10g4p3w
Logging errors when debug is off on Heroku

I have an flask app I'm close to deploying on Heroku and am a bit confused about logging errors once debug mode is off.

I know you need to turn debug mode off for a production environment but of course that means I won't get those great error messages telling me what went wrong.


I looked into a few logging add-ons available on Heroku but am a bit lost on how I can make sure that useful error messages will be logged so I can find issues without being in debug mode.


Please share any suggestions on how I can acheive my goal of protecting my app and still being able to figure out what went wrong (of course something will go wrong!) in my app on an ongoing basis.

/r/flask
https://redd.it/10g6802
Use Python to Build a free Stable Diffusion app (with a GPU backend)

Hey everyone!

I wrote a tutorial on **using Python to build a free Stable Diffusion web app**. The app uses free Colab GPUs to power Stable Diffusion so you can access it for free in your browser!

You'll learn:

1. How to a basic web app using Python (and a little HTML and CSS)
2. How to expose Colab GPUs for use through ngrok

The app itself is very barebones, but I can build a more thorough React app if there is some interest! I mostly just wanted to highlight the working principles/mechanics of how someone would go about doing this so that you don't have to pay to use Stable Diffusion! Not a production solution, but great for hobbyists and people learning :)

Let me know what you think!

​

https://preview.redd.it/6l2n1d0eu0da1.png?width=1055&format=png&auto=webp&v=enabled&s=e0cc74ab76068d414c5fce12a3a37f6f7fe43268

/r/Python
https://redd.it/10g5nay
AmazonMe



Hello everyone,

I have been working on this scraping project to polish my scraping skills and wanted to share it with this awesome Python and web scraping community. It's an Amazon scraper that scrapes the product information according to the URL provided by the user. The scraper utilizes playwright automation to automate and extract the data. (Will add more functionalities)

The code is very beginner friendly and will help beginners to get their hands dirty on websites like Amazon. Your feedback is highly appreciated

/r/Python
https://redd.it/10gekp4
for example, I want to develop a whatsapp-like application for ios. is it possible to write the design and interface with swift and all the remaining codes with python?

I wanna learn it

/r/Python
https://redd.it/10gr2z6
Appending data to a file....

Hello,

I am trying to append data to a file that I am reading from in the path "01Resources/name.json", and this file contains the following data..

{"Name" : "Robert", "Gender" : "Male","age" :"23"}

{"Name" : "peter", "Gender" : "Male","age" :"24"}

{"Name" : "james", "Gender" : "Male","age" :"25"}

{"Name" : "janet", "Gender" : "Female","age" :"26"}

{"Name" : "mary", "Gender" : "Female","age" :"27"}

And here is my code..

####################
# 0. Data to be appended.
data = {"Name": "Roberta", "Gender": "FeMale","age":"35"}

####################
# 1/ read the the JSON data and append by writing new data in.

fdataOut1 = open('01Resources/name.json', "a")
data_strng = str(fdataOut1)
# the data must be string to write to a file
fdataOut1.write(data_strng)
#fdataOut1.write("This is test of appended data")
fdataOut1.close()


fdataIn1 = open('01Resources/name.json', "r")
data1 = fdataIn1.read()
print("")
print("####################")
print("Now the file has more content")
print("contents of whole input data file: " + data1)


fdataIn1.close()

When I run this code, I get the following in the file "01Resources/name.json"....

{"Name" : "Robert", "Gender" : "Male","age" :"23"}

{"Name" : "peter", "Gender" : "Male","age" :"24"}

{"Name" : "james", "Gender" : "Male","age" :"25"}

{"Name" : "janet", "Gender" : "Female","age" :"26"}

{"Name" : "mary", "Gender" : "Female","age" :"27"}<_io.TextIOWrapper name='01Resources/name.json' mode='a' encoding='UTF-8'>

&#x200B;

With Python, I am still "on my trainer wheels on my bike". and so how

/r/Python
https://redd.it/10gr475
I'm kinda noob in Portfolio's World

So I'm trying to get into portfolio's world and I made a website all by myself with Python and Django, if someone could help me with tips to improve, features that would be nice to implement on backend or just saying that is good already it would help much. Thank you :)

My Portfolio

/r/django
https://redd.it/10gsyez
Creating a database before starting django project

Is it possible to use an existing database in a django project or does the data base have to be created as part of making the django app?

&#x200B;

Thanks for your time.

/r/django
https://redd.it/10gspzs