惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

GbyAI
GbyAI
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Hugging Face - Blog
Hugging Face - Blog
IT之家
IT之家
Jina AI
Jina AI
Google DeepMind News
Google DeepMind News
大猫的无限游戏
大猫的无限游戏
The GitHub Blog
The GitHub Blog
腾讯CDC
L
LangChain Blog
P
Proofpoint News Feed
M
MIT News - Artificial intelligence
F
Fortinet All Blogs
量子位
Apple Machine Learning Research
Apple Machine Learning Research
Cloudbric
Cloudbric
B
Blog RSS Feed
B
Blog
C
CXSECURITY Database RSS Feed - CXSecurity.com
Vercel News
Vercel News
S
Schneier on Security
Project Zero
Project Zero
宝玉的分享
宝玉的分享
美团技术团队
MyScale Blog
MyScale Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Spread Privacy
Spread Privacy
T
Threatpost
A
Arctic Wolf
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Hacker News - Newest:
Hacker News - Newest: "LLM"
爱范儿
爱范儿
Recorded Future
Recorded Future
C
CERT Recently Published Vulnerability Notes
T
Threat Research - Cisco Blogs
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
SecWiki News
SecWiki News
H
Hacker News: Front Page
AWS News Blog
AWS News Blog
博客园_首页
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
T
Tor Project blog
C
Check Point Blog
L
Lohrmann on Cybersecurity
F
Full Disclosure
TaoSecurity Blog
TaoSecurity Blog
Google Online Security Blog
Google Online Security Blog
云风的 BLOG
云风的 BLOG
The Last Watchdog
The Last Watchdog
Martin Fowler
Martin Fowler

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) Top 15 Reinforcement Learning Questions That Will Appear in Exams The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant Common SOC 2 Failures (Real World) Stop Vibe-Checking Your AI App: A Practical Guide to Evals How to Use SonarQube and SonarScanner Locally to Level Up Your Code Quality Your Next To-Do App Is Dead — I Replaced Mine with an OpenClaw AI Sign a Nostr event in 60 lines of Python using coincurve — no nostr-sdk, no nbxplorer, no rust toolchain ITGC Audit Explained Like You’re in Big 4 Patch Tuesday abril 2026: Microsoft parcha 163 vulnerabilidades y un zero-day en SharePoint Stop scraping everything: a better way to track competitor price changes Listing on MCPize + the Official MCP Registry while routing payments OUTSIDE the marketplace — how I kept 100% of my x402 revenue Building an AI-Powered Risk Intelligence System Using Serverless Architecture Why We Ripped Function Overloading Out of Our AI Toolchain Testing AI-Generated Code: How to Actually Know If It Works SaaS Churn Is Killing Your Business. Here Is What to Do About It (Without a Support Team) The Speed of AI Is No Longer Linear - And Self-Improving Models Are Why How to Implement RBAC for MCP Tools: A Practical Guide for Engineering Teams From Standard Quote to Persuasive Proposal: AI Automation for Arborists I built a CLI that scaffolds complete multi-tenant SaaS apps Axios CVE-2025–62718: The Silent SSRF Bug That Could Be Hiding in Your Node.js App Right Now The dashboard that ended our friendship Data Pipelines Explained Simply (and How to Build Them with Python) The Hidden Cost of AI Systems Nobody Talks About. undefined vs undeclared, and how typeof behaves Switching from file-based jobs to NATS/Kafka in Rust without changing code io_uring Adventures: Rust Servers That Love Syscalls Why Agentic AI is Killing the Traditional Database The POUR principles of web accessibility for developers and designers Quantum Neural Network 3D — A Deep Dive into Interactive WebGL Visualization How To Install Caveman In Codex On macOS And Windows Automation Pipeline Reliability: Why Your Workflow Breaks When Nobody Is Watching I Built an 'Open World' AI Coding Agent — It Works From ANY Folder From Freelancing to Product: A Tech Service Company's SaaS Transformation China's AI Giants: Adding Tencent Hunyuan & ByteDance Doubao to AI University (74 Providers) On the Vibe Coders and Their Lies clerk: Auto-Summarize Your Claude Code Sessions AI Weekly — 2026/04/10–04/17 | The Model Lockdown Is Here, but the Toolchain Is the Real Battleground AI 週報 — 2026/04/10–2026/04/17 模型封鎖潮來了,但工具鏈才是真戰場 Maybe this is how Open-Source apps are born... 🚀 Fine-Tune LLMs with LoRA and QLoRA: 2026 Guide tRPC v11 + Next.js App Router: End-to-End Type Safety Without the Boilerplate ShadCN UI in 2026: Why I Stopped Installing Component Libraries and Started Owning My Components SaaS Billing in React Server Components: Stripe + Supabase Without a Single `useEffect` Join our DEV Weekend Challenge — $1,000 in Prizes Across TEN winners! Submissions Due April 20 at 6:59 AM UTC. Implementing FSRS Spaced Repetition in Flutter + Supabase — Adding Memory Science to an AI Learning App "I Texted My Localhost From the Train — Claude Code Fixed the Bug Before I Got Home" I Built a Sales Prep AI and It Went Deeper Than Expected Design to Code #2: One JSON, Eleven Outputs Solving the 100M-Row Problem: A Summary Table Pattern for High-Volume Push Notification Logs Flutter Web With Wasm: What Actually Changes For Developers I Built 50 Royalty-Free Soundtracks for My Side Project in a Weekend Using AI Music Generation The Vibe Coding Security Checklist: 7 Things to Check Before You Ship Stop Letting Googlebot Guess Fix Your React App's SEO Right Desconstruindo o Streaming do LinkedIn: Como Criar um Engine de Extração de Vídeo de Alta Performance com HLS e FFmpeg (EDA Part-1) EDA (Exploratory Data Analysis) Explained With Real Life — Why Looking at Your Data Is the Most Important Step in Machine Learning Brand Relationship Management at Scale: Our 4-Touch Outreach System for 200+ Brands Why String.fromEnvironment() Might Return an Empty String in Dart JGuardrails 1.0.0 — Hardening Java LLM Apps Against Jailbreaks, Toxicity, and Prompt Injection Plan and Schedule a Full Week of Threads Content From One Claude Conversation Coding Cat Oran Ep3, Five Tables Changed Everything Updated: BFF Pattern I'm done watching freelancers get buried by 200 proposals. So I'm building the alternative. This is my first post BFS Algorithm in Java Step by Step Tutorial with Examples Tracking LLM Pricing Monthly: An Open Dataset for 22 AI Models How We Measure Content ROI on a Comparison Site: Revenue Attribution Without Perfect Data Introducing Nova AI Ops: The AI-Native Operating System for SRE Teams I built a free desktop video downloader for Windows — Grabbit How Talkie OCR Helps Vision-Impaired & Dyslexic Users Read the World Around Them VRCFaceTracking安装和iPhone面捕配置教程,有bug Even CrowdStrike Can't See Your Agents The Automation Gold Rush: What n8n Workflows and Claude Are Opening Up for Developers Right Now
How Python Borrows Other People's Work
Akhilesh · 2026-04-20 · via DEV Community

You have been writing everything yourself from scratch.

Every function, every loop, every piece of logic. That is exactly right for learning. But out in the real world, nobody builds everything from zero.

Python has been around since 1991. In that time, developers have written and shared hundreds of thousands of packages. Tools for working with data. Tools for making web requests. Tools for generating random numbers. Tools for working with dates. Tools for training neural networks.

All of it free. All of it one command away.

Knowing how to find, install, and use other people's code is one of the most valuable skills you will develop. This post is where that starts.


The Standard Library: Already Installed

Python ships with a large collection of built-in modules called the standard library. You do not need to install them. They are already there.

import brings a module into your file.

import math

print(math.pi)
print(math.sqrt(16))
print(math.ceil(4.2))
print(math.floor(4.9))

Enter fullscreen mode Exit fullscreen mode

Output:

3.141592653589793
4.0
5
4

Enter fullscreen mode Exit fullscreen mode

math is a module. A module is just a Python file with useful functions inside it. When you write import math, Python finds that file and makes everything in it available under the math. prefix.


More Standard Library Modules Worth Knowing

import random

print(random.randint(1, 10))        # random integer between 1 and 10
print(random.choice(["a", "b", "c"]))   # random item from a list
numbers = [1, 2, 3, 4, 5]
random.shuffle(numbers)
print(numbers)                       # list in random order

Enter fullscreen mode Exit fullscreen mode

Output (yours will differ, it's random):

7
b
[3, 1, 5, 2, 4]

Enter fullscreen mode Exit fullscreen mode

import datetime

today = datetime.date.today()
print(today)

now = datetime.datetime.now()
print(now)

Enter fullscreen mode Exit fullscreen mode

Output:

2024-11-15
2024-11-15 14:32:07.482910

Enter fullscreen mode Exit fullscreen mode

import os

print(os.getcwd())              # current working directory
files = os.listdir(".")         # list files in current folder
print(files)

Enter fullscreen mode Exit fullscreen mode

os is important for file system work. Checking if paths exist, creating folders, listing directory contents. You'll use it a lot when building data pipelines.


Importing Specific Things

Sometimes you only need one function from a module. No need to import the whole thing.

from math import sqrt, pi

print(sqrt(25))
print(pi)

Enter fullscreen mode Exit fullscreen mode

Output:

5.0
3.141592653589793

Enter fullscreen mode Exit fullscreen mode

Now you call sqrt directly without math. in front. Cleaner for functions you use constantly.

You can also give imports a shorter name.

import numpy as np
import pandas as pd

Enter fullscreen mode Exit fullscreen mode

You haven't installed these yet but when you do, this is how every single tutorial and professional uses them. np for NumPy. pd for Pandas. It is so universal that using any other name would confuse people reading your code.


pip: Installing Packages From the Internet

The standard library is big but it doesn't have everything. The Python Package Index, PyPI, hosts over 500,000 additional packages contributed by developers worldwide.

pip is the tool that downloads and installs them.

Open your terminal. Not inside Python. Your regular terminal or VS Code's integrated terminal.

pip install requests

Enter fullscreen mode Exit fullscreen mode

That's it. Python downloads the requests package and installs it. Now you can use it in any Python file on your machine.

Try a few packages that you'll use constantly in this series.

pip install requests
pip install numpy
pip install pandas
pip install matplotlib

Enter fullscreen mode Exit fullscreen mode

Each one downloads and installs. Takes a few seconds each.

Now use requests to make a real web request.

import requests

response = requests.get("https://api.github.com")
print(response.status_code)
print(type(response.json()))

Enter fullscreen mode Exit fullscreen mode

Output:

200
<class 'dict'>

Enter fullscreen mode Exit fullscreen mode

Your Python code just talked to GitHub's server and got a response back. Status code 200 means success. The response came back as a dictionary. Real data from the real internet.


Virtual Environments: Keep Projects Separate

Here is a problem that will bite you eventually.

Project A needs version 1.0 of some package. Project B needs version 2.0 of the same package. If you install packages globally, one of those projects breaks.

Virtual environments solve this. Each project gets its own isolated space with its own packages.

python -m venv myenv

Enter fullscreen mode Exit fullscreen mode

This creates a folder called myenv with a complete isolated Python installation inside.

Activate it:

# Windows
myenv\Scripts\activate

# Mac and Linux
source myenv/bin/activate

Enter fullscreen mode Exit fullscreen mode

Your terminal prompt changes to show the environment name. Now any pip install goes into that environment only, not the global Python.

When you're done:

deactivate

Enter fullscreen mode Exit fullscreen mode

For every serious project you start from this series onward, create a virtual environment first. It is a small habit that prevents big headaches.


requirements.txt: Sharing Your Setup

When you share a project with someone or deploy it to a server, they need to know which packages to install.

requirements.txt is the standard way.

pip freeze > requirements.txt

Enter fullscreen mode Exit fullscreen mode

This saves every installed package and its version to a text file. Open it and it looks like this:

numpy==1.26.0
pandas==2.1.1
requests==2.31.0
matplotlib==3.8.0

Enter fullscreen mode Exit fullscreen mode

Anyone who gets your project runs one command to install everything at once:

pip install -r requirements.txt

Enter fullscreen mode Exit fullscreen mode

Start doing this now. Even for small projects. It is a professional habit that costs nothing.


Writing Your Own Module

Any Python file you write is a module that other files can import.

Create a file called helpers.py:

def greet(name):
    return f"Hello, {name}!"

def add(a, b):
    return a + b

PI = 3.14159

Enter fullscreen mode Exit fullscreen mode

Now in a different file in the same folder:

import helpers

print(helpers.greet("Alex"))
print(helpers.add(5, 3))
print(helpers.PI)

Enter fullscreen mode Exit fullscreen mode

Output:

Hello, Alex!
8
3.14159

Enter fullscreen mode Exit fullscreen mode

Python found helpers.py in the same folder and imported everything from it. Your own reusable code, organized into modules, is how larger programs stay manageable.


Try This

Create modules_practice.py.

Part one: use the random module to build a simple dice roller. Roll two dice, each between 1 and 6. Print the result of each die and the total. Run it five times using a loop to make sure randomness is working.

Part two: use the datetime module to print today's date in a nice readable format like "Today is November 15, 2024." Look up strftime to format it properly. The search term is "python datetime strftime format codes."

Part three: create a file called calculator.py with four functions: add, subtract, multiply, and divide. Import that file in modules_practice.py and use each function at least once.

Part four: if you haven't already, install requests using pip and make a GET request to https://jsonplaceholder.typicode.com/users/1. Print the name and email from the response. It comes back as a dictionary.


What's Next

Phase 1 is almost done. Two more posts left. Next is list comprehensions, a cleaner way to build lists that you will see everywhere in Python code and will want to use immediately once you understand it.