How to Render Markdown in a Django Application

One of Django’s most popular features is the admin interface. For developers, it provides an out-of-the-box tool kit to work with your project’s data models. And it gives non-technical administrators an intuitive user interface (UI) for interacting with the database and creating website content. However, the Django admin doesn’t provide a way to format text-based content. Using Markdown with Django is a great solution. Markdown is a plain text formatting language that can automatically convert to HTML for publishing on […]

Read more

Embeddings and Vector Databases With ChromaDB

Now that you understand the mechanisms behind ChromaDB, you’re ready to tackle a real-world scenario. Say you have a library of thousands of documents, and you need a way to search through them. In particular, you want to be able to make queries that point you to relevant documents. For example, if your query is find me documents containing financial information, then you want whatever system you use to point you to a financial document in your library. How would […]

Read more

Python Basics: Modules and Packages

As you gain experience writing code, you’ll eventually work on projects that are so large that keeping all the code in a single file becomes cumbersome. Instead of writing a single file, you can put related code into separate files called modules. You can put individual modules together like building blocks to create a larger application. In this video course, you’ll learn how to: Create your own modules Use modules in another file through the import statement Organize several modules […]

Read more

JupyterLab for an Enhanced Notebook Experience

Maybe you’ve already worked with Jupyter Notebooks from Project Jupyter to create documents containing runnable code. You can achieve even more with JupyterLab, a tool kit that you can use to document and share your research, teaching, and learning activities. It’s useful in a wide range of disciplines, from data analysis and data visualization to scientific study. JupyterLab enhances your notebooks by providing a browser-based interface that allows you to use multiple notebooks together effectively. In addition, it offers you […]

Read more

Document Your Python Code and Projects With ChatGPT

Having good documentation is a critical feature of any successful Python project. In practice, writing documentation is hard and can take a lot of time and effort, so some developers don’t like to do it. Luckily, with large language models (LLMs) and tools like ChatGPT, you can quickly document your Python code and projects. In Python, you can document your code using docstrings and then take advantage of them to enrich the project’s external documentation. ChatGPT can be of great […]

Read more

Python Basics Exercises: Numbers and Math

In Python Basics: Numbers and Math, you learned the mathematical skills that you’ll need as a Python programmer. Now, you’ll take those skills to the next level by actively practicing and applying what you’ve learned. In this hands-on course, you’ll have the opportunity to reinforce your understanding of numbers and math in Python programming through a series of exercises and coding challenges. By actively engaging with the material, you’ll gain the confidence you need to apply your learning in real-world […]

Read more

Python News: What’s New From October 2023

October 2023 saw the release of the new Python 3.12. At the same time, focus has shifted to new developments in the language. The acceptance of the long-discussed PEP 703 means that developers can ramp up their work on a free-threading version of Python. The steering council does an important job governing Python and its development. Nominations for the next steering council are now open. Currently, groups are being established that’ll support the steering council by specifically focusing on typing […]

Read more

Build a Hangman Game for the Command Line in Python

Many people learn basic language and word skills by playing the game of hangman. First mentioned in print in the late nineteenth century and popularized in international media as the game show Wheel of Fortune, hangman appeals to many people. For beginning programmers who want a challenge or for more experienced coders looking for a bit of fun, writing hangman in Python is a rewarding endeavor. Throughout this tutorial, you’ll build the hangman game in Python in a series of […]

Read more

Using the bpython Enhanced REPL

The standard Python interpreter lets you run scripts from files or interactively execute code on the fly in a so-called read-evaluate-print loop (REPL). While this is a powerful tool for exploring the language and discovering its libraries through instant feedback on your code inputs, the default REPL shipped with Python has several limitations. Luckily, alternatives like bpython offer a much more programmer-friendly and convenient experience. You can use bpython to experiment with your code or quickly test an idea without […]

Read more

How to Use Type Hints for Multiple Return Types in Python

In Python, type hinting is an optional yet useful feature to make your code easier to read, reason about, and debug. With type hints, you let other developers know the expected data types for variables, function arguments, and return values. As you write code for applications that require greater flexibility, you may need to specify multiple return types to make your code more robust and adaptable to different situations. You’ll encounter different use cases where you may want to annotate […]

Read more
1 85 86 87 88 89 913