Pytongasm — Home

Memory management in Python: Interning & Optimization

Behind Python’s simplicity lies a series of thoughtful decisions that makes it so user friendly. In this article, we will look at some of these decisions, and understand how memory is managed in CPython. Let’s start with the `is` operator. We'll be using shell/IDLE for all these operations: >>> a =

Build GPT-powered Chatbots around Enterprise data with Python

Traditionally most chatbots were a tree of if else blocks. Some had a layer of sophistication where users' intent was captured, to decide which function should be triggered. However, the tech was never good enough to resolve an actual query — until now. After GPT-3, we've seen

Decorators in Python

Imagine you've a cake machine that produces really nice cakes. Now, all of a sudden your customers want you to decorate your cakes with a cherry. Fair demand but if I was you, I wouldn't want to disassemble my cake machine to add this feature of putting cherries on the top. This is not just because I'm too lazy to revisit the int

Concurrency and Parallelism in Python

Most of us have come across terms like multithreading, parallel processing, multiprocessing, concurrency, etc., though each of these terms has its own meaning. In a broader sense, we need these because we want to avoid some kind of delay (or have an illusion of doing so) in the execution of "regular" programs. In order to avoid t

Create a menubar app for macOS using Python

While Python is great for building a lot of things, macOS apps are certainly not one of them. I was wondering if it’s possible to build a menu bar app for macOS using Python. I found out that it's not only possible — it's "ridiculously uncomplicated". In this tutorial, we’ll be building a realtime macOS app for stock prices — all

Desktop Notifications With 10 Lines of Python Code

We often use the print function to see the progress of a script, or simply for debugging purposes. Rather than constantly looking at the terminal, and waiting for an output to pop up, we can use push notifications as a way to track progress while working on something else. Our approach to make this happen will be very simple — we

Web Scraping Without Getting Blocked

We often need to prove "I'm not a robot" on the internet. That's because there are plenty of chatbots on the internet, actively doing nasty stuff like filling forms, clicking like buttons, etc. However, in this process many normal spiders get blocked, which are out there trying to access public data, which is not illegal

Introduction to Scrapy: Web Scraping in Python

Scrapy is an open-source web scraping framework, and it does a lot more than just a library. It manages requests, parses HTML webpages, collects data, and saves it to the desired format. Hence, you don’t need separate libraries for every other step. You can also use middlewares in scrapy. Middlewares are sort of

Built with using FastAPI