560 blogs tracked7,114 posts indexed

Search

30 results for “python” · titles, summaries and bodies · ranked by relevance

Python Bindings: Calling C or C++ From Python (opens on the source site)

Are you a Python developer with a C or C++ library you’d like to use from Python? If so, then Python bindings allow you to call functions and pass data from Python to C or C++, letting you take advantage of the strengths of both languages. Throughout this tutorial, you’ll see an overview of some of the tools you can use to create Python bindings. In this tutorial, you’ll learn about: Why you want to call C or C++ from Python How to pass data between C and Python What tools and methods can help you create Python bindings This tutorial is aimed at intermediate Python developers. It assumes…

excerpt only · body stays at the source
From the web

Quiz: How to Use Python: Taking Your First Steps (opens on the source site)

In this quiz, you’ll test your understanding of How to Use Python: Taking Your First Steps. By working through this quiz, you’ll revisit Python’s readable syntax, keywords and variables, built-in data types, indentation and code blocks, functions, the difference between syntax errors and exceptions, coding tools, and PEP 8. These are the building blocks that everything else in Python rests on, so take your time with each question. [ Improve Your Python With 🐍 Python Tricks 💌 – Get a short & sweet Python Trick delivered to your inbox every couple of days. >> Click here to learn more and see…

excerpt only · body stays at the source
From the web

The Real Python Podcast – Episode #313: Python 3.15: Exploring the New Features (opens on the source site)

Python 3.15 is (almost*) here! Christopher Trudeau and Bartosz Zaczyński return to discuss the new version. Bartosz coordinated the series of preview articles with members of the Real Python team and wrote the showcase tutorial, "Python 3.15: Cool New Features for You to Try." Christopher's video course "What's New in Python 3.15" covers the topics from the article and shows the new features in action. [ Improve Your Python With 🐍 Python Tricks 💌 – Get a short & sweet Python Trick delivered to your inbox every couple of days. >> Click here to learn more and see examples ]

excerpt only · body stays at the source
From the web

Quiz: Python Conditional Statements (opens on the source site)

Test your understanding of Python conditional statements. Take this quiz after reading our Conditional Statements in Python tutorial. [ Improve Your Python With 🐍 Python Tricks 💌 – Get a short & sweet Python Trick delivered to your inbox every couple of days. >> Click here to learn more and see examples ]

excerpt only · body stays at the source
From the web

Quiz: Documenting Python Code: A Complete Guide (opens on the source site)

In this quiz, you’ll test your understanding of Documenting Python Code. This tutorial covers the importance of documentation, the differences between commenting and documenting, the use of docstrings, and the necessary elements for documenting your Python projects. With this knowledge, you’ll be able to effectively document your Python scripts and projects, making them more understandable and maintainable. [ Improve Your Python With 🐍 Python Tricks 💌 – Get a short & sweet Python Trick delivered to your inbox every couple of days. >> Click here to learn more and see examples ]

excerpt only · body stays at the source
From the web

Write SQL Your Way: Dual Parameter Style Benefits in mssql-python (opens on the source site)

Reviewed by: Sumit Sarabhai If you’ve been writing SQL in Python, you already know the debate: positional parameters (?) or named parameters (%(name)s)? Some developers swear by the conciseness of positional. Others prefer the clarity of named. With mssql-python, you no longer need to choose – we support both. We’ve added dual parameter style support to mssql-python, enabling both qmark and pyformat parameter styles in Python […] The post Write SQL Your Way: Dual Parameter Style Benefits in mssql-python appeared first on Microsoft for Python Developers Blog.

azurepythonexcerpt only · body stays at the source
From the web

Quiz: A Guide to Modern Python String Formatting Tools (opens on the source site)

Test your understanding of Python’s tools for string formatting, including f-strings and the .format() method. Take this quiz after reading our A Guide to Modern Python String Formatting Tools tutorial. [ Improve Your Python With 🐍 Python Tricks 💌 – Get a short & sweet Python Trick delivered to your inbox every couple of days. >> Click here to learn more and see examples ]

excerpt only · body stays at the source
From the web

Quiz: Python 3.15 Preview: Sentinel Values (opens on the source site)

In this quiz, you’ll test your understanding of Python 3.15 Preview: Sentinel Values. By working through this quiz, you’ll revisit what sentinel values are, where the classic object() idiom falls short, and how Python 3.15’s built-in sentinel type gives you readable signatures, precise type hints, and identity that survives copying and pickling. You’ll also practice deciding when a sentinel beats None, so you’ll know exactly which object() markers in your own code are worth replacing once you upgrade. [ Improve Your Python With 🐍 Python Tricks 💌 – Get a short & sweet Python Trick delivered…

excerpt only · body stays at the source
From the web

Quiz: Python 3.15 Preview: frozendict (opens on the source site)

In this quiz, you’ll test your understanding of Python 3.15 Preview: frozendict. By working through this quiz, you’ll revisit how to build a frozen mapping, why it isn’t a dict subclass, what it takes to make one hashable, and exactly where the freeze stops. Python 3.15 finally gives dictionaries the immutable counterpart that lists and sets have had for years. [ Improve Your Python With 🐍 Python Tricks 💌 – Get a short & sweet Python Trick delivered to your inbox every couple of days. >> Click here to learn more and see examples ]

excerpt only · body stays at the source
From the web

Quiz: Python and TOML: Read, Write, and Configure with tomllib (opens on the source site)

In this quiz, you’ll test your understanding of Python and TOML: Read, Write, and Configure with tomllib. By working through this quiz, you’ll revisit TOML syntax, including key-value pairs, tables, arrays, and dates. You’ll also practice loading TOML with tomllib, writing it with tomli_w, and editing existing documents with tomlkit without losing comments or formatting. [ Improve Your Python With 🐍 Python Tricks 💌 – Get a short & sweet Python Trick delivered to your inbox every couple of days. >> Click here to learn more and see examples ]

excerpt only · body stays at the source
From the web

Quiz: What Are Python Asterisk and Slash Special Parameters For? (opens on the source site)

In this quiz, you’ll test your understanding of What Are Python Asterisk and Slash Special Parameters For?. By working through this quiz, you’ll revisit how the bare asterisk and the slash split a function’s parameters into positional-only, positional-or-keyword, and keyword-only groups. You’ll also review how they relate to *args and how they help you keep your functions backward compatible. [ Improve Your Python With 🐍 Python Tricks 💌 – Get a short & sweet Python Trick delivered to your inbox every couple of days. >> Click here to learn more and see examples ]

Newexcerpt only · body stays at the source
From the web

Quiz: Defining Your Own Python Function (opens on the source site)

In this quiz, you’ll test your understanding of Defining Your Own Python Function. You’ll revisit how to define a function with the def keyword, specify parameters, pass arguments, and call your functions to make code modular and reusable. You’ll also see how functions help organize and maintain your Python projects. Ready to demonstrate your skills? Let’s begin! [ Improve Your Python With 🐍 Python Tricks 💌 – Get a short & sweet Python Trick delivered to your inbox every couple of days. >> Click here to learn more and see examples ]

excerpt only · body stays at the source
From the web

Quiz: Python Web Applications: Deploy Your Script as a Flask App (opens on the source site)

In this quiz, you’ll test your understanding of Python Web Applications: Deploy Your Script as a Flask App. By working through this quiz, you’ll revisit what separates a web application from a static site, how Flask connects URLs to your Python functions, how to read and escape what your users type, and what it takes to get your code running on Google App Engine. [ Improve Your Python With 🐍 Python Tricks 💌 – Get a short & sweet Python Trick delivered to your inbox every couple of days. >> Click here to learn more and see examples ]

excerpt only · body stays at the source
From the web

Python for Loops: The Pythonic Way (opens on the source site)

Python’s for loop allows you to iterate over the items in a collection, such as lists, tuples, strings, and dictionaries. The for loop syntax declares a loop variable that takes each item from the collection in each iteration. This loop is ideal for repeatedly executing a block of code on each item in the collection. You can also tweak for loops further with features like break, continue, and else. By the end of this tutorial, you’ll understand that: Python’s for loop iterates over items in a data collection, allowing you to execute code for each item. To iterate from 0 to 10, you use the for…

excerpt only · body stays at the source
From the web

The Real Python Podcast – Episode #318: Free-Threaded Python: Why Python Devs Should Know About the ABI (opens on the source site)

Why should every Python developer know about the CPython ABI? This week on the show, we speak with Nathan Goldbaum about free-threaded Python and the changes to the Python Application Binary Interface. [ Improve Your Python With 🐍 Python Tricks 💌 – Get a short & sweet Python Trick delivered to your inbox every couple of days. >> Click here to learn more and see examples ]

excerpt only · body stays at the source
From the web

Basic Data Types in Python: A Quick Exploration (opens on the source site)

Python data types are fundamental to the language, enabling you to represent various kinds of data. You use basic data types like int, float, and complex for numbers, str for text, bytes and bytearray for binary data, and bool for Boolean values. These data types form the core of most Python programs, allowing you to handle numeric, textual, and logical data efficiently. Understanding Python data types involves recognizing their roles and how to work with them. You can create and manipulate these data types using built-in functions and methods, and convert between them when necessary. By the…

excerpt only · body stays at the source
From the web

Introduction to Python SQL Libraries (opens on the source site)

All software applications interact with data, most commonly through a database management system (DBMS). Some programming languages come with modules that you can use to interact with a DBMS, while others require the use of third-party packages. In this tutorial, you’ll explore the different Python SQL libraries that you can use. You’ll develop a straightforward application to interact with SQLite, MySQL, and PostgreSQL databases. In this tutorial, you’ll learn how to: Connect to different database management systems with Python SQL libraries Interact with SQLite, MySQL, and PostgreSQL…

excerpt only · body stays at the source
From the web

The Real Python Podcast – Episode #317: Demystifying Python Memory Management & Choosing a Project Layout (opens on the source site)

How does Python manage memory behind the scenes? What are the common ways to lay out a Python project? Christopher Trudeau is back on the show this week with another batch of PyCoder's Weekly articles and projects. [ Improve Your Python With 🐍 Python Tricks 💌 – Get a short & sweet Python Trick delivered to your inbox every couple of days. >> Click here to learn more and see examples ]

excerpt only · body stays at the source
From the web

Quiz: Python's collections: A Buffet of Specialized Data Types (opens on the source site)

In this quiz, you’ll test your understanding of Python’s collections: A Buffet of Specialized Data Types. Python’s collections module provides specialized container data types that approach specific programming problems more clearly and more efficiently than the general purpose built-ins do. You’ll revisit namedtuple() for readable code, deque for queues and stacks, defaultdict for missing keys, OrderedDict for ordering, Counter for tallies, ChainMap for multiple mappings, and the wrapper classes for customizing built-ins. [ Improve Your Python With 🐍 Python Tricks 💌 – Get a short & sweet…

excerpt only · body stays at the source
From the web

Quiz: What's New in Python 3.15 (opens on the source site)

In this quiz, you’ll test your understanding of What’s New in Python 3.15. By working through this quiz, you’ll revisit lazy imports, unpacking in comprehensions, frozendict, the new sentinel() built-in, friendlier error messages, the new sampling profiler, and UTF-8 as the default encoding. These are the features you’re most likely to reach for once you upgrade, so getting to know them now gives you a head start. [ Improve Your Python With 🐍 Python Tricks 💌 – Get a short & sweet Python Trick delivered to your inbox every couple of days. >> Click here to learn more and see examples ]

excerpt only · body stays at the source
From the web

The Real Python Podcast – Episode #316: The Future of Python Security: Trends, Challenges, and Solutions (opens on the source site)

How is the Python ecosystem adapting to the modern landscape of software security and supply chain defense? This week on the show, we sit down with Seth Larson, the Python Software Foundation's Security Developer in Residence. [ Improve Your Python With 🐍 Python Tricks 💌 – Get a short & sweet Python Trick delivered to your inbox every couple of days. >> Click here to learn more and see examples ]

excerpt only · body stays at the source
From the web

Operators and Expressions in Python (opens on the source site)

Python operators enable you to perform computations by combining objects and operators into expressions. Understanding Python operators is essential for manipulating data effectively. This tutorial covers arithmetic, comparison, Boolean, identity, membership, bitwise, concatenation, and repetition operators, along with augmented assignment operators. You’ll also learn how to build expressions using these operators and explore operator precedence to understand the order of operations in complex expressions. By the end of this tutorial, you’ll understand that: Arithmetic operators perform…

excerpt only · body stays at the source
From the web

Object-Oriented Programming in Python vs Java (opens on the source site)

Java programmers making a move to Python often struggle with Python’s approach to object-oriented programming (OOP). The approach to working with objects, variable types, and other language capabilities taken by Python vs Java are quite different. It can make switching between both languages very confusing. This article compares and contrasts object-oriented programming support in Python vs Java. By the end, you’ll be able to apply your knowledge of object-oriented programming to Python, understand how to reinterpret your understanding of Java objects to Python, and use objects in a Pythonic…

excerpt only · body stays at the source
From the web

How to Install Python on Your System: A Guide (opens on the source site)

To learn how to install Python on your system, you can follow a few straightforward steps. First, check if Python is already installed by opening a command-line interface and typing python --version or python3 --version. You can install Python on Windows using the official installer from Python.org or through the Microsoft Store. On macOS, you can use the official installer or Homebrew. For Linux, use your package manager or build Python from source. By the end of this tutorial, you’ll understand how to: Check if Python is installed by running python --version or python3 --version in a…

excerpt only · body stays at the source
From the web

The Real Python Podcast – Episode #320: Optimizing Python Performance & Building a Django Static Site (opens on the source site)

What goes into moving from profiling the performance of a Python program to optimizing it? What are common techniques you should consider for speeding up your code, and which ones should you avoid? Christopher Trudeau is back on the show this week with another batch of PyCoder's Weekly articles and projects. [ Improve Your Python With 🐍 Python Tricks 💌 – Get a short & sweet Python Trick delivered to your inbox every couple of days. >> Click here to learn more and see examples ]

excerpt only · body stays at the source
From the web

Quiz: Python's len() Function (opens on the source site)

In this quiz, you’ll test your understanding of Python’s len() Function. By working through this quiz, you’ll revisit which objects len() accepts, how it behaves with NumPy arrays and pandas DataFrames, and how to support it in your own classes. Along the way, you’ll see why one small function can work on everything from built-in containers to the classes you write. [ Improve Your Python With 🐍 Python Tricks 💌 – Get a short & sweet Python Trick delivered to your inbox every couple of days. >> Click here to learn more and see examples ]

excerpt only · body stays at the source
From the web

The Real Python Podcast – Episode #315: Python Pitfalls: Common Mistakes and How to Avoid Them (opens on the source site)

What are common mistakes that Python beginners make, and how do you avoid them? Christopher Trudeau is back on the show this week with another batch of PyCoder's Weekly articles and projects. [ Improve Your Python With 🐍 Python Tricks 💌 – Get a short & sweet Python Trick delivered to your inbox every couple of days. >> Click here to learn more and see examples ]

excerpt only · body stays at the source
From the web

Quiz: Python Coding Interview Practice: Prefix Sums and Binary Search (opens on the source site)

In this quiz, you’ll test your understanding of Python Coding Interview Practice: Prefix Sums and Binary Search. By working through this quiz, you’ll revisit how prefix totals turn range sums into subtraction, what to store about earlier prefixes, how a search interval shrinks safely, and how to choose an approach from a problem’s constraints. [ Improve Your Python With 🐍 Python Tricks 💌 – Get a short & sweet Python Trick delivered to your inbox every couple of days. >> Click here to learn more and see examples ]

excerpt only · body stays at the source
From the web

Privacy choices

Reading never requires analytics. These choices last 90 days on this browser.

Essential sign-in and security storage always stays on. Read the privacy notice.