✨ evaluation | AI Coding Glossary ✨
📖 The process of measuring how well an AI system or model meets its objectives.
🏷️ #Python
📖 The process of measuring how well an AI system or model meets its objectives.
🏷️ #Python
❤1
✨ vector | AI Coding Glossary ✨
📖 An ordered array of numbers that represents a point, magnitude, and direction.
🏷️ #Python
📖 An ordered array of numbers that represents a point, magnitude, and direction.
🏷️ #Python
✨ Meet Our Team ✨
📖 Meet Real Python's team of expert Python developers, educators, and 190+ contributors bringing real-world experience to create practical Python education.
🏷️ #Python
📖 Meet Real Python's team of expert Python developers, educators, and 190+ contributors bringing real-world experience to create practical Python education.
🏷️ #Python
✨ Pydantic AI | AI Coding Tools ✨
📖 A Python framework for building typed LLM agents leveraging Pydantic.
🏷️ #Python
📖 A Python framework for building typed LLM agents leveraging Pydantic.
🏷️ #Python
✨ Google Antigravity | AI Coding Tools ✨
📖 An agent-first IDE where AI agents operate the editor, terminal, and browser and produce verifiable Artifacts of their work.
🏷️ #Python
📖 An agent-first IDE where AI agents operate the editor, terminal, and browser and produce verifiable Artifacts of their work.
🏷️ #Python
✨ nearest neighbor | AI Coding Glossary ✨
📖 The data point in a reference set that has the smallest distance to a query point.
🏷️ #Python
📖 The data point in a reference set that has the smallest distance to a query point.
🏷️ #Python
✨ autoregressive generation | AI Coding Glossary ✨
📖 A method in which a model produces a sequence one token at a time, with each token conditioned on all previously generated tokens.
🏷️ #Python
📖 A method in which a model produces a sequence one token at a time, with each token conditioned on all previously generated tokens.
🏷️ #Python
Ready Python script: takes a regular PDF and creates a password-protected copy.
pip install PyPDF2
from __future__ import annotations
from pathlib import Path
from typing import Union
from PyPDF2 import PdfReader, PdfWriter
PDFPath = Union[str, Path]
def encrypt_pdf(input_path: PDFPath, output_path: PDFPath, password: str) -> Path:
"""
Encrypts a PDF file with a password and saves it to output_path.
Returns the path to the encrypted file.
"""
in_path = Path(input_path)
out_path = Path(output_path)
reader = PdfReader(in_path)
writer = PdfWriter()
for page in reader.pages:
writer.add_page(page)
writer.encrypt(password)
with out_path.open("wb") as f:
writer.write(f)
return out_path
def encrypt_with_suffix(input_path: PDFPath, password: str, suffix: str = "_encrypted") -> Path:
"""
Creates an encrypted copy next to the original file.
For example: secret.pdf → secret_encrypted.pdf
"""
in_path = Path(input_path)
output_path = in_path.with_name(f"{in_path.stem}{suffix}{in_path.suffix}")
return encrypt_pdf(in_path, output_path, password)
if __name__ == "__main__":
pdf_file = "secret.pdf"
pdf_password = "pythontoday"
encrypted_path = encrypt_with_suffix(pdf_file, pdf_password)
print(f"Encrypted file created: {encrypted_path}")
#python #code #tipsandtricks
https://t.iss.one/DataScience4
Please open Telegram to view this post
VIEW IN TELEGRAM
❤4👍1
✨ Sponsorship Opportunities ✨
📖 By sponsoring Real Python you will reach a demographic of Python software engineers dedicated to improving their craft and their professional careers. We offer our clients multiple touchpoints across our platforms, ensuring your message cuts through to our audience.
🏷️ #Python
📖 By sponsoring Real Python you will reach a demographic of Python software engineers dedicated to improving their craft and their professional careers. We offer our clients multiple touchpoints across our platforms, ensuring your message cuts through to our audience.
🏷️ #Python
❤1
✨ latency | AI Coding Glossary ✨
📖 The elapsed time between a request and the observable response.
🏷️ #Python
📖 The elapsed time between a request and the observable response.
🏷️ #Python
✨ telemetry | AI Coding Glossary ✨
📖 The automated collection and transmission of measurements or event data from remote or distributed systems.
🏷️ #Python
📖 The automated collection and transmission of measurements or event data from remote or distributed systems.
🏷️ #Python
👍1
🔥2❤1
✨ large reasoning model (LRM) | AI Coding Glossary ✨
📖 A language model optimized for multi-step problem solving.
🏷️ #Python
📖 A language model optimized for multi-step problem solving.
🏷️ #Python
✨ Devin | AI Coding Tools ✨
📖 An AI coding agent that acts as a collaborative software engineering teammate.
🏷️ #Python
📖 An AI coding agent that acts as a collaborative software engineering teammate.
🏷️ #Python