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
scamming the scammers with python

Source code: https://github.com/IdanHajbeko/revenge\_on\_scammers/

What my Project Does

This Python script sends numerous requests to scam websites using fake but valid credit card information. Each request incurs a small fee for the scammer's payment processor, making their scams costly. Additionally, it floods their login pages with fake usernames and passwords, making it harder for them to sift through and find real credentials.

Target Audience
This script is intended for people who have basic knowledge of Python(or advanced) and want to take down phishing scams.

/r/Python
https://redd.it/1do3dd2
Help with Flask project

Hi, I'm a student currently who has a flask assignment to build a API webserver. I've missed out on a few lessons (I've been sick) and now I'm lost af. I don't know what I'm doing and im stressed out.

Is anyone free to link up on discord? And walk me through a few things?

/r/flask
https://redd.it/1do34jg
R I finetuned GPT-2 and BERT 135,000 times to see if it's fair to pretrain on unlabeled text from the test set

TL;DR: seems fair.

Everyone knows that training on labeled test data is a big no-no if you wanna use that data for evaluation.

But if you pretrain on unlabeled test data, can you still use that data during evaluation?

Let's run an experiment on 25 text classification datasets, two LMs whose pretraining data we're pretty sure are not already contaminated, and across a few settings for the number of training and test observations.

For each dataset, the experiment sanity checks that pretraining on unlabeled text (independent of the test set) helps, i.e., that there's an effect to detect. Call this the pretraining boost. Next, the experiment evaluates the bias from pretraining on unlabeled text from the test set instead of unlabeled independent text. Call this the evaluation bias.

# Results

​

m=50 is based on the Real-world Annotated Few-shot Tasks \(RAFT\) benchmark \(https:\/\/arxiv.org\/abs\/2109.14076\), which also contains the inspiration for this question: “For each task, we release a public training set with 50 examples and a larger unlabeled test set. We encourage unsupervised pre-training on the unlabelled examples…”. The distributions above are those of marginal effects: averaged across 2 LM types, the 25 classification tasks, and their subsamples.

Stretching the intention of “few” in few-shot here. I wanted to

/r/MachineLearning
[https://redd.it/1do2g03
What’s so bad about hosting static HTML with Django?

I've seen people online citing security concerns, how exactly is it insecure vs a NGINX server?


Let me explain my position further:

I usually just spin up a Dockerized Django + Django Ninja API and consume the API with a separate, Dockerized React/Vue static frontend. Now that's two Docker containers in the limited space of my RPi's SD card.

I then discovered that, through some url patterns and some custom template view, I could just export the React/Vue as static HTML as usual, point Django to that path and have Django serve the "index.html" at Django's "/". Now I only need to deploy one Docker container, and I don't need two repos for one app. What's the catch here?

/r/django
https://redd.it/1do4ce2
Form Validation where a user can upload a file or paste its contents.

I've got a a form that I want to allow the user to either upload a json file, or paste the json in a textarea field. Generating the form works fine. However I'm a little stumped about how to validate the data.

How is validation performed against a file upload form field?



/r/django
https://redd.it/1dobcc5
My simple tech stack for building apps (in 2024)

After meeting u/neogener today, I realised that some people might find it helpful to understand what a simple, robust, production tech stack looks like - particularly for a team of 1-5 people.

So here's my simple tech stack for building software in 2024 🎨

(Hand drawn by me 🙂)

* = things I don't use at the start. Most of these asterisked tools are optimisations, which I only need in certain situations.

As an example app, my product (https://photondesigner.com) uses this stack.

TLDR: you don't need many of the technologies that people say you need.

https://preview.redd.it/0ehduf3tcr8d1.jpg?width=2667&format=pjpg&auto=webp&s=d4a100f35dd9e14da424666ebd52e051d209aabe




/r/django
https://redd.it/1doccjh
How to start and stop script from django admin panel

I am continuously scrapping some website so for that website i am making bunch of accounts. I am storing these info into below model

class BotAccount(AppBaseModel):
username = models.CharField(maxlength=20)
password = models.CharField(max
length=100)
deviceid = models.CharField(maxlength=100)
active = models.BooleanField(default=False)

if active is true then that particular bot will automatically login and start scrapping into websites (scrapping script is ready). Its a while condition that goes on forever until BotAccount.objects.first().acive == False

So from admin panel if i uncheck this bot automatically stops. and if checked then bot start working

How do i do this in Django so that whole thing will run in background

/r/django
https://redd.it/1dodz91
N ESM3: Simulating 500 million years of evolution with a language model

Blog post: https://www.evolutionaryscale.ai/blog/esm3-release

Pre-print (pending approval): https://evolutionaryscale-public.s3.us-east-2.amazonaws.com/research/esm3.pdf

Abstract:

> More than three billion years of evolution have
produced an image of biology encoded into the
space of natural proteins. Here we show that language models trained on tokens generated by evolution can act as evolutionary simulators to generate functional proteins that are far away from
known proteins. We present ESM3, a frontier
multimodal generative language model that reasons over the sequence, structure, and function
of proteins. ESM3 can follow complex prompts
combining its modalities and is highly responsive
to biological alignment. We have prompted ESM3
to generate fluorescent proteins with a chain of
thought. Among the generations that we synthesized, we found a bright fluorescent protein at far
distance (58% identity) from known fluorescent
proteins. Similarly distant natural fluorescent proteins are separated by over five hundred million
years of evolution

The first huge release by EvolutionaryScale after spinning off Meta.

Weights and code are released, but with big caveats

From HuggingFace:

https://www.evolutionaryscale.ai/legal/community-license-agreement

The Big Picture:

The EvolutionaryScale AI Model is only available under this Community License Agreement for non-commercial use by individuals or non-commercial organizations.
You may not use the EvolutionaryScale AI Model or any derivative works of the EvolutionaryScale AI Model or its outputs:

a. in connection with any commercial activities, for example

b. to develop any product or service such

/r/MachineLearning
https://redd.it/1do91g9
GeoPandas 1.0 released!

A good 10 years after it's first 0.1 release, GeoPandas just tagged their 1.0 release!

Release page: [https://github.com/geopandas/geopandas/releases/tag/v1.0.0](https://github.com/geopandas/geopandas/releases/tag/v1.0.0)
Changelog: https://geopandas.org/en/latest/docs/changelog.html
1.0 tracking issue: [https://github.com/geopandas/geopandas/issues/3201](https://github.com/geopandas/geopandas/issues/3201)
1.0 milestone: https://github.com/geopandas/geopandas/milestone/4?closed=1

About GeoPandas

>GeoPandas is an open source project to make working with geospatial data in python easier. GeoPandas extends the datatypes used by pandas to allow spatial operations on geometric types. Geometric operations are performed by shapely. Geopandas further depends on pyogrio for file access and matplotlib for plotting.

/r/Python
https://redd.it/1do71es
Modern Notepad using PyQt6 UPDATE | ZenNotes

# What does my Project do?

ZenNotes is a minimalistic Notepad app with a sleek design inspired by Fluent Design. It offers the familiar look of the Windows Notepad while having much more powerful features like Translate, TTS, etc.

Text to Speech
Markdown support
Translation
Get Wikipedia Articles

And much more.

# Target Audience

People who want a better but similar experience and look as that of Windows Notepad

# Comparison

Unlike Windows Notepad, it has support for Markdown, TTS, etc

Moreover, it has a great UI.

# Update

This is an update post to this

# GitHub

GitHub Link: https://github.com/rohankishore/ZenNotes

/r/Python
https://redd.it/1do46ez
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/1doks2x
FleetTrack - A vehicle fleet tracking application. (FastAPI, Kafka, Metabase)

What my project does

FleetTrack is an application focused on collection, storage and analytics of realtime data received from vehicles.

Github: https://github.com/pratik-choudhari/FleetTrack

Target Audience

I built this as a portfolio project

Comparison

I did not find any alternatives. Whatever is available is closed source.

I created this project to showcase my data engineering skills. I would love any feedback for features I can add into this project!

/r/Python
https://redd.it/1dobox5
🚀 Unleash the Power of Automation with My Naukri.com Job Apply Bot! 🖥️💼 | Boost Your Job Search E

👋 Hi dudes!



I’ve made a job apply bot that applies for jobs on Naukri.com. The bot does all the heavy lifting of applying and answering questions during the process using Gemini AI. All you need to do is give it a list of job links you want to apply to. 😎





🔹 How It Works:



1. Reads job links from a CSV file 📄

2. Navigates to each job listing 🖥️

3. Applies if not already applied or expired 📝

4. Uses Gemini AI to answer application questions 💬



🔹 Setup:



1. Install Python & Selenium 🐍

2. Get Geckodriver for Firefox 🦊

3. Configure your paths and profile 📁

4. Run the script and let it handle the rest! 🚀



Ready to give it a try? Check out the link for the full setup guide and script. 🛠️

Github Link: https://github.com/GoliathReaper/JobSailor

Contributions to make the code better are very much welcomed.





/r/Python
https://redd.it/1dopju4
Deploying website

As the title states I am trying to deploy my first website with flask and I am having some difficulties. I was following a tutorial on how to deploy with heroku but I keep getting the issue with gunicorn not being installed even though I checked the requirements.txt. Has anyone had a similar issue or a better deployment service all together.
Error message in question: /bin/bash: line 1: gunicorn: command not found


/r/flask
https://redd.it/1dorf79
Looking Under the Hood of Python's Set Data Structure

This article dissects how Python implements the Set data structure. It covers a background on hash tables along with implementation of the key Set APIs: insertion, contains, removal and pop. A good way to learn how hash tables are implemented for real-world use cases.

https://blog.codingconfessions.com/p/cpython-set-implementation

/r/Python
https://redd.it/1dowa49
Share your ruff config.

I'm stressed because I couldn't always figure out the standard style to match most people. Please share your ruff.toml config for your go-to with Python that you use across all your projects. If possible, please share the config via gist.github.com

/r/Python
https://redd.it/1dp4jrm
SQLAlchemy vs Flask-SQLAlchemy

Hi! I have a hobby Flask app that I'm pitching for internal use at my company. I set it up using regular SQLAlchemy, I can't remember why I chose this over Flask-SQLAlchemy, and it connects to a MySQL database.


I'm now trying to build out a login functionality and am running into issues since the tutorials I'm following use the Flask plugin (mostly issues with circular imports). Should I just move everything over to Flask-SQLAlchemy or is there a way to do it with what I've got? Is either method the preferred way of doing things?

/r/flask
https://redd.it/1dp60rt
Speech to Text using Python, anyone?

I am writing a Python script to take my M4A or WAV file and perform speech-to-text on it. I tried several different APIs including ffmpeg with no good results.


Has anyone had success doing this and how?

/r/Python
https://redd.it/1dp632p
SQLAlchemy vs Flask-SQLAlchemy

Hi! I have a hobby Flask app that I'm pitching for internal use at my company. I set it up using regular SQLAlchemy, I can't remember why I chose this over Flask-SQLAlchemy, and it connects to a MySQL database.


I'm now trying to build out a login functionality and am running into issues since the tutorials I'm following use the Flask plugin (mostly issues with circular imports). Should I just move everything over to Flask-SQLAlchemy or is there a way to do it with what I've got? Is either method the preferred way of doing things?

/r/flask
https://redd.it/1dp60d3