I wrote this simple script to analyze python files.
### What my project does
It's a simple utility script which allows you to analyze your python file. It provides simple detailed insights into the structure and composition of Python code, including information about functions, classes, imports, variables, and function calls.
### Target Audience
Honestly, this is just a fun project
### Comparison
N/A
#### Link to the project
/r/Python
https://redd.it/1el7xyf
### What my project does
It's a simple utility script which allows you to analyze your python file. It provides simple detailed insights into the structure and composition of Python code, including information about functions, classes, imports, variables, and function calls.
### Target Audience
Honestly, this is just a fun project
### Comparison
N/A
#### Link to the project
/r/Python
https://redd.it/1el7xyf
GitHub
GitHub - mraza007/python-file-analyzer: A simple utility script which allows you to analyze your python file
A simple utility script which allows you to analyze your python file - mraza007/python-file-analyzer
How would you implement a "10% off for first-time customers" coupon?
I need to create a coupon that shouldn't be able to be reused.
I've thought of cookies, IP, emails/authentication, fingerprinting, etc., but nothing is really bulletproof.
How would you approach this?
Edit: This is for an ecommerce platform, so assume no user database since guest checkouts are a must.
/r/django
https://redd.it/1ekxcom
I need to create a coupon that shouldn't be able to be reused.
I've thought of cookies, IP, emails/authentication, fingerprinting, etc., but nothing is really bulletproof.
How would you approach this?
Edit: This is for an ecommerce platform, so assume no user database since guest checkouts are a must.
/r/django
https://redd.it/1ekxcom
Reddit
From the django community on Reddit
Explore this post and more from the django community
Database suggestion
For a machine learning project I am looking into different database backends to store my data. The data is a sparse time series matrix (example at the end). Also, the sensor names are dynamic and could change in the future
Further, FastAPI is used for the backend.
What database like TimescaleDB or InfluxDB do you have experience with and which one do you recommend?
data = {
"entry_id": "61da2b48-7526-418b-b4d2-0c87a9fb7237",
"data": {
"2024-08-01 00:00:00": {
"sensor_1": 0.0,
"sensor_2": 10.0
},
"2024-08-01 01:00:00": {
"sensor_1": 1.0
},
"2024-08-01 02:00:00": {
"sensor_1": 1.0,
"sensor_2": 11.0,
"sensor_3": 30.0
/r/Python
https://redd.it/1elctrz
For a machine learning project I am looking into different database backends to store my data. The data is a sparse time series matrix (example at the end). Also, the sensor names are dynamic and could change in the future
Further, FastAPI is used for the backend.
What database like TimescaleDB or InfluxDB do you have experience with and which one do you recommend?
data = {
"entry_id": "61da2b48-7526-418b-b4d2-0c87a9fb7237",
"data": {
"2024-08-01 00:00:00": {
"sensor_1": 0.0,
"sensor_2": 10.0
},
"2024-08-01 01:00:00": {
"sensor_1": 1.0
},
"2024-08-01 02:00:00": {
"sensor_1": 1.0,
"sensor_2": 11.0,
"sensor_3": 30.0
/r/Python
https://redd.it/1elctrz
Reddit
From the Python community on Reddit
Explore this post and more from the Python community
A Simple sync FastAPI Boilerplate with minimal overhead
Why? To keep myself building the same thing again and again. Lot of great boilerplate projects already out there but many a times they have certain extra features, atleast for me, or use some other 3rd party packages which are not needed by all the projects.
If it helps anyone else too to get the ground running - https://github.com/keshavagrawal89/fastapi\_boilerplate
Quick README: https://github.com/keshavagrawal89/fastapi\_boilerplate/blob/main/README.md
There are so many things which could have been added here but were intentionally left out because sometimes adding features to simple boilerplate kind of defeats the concept of boilerplate. If anyone wants to contribute or fork it out to add any required features - they are welcome to do so.
Although nginx, celery scope is also added in docker-compose but not necessary.
Supabase is used for authentication and Postgres as Database. Should be enough for most of the applications.
/r/Python
https://redd.it/1eldpb3
Why? To keep myself building the same thing again and again. Lot of great boilerplate projects already out there but many a times they have certain extra features, atleast for me, or use some other 3rd party packages which are not needed by all the projects.
If it helps anyone else too to get the ground running - https://github.com/keshavagrawal89/fastapi\_boilerplate
Quick README: https://github.com/keshavagrawal89/fastapi\_boilerplate/blob/main/README.md
There are so many things which could have been added here but were intentionally left out because sometimes adding features to simple boilerplate kind of defeats the concept of boilerplate. If anyone wants to contribute or fork it out to add any required features - they are welcome to do so.
Although nginx, celery scope is also added in docker-compose but not necessary.
Supabase is used for authentication and Postgres as Database. Should be enough for most of the applications.
/r/Python
https://redd.it/1eldpb3
GitHub
GitHub - keshavagrawal89/fastapi_boilerplate: Sync FastAPI boilerplate. Auth Enabled. Supabase. Postgres
Sync FastAPI boilerplate. Auth Enabled. Supabase. Postgres - keshavagrawal89/fastapi_boilerplate
New Tool Easily Convert YouTube Videos to MP!
Hey everyone!
I’m super excited to share a new tool I’ve been working on: YouTube to MP Converter! This little app makes it super easy to turn your favorite YouTube videos into MP3 files. Whether you want to jam out to your favorite songs offline or save some educational videos as files, this tool has you covered.
# What My Project Does?
The YouTube to MP Converter is a simple, user-friendly application that allows you to convert YouTube videos into high-quality MP files. It supports various MP formats and lets you choose where to save the files on your computer. Plus, it comes with some cool customization options to tweak the user interface according to your preferences.
# Target Audience
This tool is perfect for anyone who:
Loves listening to music or podcasts from YouTube offline.
Wants an easy way to save educational videos as files.
Prefers a customizable user interface to suit their style.
Is looking for a straightforward, reliable way to convert YouTube videos to MP3.
# Comparison
Compared to other YouTube to MP converters, my tool stands out because of its:
Customization Options: Personalize the user interface to make the app look just how you like it.
Simplicity and Ease of Use: The intuitive
/r/Python
https://redd.it/1elh7nr
Hey everyone!
I’m super excited to share a new tool I’ve been working on: YouTube to MP Converter! This little app makes it super easy to turn your favorite YouTube videos into MP3 files. Whether you want to jam out to your favorite songs offline or save some educational videos as files, this tool has you covered.
# What My Project Does?
The YouTube to MP Converter is a simple, user-friendly application that allows you to convert YouTube videos into high-quality MP files. It supports various MP formats and lets you choose where to save the files on your computer. Plus, it comes with some cool customization options to tweak the user interface according to your preferences.
# Target Audience
This tool is perfect for anyone who:
Loves listening to music or podcasts from YouTube offline.
Wants an easy way to save educational videos as files.
Prefers a customizable user interface to suit their style.
Is looking for a straightforward, reliable way to convert YouTube videos to MP3.
# Comparison
Compared to other YouTube to MP converters, my tool stands out because of its:
Customization Options: Personalize the user interface to make the app look just how you like it.
Simplicity and Ease of Use: The intuitive
/r/Python
https://redd.it/1elh7nr
Reddit
From the Python community on Reddit: [New Tool] Easily Convert YouTube Videos to MP!
Explore this post and more from the Python community
Just Launched my first public project! looking for feedback and tips
Hi everyone,
I just launched my first project, "RecAnthology" – a recommendation system for books, movies, and TV shows! I'd love to hear your thoughts and get some tips.
I uploaded it to a public repo ( https://github.com/karar-hayder/RecAnthology ) and hosted it on pythonanywehere ( https://recanthology.pythonanywhere.com ).
Any feedback, ideas and tips are much appreciated
https://preview.redd.it/fufv5mx7lxgd1.png?width=714&format=png&auto=webp&s=94985cf2dad810d1e7ab8790da1a92297c701c94
https://preview.redd.it/z7peklx7lxgd1.png?width=1269&format=png&auto=webp&s=a18bfcc29a1e610fb85b42fd9208574dfb5b8d2c
/r/djangolearning
https://redd.it/1el61gz
Hi everyone,
I just launched my first project, "RecAnthology" – a recommendation system for books, movies, and TV shows! I'd love to hear your thoughts and get some tips.
I uploaded it to a public repo ( https://github.com/karar-hayder/RecAnthology ) and hosted it on pythonanywehere ( https://recanthology.pythonanywhere.com ).
Any feedback, ideas and tips are much appreciated
https://preview.redd.it/fufv5mx7lxgd1.png?width=714&format=png&auto=webp&s=94985cf2dad810d1e7ab8790da1a92297c701c94
https://preview.redd.it/z7peklx7lxgd1.png?width=1269&format=png&auto=webp&s=a18bfcc29a1e610fb85b42fd9208574dfb5b8d2c
/r/djangolearning
https://redd.it/1el61gz
GitHub
GitHub - karar-hayder/RecAnthology: RecAnthology (Recommended Anthology) is an intelligent recommendation system designed to curate…
RecAnthology (Recommended Anthology) is an intelligent recommendation system designed to curate collections of books, movies, and TV shows based on user preferences. By leveraging advanced algorith...
[P] Grounded SAM 2: Ground and Track Anything
https://preview.redd.it/13854j03q2hd1.jpg?width=1280&format=pjpg&auto=webp&s=0735848ae40c2591111fa4ed91d2c28ea829c0ac
With the release of SAM 2, we have taken the opportunity to update our Grounded SAM algorithm. The biggest improvement in SAM 2 compared to SAM is the expansion of its segmentation capabilities to video, allowing users to interactively segment any object and track it in video. However, the main issue with SAM 2 is that the segmented and tracked objects do not contain semantic information. To address this, we have continued the approach of Grounded SAM by **incorporating an open-set detection model**, Grounding DINO. This enables us to extend 2D open-set detection to video object segmentation and tracking.
We have release our code in
[https://github.com/IDEA-Research/Grounded-SAM-2](https://github.com/IDEA-Research/Grounded-SAM-2)
with **very easy implementations**, which is convenient for users.
Project Highlights:
In this repo, we've supported the following demo with **simple implementations**:
* **Ground and Segment Anything** with Grounding DINO, Grounding DINO 1.5 & 1.6 and SAM 2
* **Ground and Track Anything** with Grounding DINO, Grounding DINO 1.5 & 1.6 and SAM 2
* **Detect, Segment and Track Visualization** based on the powerful [https://github.com/roboflow/supervision](https://github.com/roboflow/supervision) library.
And we will continue update our code to make it easier for users.
/r/MachineLearning
https://redd.it/1elmxnq
https://preview.redd.it/13854j03q2hd1.jpg?width=1280&format=pjpg&auto=webp&s=0735848ae40c2591111fa4ed91d2c28ea829c0ac
With the release of SAM 2, we have taken the opportunity to update our Grounded SAM algorithm. The biggest improvement in SAM 2 compared to SAM is the expansion of its segmentation capabilities to video, allowing users to interactively segment any object and track it in video. However, the main issue with SAM 2 is that the segmented and tracked objects do not contain semantic information. To address this, we have continued the approach of Grounded SAM by **incorporating an open-set detection model**, Grounding DINO. This enables us to extend 2D open-set detection to video object segmentation and tracking.
We have release our code in
[https://github.com/IDEA-Research/Grounded-SAM-2](https://github.com/IDEA-Research/Grounded-SAM-2)
with **very easy implementations**, which is convenient for users.
Project Highlights:
In this repo, we've supported the following demo with **simple implementations**:
* **Ground and Segment Anything** with Grounding DINO, Grounding DINO 1.5 & 1.6 and SAM 2
* **Ground and Track Anything** with Grounding DINO, Grounding DINO 1.5 & 1.6 and SAM 2
* **Detect, Segment and Track Visualization** based on the powerful [https://github.com/roboflow/supervision](https://github.com/roboflow/supervision) library.
And we will continue update our code to make it easier for users.
/r/MachineLearning
https://redd.it/1elmxnq
What do you guys think of how I'm handling this endpoint?
I'm wondering if maybe I can handle this differently, it really seems very repetitive.
Also what else can I add to the custom exceptions, right now they are just helping me handle separate errors appropriately, but I think I'm missing a way of getting more out of them.
Would adding the status code to them be a good idea?
I also read something about f strings when using logging and how it can impact the log message. The proper way is using this `logger.info("Text %s", data)` right?
try:
response, status = auth_service.login(data)
logger.info(f"Login Successful: {data['email']}")
create_audit_log(data["user_id"], "Login", "Login Attempt Successful")
return jsonify(response), status
except InvalidCredentials as e:
logger.warning(f"Login Attempt Failed: {data['email']} - Invalid Credentials")
create_audit_log(data["user_id"], "Login", "Login Attempt Failed: Invalid Credentials")
abort(401, description="Email Or Password Is Incorrect")
except DatabaseQueryError as e:
logger.error(f"Login Attempt Failed: {data['email']} - {traceback.format_exc()}")
/r/flask
https://redd.it/1elnply
I'm wondering if maybe I can handle this differently, it really seems very repetitive.
Also what else can I add to the custom exceptions, right now they are just helping me handle separate errors appropriately, but I think I'm missing a way of getting more out of them.
Would adding the status code to them be a good idea?
I also read something about f strings when using logging and how it can impact the log message. The proper way is using this `logger.info("Text %s", data)` right?
try:
response, status = auth_service.login(data)
logger.info(f"Login Successful: {data['email']}")
create_audit_log(data["user_id"], "Login", "Login Attempt Successful")
return jsonify(response), status
except InvalidCredentials as e:
logger.warning(f"Login Attempt Failed: {data['email']} - Invalid Credentials")
create_audit_log(data["user_id"], "Login", "Login Attempt Failed: Invalid Credentials")
abort(401, description="Email Or Password Is Incorrect")
except DatabaseQueryError as e:
logger.error(f"Login Attempt Failed: {data['email']} - {traceback.format_exc()}")
/r/flask
https://redd.it/1elnply
Reddit
From the flask community on Reddit
Explore this post and more from the flask community
Wednesday Daily Thread: Beginner questions
# Weekly Thread: Beginner Questions 🐍
Welcome to our Beginner Questions thread! Whether you're new to Python or just looking to clarify some basics, this is the thread for you.
## How it Works:
1. Ask Anything: Feel free to ask any Python-related question. There are no bad questions here!
2. Community Support: Get answers and advice from the community.
3. Resource Sharing: Discover tutorials, articles, and beginner-friendly resources.
## Guidelines:
This thread is specifically for beginner questions. For more advanced queries, check out our [Advanced Questions Thread](#advanced-questions-thread-link).
## Recommended Resources:
If you don't receive a response, consider exploring r/LearnPython or join the Python Discord Server for quicker assistance.
## Example Questions:
1. What is the difference between a list and a tuple?
2. How do I read a CSV file in Python?
3. What are Python decorators and how do I use them?
4. How do I install a Python package using pip?
5. What is a virtual environment and why should I use one?
Let's help each other learn Python! 🌟
/r/Python
https://redd.it/1elxc34
# Weekly Thread: Beginner Questions 🐍
Welcome to our Beginner Questions thread! Whether you're new to Python or just looking to clarify some basics, this is the thread for you.
## How it Works:
1. Ask Anything: Feel free to ask any Python-related question. There are no bad questions here!
2. Community Support: Get answers and advice from the community.
3. Resource Sharing: Discover tutorials, articles, and beginner-friendly resources.
## Guidelines:
This thread is specifically for beginner questions. For more advanced queries, check out our [Advanced Questions Thread](#advanced-questions-thread-link).
## Recommended Resources:
If you don't receive a response, consider exploring r/LearnPython or join the Python Discord Server for quicker assistance.
## Example Questions:
1. What is the difference between a list and a tuple?
2. How do I read a CSV file in Python?
3. What are Python decorators and how do I use them?
4. How do I install a Python package using pip?
5. What is a virtual environment and why should I use one?
Let's help each other learn Python! 🌟
/r/Python
https://redd.it/1elxc34
Discord
Join the Python Discord Server!
We're a large community focused around the Python programming language. We believe that anyone can learn to code. | 412982 members
Useful automations using Slack, GitHub, Jira, Google tools and more
What My Project Does
Build relatively simple but useful automations in Python deployed on AutoKitteh using integrations to various applications such as GitHub, Slack, Jira, Google Calendar, Google sheets and more. For example:
Categorize new emails in your Gmail inbox using ChatGPT and send notifications to the appropriate Slack channel.
Automatically set JIRA ticket assignees based on Google Calendar events.
Scan your Copilot users and request them to free up licenses if not used for two weeks.
"Break Glass" - Using Slack to orchestrate a temporal elevation of privileges in AWS. A developer asks for privileges in Slack using Slash command, the IT team can approve on deny in Slack form. If approved, the workflow elevates privileges in AWS and reduces back after some period of time.
All written in Python, very short and easy to modify: https://github.com/autokitteh/kittehub
Target Audience
Can be used by any developer or in production.
You can install the platform and run automation on your PC / Cloud or ask access for the cloud service.
Comparison
Workflows in no-code/low code platforms like Zapier, 8n8 and more. The main difference is that it's a developer first platform (write workflows in code), and it supports durable execution. What is means is that you can write
/r/Python
https://redd.it/1elttxs
What My Project Does
Build relatively simple but useful automations in Python deployed on AutoKitteh using integrations to various applications such as GitHub, Slack, Jira, Google Calendar, Google sheets and more. For example:
Categorize new emails in your Gmail inbox using ChatGPT and send notifications to the appropriate Slack channel.
Automatically set JIRA ticket assignees based on Google Calendar events.
Scan your Copilot users and request them to free up licenses if not used for two weeks.
"Break Glass" - Using Slack to orchestrate a temporal elevation of privileges in AWS. A developer asks for privileges in Slack using Slash command, the IT team can approve on deny in Slack form. If approved, the workflow elevates privileges in AWS and reduces back after some period of time.
All written in Python, very short and easy to modify: https://github.com/autokitteh/kittehub
Target Audience
Can be used by any developer or in production.
You can install the platform and run automation on your PC / Cloud or ask access for the cloud service.
Comparison
Workflows in no-code/low code platforms like Zapier, 8n8 and more. The main difference is that it's a developer first platform (write workflows in code), and it supports durable execution. What is means is that you can write
/r/Python
https://redd.it/1elttxs
autokitteh
Durable Vibe Automation
Build, deploy, and execute resilient automation and AI Agents with Vibe Automation.
Heroku Flask Deployment w/ Gunicorn errors
So I have my Procfile set up as such
and my flask run set up as
port = int(os.environ.get("PORT", 5000))
app.run(host="0.0.0.0", port=port)
but when i deploy to heroku i still get the defualt 'this is a development server' message. i dont know what i am doing wrong.
/r/flask
https://redd.it/1elxvc2
So I have my Procfile set up as such
web: gunicorn app:appand my flask run set up as
port = int(os.environ.get("PORT", 5000))
app.run(host="0.0.0.0", port=port)
but when i deploy to heroku i still get the defualt 'this is a development server' message. i dont know what i am doing wrong.
/r/flask
https://redd.it/1elxvc2
Reddit
From the flask community on Reddit
Explore this post and more from the flask community
need a django minor project
hello developers, I need a unique django project (minor project) please. please share a project, I need help, I've to submit it to my college but i've zero time left to make it. so please guys
/r/django
https://redd.it/1em4621
hello developers, I need a unique django project (minor project) please. please share a project, I need help, I've to submit it to my college but i've zero time left to make it. so please guys
/r/django
https://redd.it/1em4621
Reddit
From the django community on Reddit
Explore this post and more from the django community
Saving media folder
Hello everyone, Where do you save your media files in a server or VPS given you are not using storage buckets or other file storage services?
/r/django
https://redd.it/1em5of9
Hello everyone, Where do you save your media files in a server or VPS given you are not using storage buckets or other file storage services?
/r/django
https://redd.it/1em5of9
Reddit
From the django community on Reddit
Explore this post and more from the django community
What’s the best way to integrate a shared PostGreSQL DB in development?
Hello,
We’re working on a large university group project which aims to develop a webapp with Django that will eventually be hosted on a virtual host provided by the university.
The server is running with Apache, Ubuntu Linux combined with a PostgreSQL DB.
So far we‘re in the development stage, programming locally on our devices, using Gitlab as version control. We currently use the default SQLite3 DB and upload it to Gitlab together with the code.
I already have access to the virtual host but haven’t played around with it much since that’s not really my expert field.
Now, I’ve read in several sources that it would be smarter to imitate the server tech stack, even in early development phases. That means, instead of using SQLite, we should be already using a PostgreSQL DB instead, even if we only work with dummy data so far.
Now here’s my question. What is the best practice to use a PostgreSQL DB, that synchronizes existing data between the different people involved in programming?
Obviously if I change something, i.e. adding a new user, I want my colleague to also have access to this newly created user the next time he makes changes to the project.
I googled this question
/r/django
https://redd.it/1em9s9b
Hello,
We’re working on a large university group project which aims to develop a webapp with Django that will eventually be hosted on a virtual host provided by the university.
The server is running with Apache, Ubuntu Linux combined with a PostgreSQL DB.
So far we‘re in the development stage, programming locally on our devices, using Gitlab as version control. We currently use the default SQLite3 DB and upload it to Gitlab together with the code.
I already have access to the virtual host but haven’t played around with it much since that’s not really my expert field.
Now, I’ve read in several sources that it would be smarter to imitate the server tech stack, even in early development phases. That means, instead of using SQLite, we should be already using a PostgreSQL DB instead, even if we only work with dummy data so far.
Now here’s my question. What is the best practice to use a PostgreSQL DB, that synchronizes existing data between the different people involved in programming?
Obviously if I change something, i.e. adding a new user, I want my colleague to also have access to this newly created user the next time he makes changes to the project.
I googled this question
/r/django
https://redd.it/1em9s9b
Reddit
From the django community on Reddit
Explore this post and more from the django community
Header duplicate issue
So I'm trying to do a post request through curl to my flask server. I coded the headers into it. I coded the header "Connection" value to be "keep-alive"
And well it works but somehow its also showing another header called "Connection" with the value "close" How to solve this? Because It should only show keep-alive.
/r/flask
https://redd.it/1emn9h9
So I'm trying to do a post request through curl to my flask server. I coded the headers into it. I coded the header "Connection" value to be "keep-alive"
And well it works but somehow its also showing another header called "Connection" with the value "close" How to solve this? Because It should only show keep-alive.
/r/flask
https://redd.it/1emn9h9
Reddit
From the flask community on Reddit
Explore this post and more from the flask community
Research The Puzzling Failure of Multimodal AI Chatbots
https://preview.redd.it/ummnvenf1ahd1.png?width=2592&format=png&auto=webp&s=7115ba5de026ada17b0636ec2fa3c3151b3e5eb6
Chatbot models such as GPT-4o and Gemini have demonstrated impressive capabilities in understanding both images and texts. However, it is not clear whether they can emulate the general intelligence and reasoning ability of humans. To this end, PuzzleVQA is a new benchmark of multimodal puzzles to explore the limits of current models. As shown above, even models such as GPT-4V struggle to understand simple abstract patterns that a child could grasp.
https://preview.redd.it/7l5fmuys1ahd1.png?width=2716&format=png&auto=webp&s=337118dbc55230637cec1b08b90ae943746ddbb0
Despite the apparent simplicity of the puzzles, we observe surprisingly poor performance for current multimodal AI models. Notably, there remains a massive gap towards human performance. Thus, the natural question arises: what caused the failure of the models? To answer this question, we ran a bottleneck analysis by progressively providing ground-truth "hints" to the models, such as image captions for perception or reasoning explanations. As shown above, we found that leading models face key challenges in visual perception and inductive reasoning. This means that they are not able to accurately perceive the objects in the images, and they are also poor at recognizing the correct patterns.
https://arxiv.org/abs/2403.13315
/r/MachineLearning
https://redd.it/1emi095
https://preview.redd.it/ummnvenf1ahd1.png?width=2592&format=png&auto=webp&s=7115ba5de026ada17b0636ec2fa3c3151b3e5eb6
Chatbot models such as GPT-4o and Gemini have demonstrated impressive capabilities in understanding both images and texts. However, it is not clear whether they can emulate the general intelligence and reasoning ability of humans. To this end, PuzzleVQA is a new benchmark of multimodal puzzles to explore the limits of current models. As shown above, even models such as GPT-4V struggle to understand simple abstract patterns that a child could grasp.
https://preview.redd.it/7l5fmuys1ahd1.png?width=2716&format=png&auto=webp&s=337118dbc55230637cec1b08b90ae943746ddbb0
Despite the apparent simplicity of the puzzles, we observe surprisingly poor performance for current multimodal AI models. Notably, there remains a massive gap towards human performance. Thus, the natural question arises: what caused the failure of the models? To answer this question, we ran a bottleneck analysis by progressively providing ground-truth "hints" to the models, such as image captions for perception or reasoning explanations. As shown above, we found that leading models face key challenges in visual perception and inductive reasoning. This means that they are not able to accurately perceive the objects in the images, and they are also poor at recognizing the correct patterns.
https://arxiv.org/abs/2403.13315
/r/MachineLearning
https://redd.it/1emi095
Confused about the delete route in my blueprint
So I'm making a book tracking application based off the flask tutorial with a few extra features (like allowing the user to input their current page and calculating a completion status)
Right now, my delete function is acting funny. The blog delete function takes me to a route
"POST /3/delete HTTP/1.1"
My version returns
"POST /anonymous/to%20be%20deleted/update HTTP/1.1"
Notice how it the url_for function builds the route for update instead?
This is my book.delete function I have in the book blueprint....
@bp.route("/<book_author>/<book_title>/delete", methods=('POST',))
def delete(book_author, book_title):
#updated_book = get_author_book(book_title, book_author)
book_id = returnIdFromTitleAndAuthor(book_title, book_author)
print("book_id currently is: " + book_id['id'])
if book_id is None:
flash("No book of that title + author to delete.")
db = get_db()
db.execute("DELETE FROM books WHERE books.id = ?", (book_id['id'],))
db.commit()
#print("Book is outta here")
flash("Book Deleted")
return redirect(url_for("book.index"))
None of the print statements are showing, meaning the function isn't being called. Here is
/r/flask
https://redd.it/1emtg60
So I'm making a book tracking application based off the flask tutorial with a few extra features (like allowing the user to input their current page and calculating a completion status)
Right now, my delete function is acting funny. The blog delete function takes me to a route
"POST /3/delete HTTP/1.1"
My version returns
"POST /anonymous/to%20be%20deleted/update HTTP/1.1"
Notice how it the url_for function builds the route for update instead?
This is my book.delete function I have in the book blueprint....
@bp.route("/<book_author>/<book_title>/delete", methods=('POST',))
def delete(book_author, book_title):
#updated_book = get_author_book(book_title, book_author)
book_id = returnIdFromTitleAndAuthor(book_title, book_author)
print("book_id currently is: " + book_id['id'])
if book_id is None:
flash("No book of that title + author to delete.")
db = get_db()
db.execute("DELETE FROM books WHERE books.id = ?", (book_id['id'],))
db.commit()
#print("Book is outta here")
flash("Book Deleted")
return redirect(url_for("book.index"))
None of the print statements are showing, meaning the function isn't being called. Here is
/r/flask
https://redd.it/1emtg60
Reddit
From the flask community on Reddit
Explore this post and more from the flask community
Thursday Daily Thread: Python Careers, Courses, and Furthering Education!
# Weekly Thread: Professional Use, Jobs, and Education 🏢
Welcome to this week's discussion on Python in the professional world! This is your spot to talk about job hunting, career growth, and educational resources in Python. Please note, this thread is not for recruitment.
---
## How it Works:
1. Career Talk: Discuss using Python in your job, or the job market for Python roles.
2. Education Q&A: Ask or answer questions about Python courses, certifications, and educational resources.
3. Workplace Chat: Share your experiences, challenges, or success stories about using Python professionally.
---
## Guidelines:
- This thread is not for recruitment. For job postings, please see r/PythonJobs or the recruitment thread in the sidebar.
- Keep discussions relevant to Python in the professional and educational context.
---
## Example Topics:
1. Career Paths: What kinds of roles are out there for Python developers?
2. Certifications: Are Python certifications worth it?
3. Course Recommendations: Any good advanced Python courses to recommend?
4. Workplace Tools: What Python libraries are indispensable in your professional work?
5. Interview Tips: What types of Python questions are commonly asked in interviews?
---
Let's help each other grow in our careers and education. Happy discussing! 🌟
/r/Python
https://redd.it/1emrh0k
# Weekly Thread: Professional Use, Jobs, and Education 🏢
Welcome to this week's discussion on Python in the professional world! This is your spot to talk about job hunting, career growth, and educational resources in Python. Please note, this thread is not for recruitment.
---
## How it Works:
1. Career Talk: Discuss using Python in your job, or the job market for Python roles.
2. Education Q&A: Ask or answer questions about Python courses, certifications, and educational resources.
3. Workplace Chat: Share your experiences, challenges, or success stories about using Python professionally.
---
## Guidelines:
- This thread is not for recruitment. For job postings, please see r/PythonJobs or the recruitment thread in the sidebar.
- Keep discussions relevant to Python in the professional and educational context.
---
## Example Topics:
1. Career Paths: What kinds of roles are out there for Python developers?
2. Certifications: Are Python certifications worth it?
3. Course Recommendations: Any good advanced Python courses to recommend?
4. Workplace Tools: What Python libraries are indispensable in your professional work?
5. Interview Tips: What types of Python questions are commonly asked in interviews?
---
Let's help each other grow in our careers and education. Happy discussing! 🌟
/r/Python
https://redd.it/1emrh0k
Reddit
From the Python community on Reddit
Explore this post and more from the Python community
Which one should I use, for a login service?
I'm trying to decide between these approaches:
The endpoint:
data = request.get_json()
response, status = auth_service.login(data)
return jsonify(response), status
1:
if not validate_credentials(email, password):
logger.warning(......)
create_audit(......)
abort(401, description="Email or Password Incorrect")
# errors_handler.py
u/errors_blueprint.app_errorhandler(401)
def unauthorized(error):
response = {
"success": False,
"error": "Unauthorized",
"description": error.description,
}
return jsonify(response), 401
2:
if not validate_credentials(email, password):
raise InvalidCredential("Email or Password Incorrect")
# Create an error handler for exception, including status code into custom exception
# and a default message, include logging and audit
3:
if not validate_credentials(email, password):
logger.warning(......)
/r/flask
https://redd.it/1emsh7r
I'm trying to decide between these approaches:
The endpoint:
data = request.get_json()
response, status = auth_service.login(data)
return jsonify(response), status
1:
if not validate_credentials(email, password):
logger.warning(......)
create_audit(......)
abort(401, description="Email or Password Incorrect")
# errors_handler.py
u/errors_blueprint.app_errorhandler(401)
def unauthorized(error):
response = {
"success": False,
"error": "Unauthorized",
"description": error.description,
}
return jsonify(response), 401
2:
if not validate_credentials(email, password):
raise InvalidCredential("Email or Password Incorrect")
# Create an error handler for exception, including status code into custom exception
# and a default message, include logging and audit
3:
if not validate_credentials(email, password):
logger.warning(......)
/r/flask
https://redd.it/1emsh7r
Reddit
From the flask community on Reddit
Explore this post and more from the flask community
Free Python Camp Aug 25-30
SIGN UP: https://docs.google.com/forms/d/e/1FAIpQLSd3lpMmRSlLqMfCaAVkc-RY4h3MZBLjJdDr6QwaZBiGe3GHw/viewform
Code Catalyst Academy (August Session) is a FREE online summer coding camp for people of all ages. The camp will be held from August 25 to 30 at 5-6 PM CST. We will be exploring Python fundamentals as well as some more advanced topics. You must join our Discord server as that is where we will conduct the camp. The discord link is in the following form where you can sign up: https://docs.google.com/forms/d/e/1FAIpQLSd3lpMmRSlLqMfCaAVkc-RY4h3MZBLjJdDr6QwaZBiGe3GHw/viewform.
/r/Python
https://redd.it/1emw2sq
SIGN UP: https://docs.google.com/forms/d/e/1FAIpQLSd3lpMmRSlLqMfCaAVkc-RY4h3MZBLjJdDr6QwaZBiGe3GHw/viewform
Code Catalyst Academy (August Session) is a FREE online summer coding camp for people of all ages. The camp will be held from August 25 to 30 at 5-6 PM CST. We will be exploring Python fundamentals as well as some more advanced topics. You must join our Discord server as that is where we will conduct the camp. The discord link is in the following form where you can sign up: https://docs.google.com/forms/d/e/1FAIpQLSd3lpMmRSlLqMfCaAVkc-RY4h3MZBLjJdDr6QwaZBiGe3GHw/viewform.
/r/Python
https://redd.it/1emw2sq