The Ultimate Guide to Error Handling in Python
Miguel Grinberg Blog
by Miguel Grinberg
1w ago
I often come across developers who know the mechanics of Python error handling well, yet when I review their code I find it to be far from good. Exceptions in Python is one of those areas that have a surface layer that most people know, and a deeper, almost secret one that a lot of developers don't even know exists. If you want to test yourself on this topic, see if you can answer the following questions: When should you catch exceptions raised by functions you call, and when should you not? How can you know what exception classes to catch? When you catch an exception, what should you do to ..read more
Visit website
How LLMs Work, Explained Without Math
Miguel Grinberg Blog
by Miguel Grinberg
5M ago
I'm sure you agree that it has become impossible to ignore Generative AI (GenAI), as we are constantly bombarded with mainstream news about Large Language Models (LLMs). Very likely you have tried ChatGPT, maybe even keep it open all the time as an assistant. A basic question I think a lot of people have about the GenAI revolution is where does the apparent intelligence these models have come from. In this article, I'm going to attempt to explain in simple terms and without using advanced math how generative text models work, to help you think about them as computer algorithms and not as magic ..read more
Visit website
How To Add Dark Mode Support To Your Website
Miguel Grinberg Blog
by Miguel Grinberg
5M ago
You may have noticed that I have recently added a dark mode to this blog. The default color theme now follows the theme setting in your operating system by default, and you can also select which mode to enable from the top navigation bar. Nice, right? I have implemented this feature entirely in the front end, using CSS and a touch of JavaScript. Interested in implementing a similar feature for your own website? In this article I'll show you how I did it ..read more
Visit website
Eliza-GPT: The Classic ELIZA Chatbot Running On OpenAI's Chat Completions API
Miguel Grinberg Blog
by Miguel Grinberg
5M ago
ELIZA is possibly the first chatbot ever created, dating back to 1966. It was created by Joseph Weizenbaum as an early experiment in natural language processing (NLP). ELIZA is able to hold a conversation in English with a human, and is programmed through a set of pattern matching rules to respond to the user in ways that are similar to how a psychotherapist would. The OpenAI Chat Completions API is a widely used API to chat with Large Language Models (LLMs) such as ChatGPT, and has become a sort of standard for turn-based conversational services. Could 1960s ELIZA be adapted to work as a web ..read more
Visit website
Microdot: Yet Another Python Web Framework
Miguel Grinberg Blog
by Miguel Grinberg
5M ago
I just realized that I have never written on this blog about Microdot, my very own web framework for Python. I have released Microdot 2.0 a few days ago, so I guess this is a good time to make a belated announcement, and tell you why this world needs yet another Python web framework. But before I tell you about the reasons and the history of Microdot, let me share some of its features: Flask-like syntax, but without the magical/obscure parts (no application/request contexts) Small enough to work with MicroPython, while also being compatible with CPython Fully compatible with asyncio Websocket ..read more
Visit website
The Flask Mega-Tutorial, Part XIX: Deployment on Docker Containers
Miguel Grinberg Blog
by Miguel Grinberg
5M ago
This is the nineteenth installment of the Flask Mega-Tutorial series, in which I'm going to deploy Microblog to the Docker container platform ..read more
Visit website
The Flask Mega-Tutorial, Part XX: Some JavaScript Magic
Miguel Grinberg Blog
by Miguel Grinberg
5M ago
This is the twentieth installment of the Flask Mega-Tutorial series, in which I'm going to add a nice popup when you hover your mouse over a user's nickname ..read more
Visit website
The Flask Mega-Tutorial, Part XXI: User Notifications
Miguel Grinberg Blog
by Miguel Grinberg
5M ago
This is the twenty first installment of the Flask Mega-Tutorial series, in which I'm going to add a private message feature, along with user notifications that appear in the navigation bar without the need to refresh the page ..read more
Visit website
The Flask Mega-Tutorial, Part XXIII: Application Programming Interfaces (APIs)
Miguel Grinberg Blog
by Miguel Grinberg
5M ago
This is the twenty third and last installment of the Flask Mega-Tutorial series, in which I'm going to tell you how to extend microblog with an application programming interface (or API) that clients can use to work with the application in a more direct way than the traditional web browser workflow ..read more
Visit website
How To Add Dark Mode Support To Your Website
Miguel Grinberg Blog
by Miguel Grinberg
10M ago
You may have noticed that I have recently added a dark mode to this blog. The default color theme now follows the theme setting in your operating system by default, and you can also select which mode to enable from the top navigation bar. Nice, right? I have implemented this feature entirely in the front end, using CSS and a touch of JavaScript. Interested in implementing a similar feature for your own website? In this article I'll show you how I did it ..read more
Visit website

Follow Miguel Grinberg Blog on FeedSpot

Continue with Google
Continue with Apple
OR