Write Unit Tests for Your Python Code With ChatGPT
Real Python
by Real Python
18h ago
Having a good battery of tests for your code may be a requirement for many Python projects. In practice, writing unit tests is hard and can take a lot of time and effort. Therefore, some developers don’t like to write them. However, with large language models (LLMs) and tools like ChatGPT, you can quickly create robust and complete sets of tests for your Python code. In Python, you can use multiple different tools for writing tests. The most commonly used tools include doctest, unittest, and pytest. ChatGPT can be of great help in writing tests with any of these tools. In this tutorial, you’l ..read more
Visit website
Python's unittest: Writing Unit Tests for Your Code
Real Python
by Real Python
3d ago
In this quiz, you’ll test your understanding of testing your Python code with the unittest framework. Testing in Python is a huge topic and can come with a lot of complexity, but it doesn’t need to be hard. You can create simple tests for your application in a few easy steps and then build on them from there. With this quiz, you can check your understanding of testing with Python’s unittest framework. Good luck! [ 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 ..read more
Visit website
The Real Python Podcast – Episode #201: Decoupling Systems to Get Closer to the Data
Real Python
by Real Python
3d ago
What are the benefits of using a decoupled data processing system? How do you write reusable queries for a variety of backend data platforms? This week on the show, Phillip Cloud, the lead maintainer of Ibis, will discuss this portable Python dataframe library. [ 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 ..read more
Visit website
Write Pythonic and Clean Code With namedtuple
Real Python
by Real Python
3d ago
In this quiz, you’ll test your understanding of Python’s namedtuple(). By working through this quiz, you’ll revisit how to create namedtuple classes, identify and take advantage of the cool features of namedtuple, use namedtuple instances to write Pythonic code, and decide when to use a namedtuple over a similar data structure. [ 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 ..read more
Visit website
Format Floats Within F-Strings
Real Python
by Real Python
3d ago
In this quiz, you’ll test your understanding of How to Format Floats Within F-Strings in Python. You’ll often need to format and round a Python float to display the results of your calculations neatly within strings. While there are several ways to format numbers in Python, formatted string literals or f-strings are usually the most frequent choice in modern Python programs. Knowing how to use f-strings effectively can make your code more readable and concise. [ Improve Your Python With ? Python Tricks ? – Get a short & sweet Python Trick delivered to your inbox every couple of days. > ..read more
Visit website
Build Command-Line Interfaces With Python's argparse
Real Python
by Real Python
3d ago
In this quiz, you’ll test your understanding of Creating Command-line Interfaces in Python with argparse. Command-line apps may not be common in the general user’s space, but they’re present in development, data science, systems administration, and many other operations. Every command-line app needs a user-friendly command-line interface (CLI) so that you can interact with the app itself. In Python, you can create full-featured CLIs with the argparse module from the standard library. [ Improve Your Python With ? Python Tricks ? – Get a short & sweet Python Trick delivered to your inbox eve ..read more
Visit website
A Practical Introduction to Web Scraping in Python
Real Python
by Real Python
3d ago
In this quiz, you’ll test your understanding of Web Scraping in Python. By working through this quiz, you’ll revisit how to parse website data using string methods and regular expressions, how to parse website data using an HTML parser, and how to interact with forms and other website components. [ 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 ..read more
Visit website
Get Started With Django: Build a Portfolio App
Real Python
by Real Python
3d ago
In this quiz, you’ll test your understanding of Django. By working through this quiz, you’ll revisit the steps you need to get started with Django. You’ll touch on topics that will help you create a fully functioning web application and revisit some of the most important features of Django. You’ll also investigate the architecture of a Django site, remember how to set up a new Django project with multiple apps, build models and views, and create and connect Django templates. [ Improve Your Python With ? Python Tricks ? – Get a short & sweet Python Trick delivered to your inbox every couple ..read more
Visit website
Inheritance and Composition: A Python OOP Guide
Real Python
by Real Python
3d ago
In this quiz, you’ll test your understanding of Inheritance and Composition in Python. By working through this quiz, you’ll revisit how to use inheritance and composition in Python, model class hierarchies, and use multiple inheritance. [ 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 ..read more
Visit website
Install and Execute Python Applications Using pipx
Real Python
by Real Python
3d ago
Installing Python packages into the global interpreter carries the risk of dependency version conflicts. On the other hand, manually creating and activating isolated virtual environments for each command-line tool you want to use can be cumbersome and time-consuming. This is where a tool like pipx can help you. [ 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 ..read more
Visit website

Follow Real Python on FeedSpot

Continue with Google
Continue with Apple
OR