appsec.fyi

A somewhat curated list of links to various topics in application security.

Python

LinkExcerptWord Count
Two kinds of threads pools, and why you need bothWhen you’re doing large scale data processing with Python, threads are a good way to achieve parallelism. This is especially true if you’re doing numeric processing, where the global interpreter lock (GIL) is typically not an issue.1201
GitHub OAuth in your Python Flask appIn this guide we'll learn how to quickly build an OAuth2.0 integration into a simple Flask app using Supabase-py. This will enable your users to login to your web app using their GitHub account. This article assumes you are familiar with creating an application in Flask.699
Building a Python compiler and interpreterIn this tutorial series we will build a Python compiler and interpreter from scratch. We start with simple arithmetic expressions. In this series of articles we will be implementing the Python programming language, from scratch, in Python.6466
Real Multithreading is Coming to Python — Learn How You Can Use It NowPython is 32 years old language, yet it still doesn’t have proper, true parallelism/concurrency. This is going to change soon, thanks to the introduction of a “Per-Interpreter GIL” (Global Interpreter Lock) which will land in Python 3.12. While the release of Python 3.1575
Python Decorators That Can Reduce Your Code By HalfHi there, welcome to my blog! Today I’m going to share with you some amazing Python decorators that can reduce your code by half. Sounds too good to be true, right? Well, let me show you how they work and why you should use them in your projects.1195
Let’s create a Python Debugger together: Part 1Have you ever wondered how debuggers work? What happens when you set a breakpoint and hit it later? Debuggers are tools that we as developers use daily in our work, but few know how they are actually implemented. This program computes a Fibonacci number.2262
Multiprocessing in Python: The Complete GuideThe multiprocessing.Process class allows you to create and manage new child processes in Python. Although multiprocessing has been available since Python 2, it is not widely used, perhaps because of misunderstandings of the capabilities and limitations of threads and processes in Python.21249
Create a Flask Application With Google LoginWatch Now This tutorial has a related video course created by the Real Python team. Watch it together with the written tutorial to deepen your understanding: Using Google Login With Flask You’ve probably seen the option for Google Login on various websites.5177
Python 3.12: All New Features You Need To Know!Python 3.12 is just around the corner, and I couldn't be more excited! 🎉🐍 In this video, I'll not only dive into the thrilling new features and improvements coming our way in Python 3.12 but also discuss some elements that will be removed in the upcoming release. 💡 Get my FREE 7-step guid0
5 Ways to Measure Execution Time in PythonYou can benchmark the execution of Python code using the “time” module in the standard library. In this tutorial, you will discover how to time the execution of Python code using a suite of different techniques.3207
How to store your users' API keys securely in Django 🔑When building your bespoke AI-powered cat joke generator (CatGPT 🐈), you'll want to store your users' external API keys, e.g., their OpenAI keys. How should you do this in a secure way?988
Exploring WordleWhat can we deduce from the first three rows of guesses, JUDGE=....e CHEST=c.E.. WRECK=..Ec.? There is a set of valid letters, C and E, that are either present (yellow 🟨) or correct (green 🟩). Both E and C start out as present, but E later finds its correct position, while C does not.4603
OOP in PythonWhen people first learn Python, OOP (object-oriented programming) is one of those things they start to use before fully understanding it. That makes sense, because OOP is a huge topic. You really have to use it for a while before you can fully understand it in any real depth.307
Python: My Favorite Python Tricks for LeetCode QuestionsI've been spending a lot of time practicing on LeetCode recently, so I thought I'd share some of my favorite intermediate-level Python tricks with an emphasis on newer features of Python you may not have started using yet. I'll start with basic tips and then move to more advanced.1556
Filters in Django – filter(A, B) vs filter(A).filter(B)In this article, we’re going to cover quite an advanced topic in Django ORM. And after reading the article, you’re going to understand how Django ORM works a little bit better, especially how it handles joins. Now, let’s play a little bit with Django ORM and let’s use the filter method.1366
Writing a C compiler in 500 lines of PythonA few months ago, I set myself the challenge of writing a C compiler in 500 lines of Python1, after writing my SDF donut post. How hard could it be? The answer was, pretty hard, even when dropping quite a few features.5116
Class Concepts: Object-Oriented Programming in PythonPython includes mechanisms for doing object-oriented programming, where the data and operations on that data are structured together. The class keyword is how you create these structures in Python.190
How to Launch an HTTP Server in One Line of Python CodeTraditionally, if you wanted to handle HTTP requests and serve static content from files, then you had to set up a full-fledged web server like Apache or NGINX, which could be a tedious process.1147
OOP in Python: Why is object-oriented programming so important?Note: This is the first post in a series about OOP in Python. This post is free to everyone, but the rest of the posts in the series will only be available to paid subscribers for the first 6 weeks. After that they will be available to everyone.830
Inheritance and Internals: Object-Oriented Programming in PythonPython includes mechanisms for writing object-oriented code where the data and operations on that data are structured together. The class keyword is how you create these structures in Python.220
The easy way to concurrency and parallelism with Python stdlibConcurrency and parallelism are hard, plus Python could do better in that regard. For those, Python actually comes with pretty decent tools: the pool executors.2258
Python is (mostly) made of syntactic sugarThe primary benefit from subscribing to LWN is helping to keep us publishing, but, beyond that, subscribers get immediate access to all site content and access to a number of extra site features. Please sign up today!2193
Building a blog in DjangoWe launched the Datasette Cloud blog today. The Datasette Cloud site itself is a Django app - it uses Django and PostgreSQL to manage accounts, teams and soon billing and payments, then launches dedicated containers running Datasette for each customer.1723
Heap in Python | Min Heap and Max Heap ImplementationIn this article, we will learn what a heap is in python and its implementation. We will understand max heap and min heap concepts with their python program implementation and the difference between max-heap and min-heap.1287
Introduction To Python's Functools ModuleThe functools module is part of Python's standard library and was implemented for higher-order functions. A higher-order function is a function that acts on or returns another function or multiple functions.3036
Python Basics: File System OperationsSo far, you’ve written programs that get their input from one of two sources: the user or the program itself. Program output has been limited to displaying some text in IDLE’s interactive window. This is where files come in. You’ve likely been working with computer files for a long time.303
Avaiga/taipyLicensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0247
Hidden Features of PythonPython is a powerful programming language that's easy to learn and fun to play with. But beyond the basics, there are plenty of hidden features and tricks that can help you write more efficient and more effective Python code.1804
An Intro to Protocol Buffers with PythonProtocol buffers are a data serialization format that is language agnostic. They are analogous to Python’s own pickle format, but one of the advantages of protocol buffers is that they can be used by multiple programming languages.1241
Create a Python Wordle Clone With RichIn this video course, you’ll build your own Wordle clone for the terminal. Since Josh Wardle launched Wordle in October 2021, millions of people have played it.244
Click and Python: Build Extensible and Composable CLI AppsYou can use the Click library to quickly provide your Python automation and tooling scripts with an extensible, composable, and user-friendly command-line interface (CLI).11770
Operator Overloading in Python<center> Operator Overloading in Python === *Written by [Alejandro](https://twitter.com/asanchezyali). Published 2021-06-15 on the [Monadical blog](https://monadical.com/blog.html).1405
Build a Code Image Generator With PythonIf you’re active on social media, then you know that images and videos are popular forms of content. As a programmer, you mainly work with text, so sharing the content that you create on a daily basis may not seem intuitive. That’s where a code image generator can come in handy for you!10399
Deep Dive Into Flask GuideThis article looks at Flask 2.0's new async functionality and how to leverage it in your Flask projects.23
What Are Python Asterisk and Slash Special Parameters For?Whenever you think of Python’s asterisk operator (*), you most likely think of multiplication or exponentiation. Similarly, you probably associate the forward slash operator (/) with division. But you can also use the bare asterisk and slash as special parameters in function headers.3640
Asyncio, twisted, tornado, gevent walk into a bar...Concurrency has a lot to do with sharing one resource, and Python has dedicated tools to deal with that depending on the resource you must share. If you have to share one CPU while waiting on the network, then the specialized tools for this are asyncio, twisted, trio, gevent, etc.4520
Irit Katriel- opening keynote: Error Handling: From Charles Babbage to Python 3.11This talk introduces the new error handling features of Python 3.11, while placing them within their historical perspective.0
Containerized PDF Summarizer with FastAPI and HamiltonScreenshot of PDF summarizer app. Image by author. Skip learning convoluted LLM-specific frameworks and write your first LLM application using regular Python functions and Hamilton! In this post, we’ll present a containerized PDF summarizer powered by the OpenAI API.2145
How to implement CommandBus in PythonIn my previous blogpost, I compared services and command handlers. In today’s blogpost, I want to show you how to use commands and command handlers in connection with CommandBus. CommandBus is the last missing bit in this whole puzzle.934
Introducing Immortal Objects for PythonAt Meta, we use Python (Django) for our frontend server within Instagram. To handle parallelism, we rely on a multi-process architecture along with asyncio for per-process concurrency.746
.XYZ TLD Domain NamesWhether you have one domain or one thousand, our domain management console is simple and easy to use. Already built a site in Squarespace, Wix, or Weebly? No problem! Link your domain to a 3rd-party site builder with the click of a mouse.94
Introducing Python in Excel: The Best of Both Worlds for Data Analysis and VisualizationPython is one of the most popular programming languages today, loved by businesses and students alike and Excel is an essential tool to organize, manipulate and analyze all kinds of data. But, until now, there hasn’t been an easy way to make those two worlds work together.983
Using the NumPy Random Number GeneratorRandom numbers are a very useful feature in many different types of programs, from mathematics and data analysis through to computer games and encryption applications. You may be surprised to learn that it’s actually quite difficult to get a computer to generate true randomness.6263
Solving a simple puzzle using SymPyIt’s about a square that gets partitioned into rectangles of equal area (some sources call this "floorplan" ). One of the sides of these smaller rectangles is given and the problem asks for the area of the large square.270
Process Images Using the Pillow Library and PythonWhen you look at an image, you see the objects and people in it. However, when you read an image programmatically with Python or any other language, the computer sees an array of numbers.297
Python: Just write SQLI have been writing a lot more Go this past year. For those not familiar, Go favours a non-ORM, non-query-builder approach to interacting with databases. This comes naturally due to the sql package: A common interface to be used alongside database drivers.967
How CPython Implements Reference Counting: Dissecting CPython InternalsThis week we are diverting from AI and machine learning to discuss a more intense CS topic — memory management in Python. Memory management refers to the techniques used by the programming language runtime to allocate and free memory as programs execute.2758
trafilatura: Web scraping tool for text discovery and retrievalTrafilatura is a Python package and command-line tool which seamlessly downloads, parses, and scrapes web page data: it can extract metadata, main body text and comments while preserving parts of the text formatting and page structure. The output can be converted to different formats.547
Distributive-Network/PythonMonkeyPythonMonkey is a Mozilla SpiderMonkey JavaScript engine embedded into the Python VM, using the Python engine to provide the JS host environment. This product is in an early stage, approximately 80% to MVP as of July 2023. It is under active development by Distributive Corp., https://distributive.1472
Pygoat - Learn Django security the hard wayLearn to secure your Django apps by attacking (and then securing) Pygoat - An intentionally vulnerable Python Django application. Explore the OWASP top 10 vulnerabilities and understand how to mitigate them from Django apps.32
python quirksA little girl goes into a pet show and asks for a wabbit. The shop keeper looks down at her, smiles and says: "Would you like a lovely fluffy little white rabbit, or a cutesy wootesly little brown rabbit?" "Actually", says the little girl, "I don't think my python would notice.323
Running Untrusted Python CodeFor a side-project, I needed to run some untrusted Python code. I would usually sandbox untrusted code inside a virtual machine. Either with a managed service like Fargate, Lambda, or Fly Machines; or if there were specific requirements (e.g.1165
Bridging the Python async gap from the other sideSo, you're doing some sync stuff. But you also need to do some async stuff, without making everything async.1607
Swing in Python Burp Extensions - Part 1TL;DR: What I learned from creating handcrafted GUIs for Python Burp extensions using Swing. Code is at: In April 2019, I had just joined Electronic Arts and I wanted to make a Burp extension. I saw only tutorials on creating a GUI in Jython.2067
Attribute Management using @property in Python: A Basic Guide With ExamplesTo manage class attributes more effectively in Python, developers can use properties. These properties encapsulate the attributes and control their access and modification.1224
How to Convert HTML to PDF in PythonThere are a lot of online tools that provide converting HTML to PDF documents, and most of them are free. In this tutorial, you will learn how you can do that with Python.809
Don’t Run Loops in Python, Instead, Use These!As Data science practitioners we always deal with large datasets and often we need to modify one or multiple columns. Using a loop for that kind of task is slow. In this blog, I will take you through a few alternative approaches which are faster than loops in python.1390
4 SSH Alternatives That Are Better Than The OriginalWe’ve all had to use SSH at some point in our lives as developers. Whether it’s connecting to a development machine, pushing code or managing remote equipment. SSH has a sacred place in our hearts. Sadly, there haven’t been a ton of features added to it over the years.1091
So many interesting, fun, and powerful Python librariesPython is a concise, readable, and extensible language, and is widely used for research both domestically and abroad. Python is known for its rich third-party libraries. It is too difficult for one person to find so many interesting, fun, and powerful libraries.1555
Profiling and Multiprocessing in PythonBefore optimizing your code, it’s crucial to spot the bottlenecks slowing you down. Let’s say your app can be broken down into two parts: A and B. They don’t necessarily require the same computation time, either because they do different things or process different inputs.1494
Building a vulnerability scanner using pythonVulnerability scanning is a crucial aspect of maintaining the security of computer systems and networks. It is the process of identifying and analyzing the security weaknesses and vulnerabilities present in a network or computer system.1583
Creating an Advanced Network Packet Sniffer in Python: A Step-by-Step GuideWelcome to our guide on creating an advanced network packet sniffer in Python. Network packet sniffing is a technique used to monitor and analyze network traffic. In this tutorial, we will be using the Scapy library in Python to capture and analyze network packets.2115
Build an Arp Spoofer From ScratchWelcome to our blog on building an ARP spoofer from scratch! In this tutorial, we will be walking you through the process of creating your own ARP spoofer using Python. ARP spoofing is a type of attack that allows an attacker to intercept network traffic by altering the ARP cache of a target device.3318
Context Managers and Python's with StatementThe with statement in Python is a quite useful tool for properly managing external resources in your programs.198
Having trouble using iterators in Python? Here's a quick guide on iterators and when you should consider using them.Python iterators are objects that allow us to iterate over a sequence of values. They are an essential part of many common Python data types, including lists, tuples, and dictionaries. One of the key benefits of using iterators in Python is that they are very efficient in terms of memory usage.662
Python Simple HTTP Server With SSL Certificate (Encrypted Traffic)The simple HTTP server is a feature from python that allows us to create an HTTP server in a simple way. In another way, usually, hackers or penetration testers use this method to transfer files between the attacker machine (Kali Linux) to the victim machine.465
10 Python Scripts for Automating your Daily ProblemsThe repetitive task is always boring and time-consuming but why not make them automated with your favorite programming language? Think of tasks like sending and Fetching Emails, checking spells and grammar, and much more.1790
13 Advanced Python Scripts For Everyday ProgrammingEvery day we face many programming challenges that need some advanced coding. You can’t solve those problems with simple Python Basic Syntax. In this blog, I will share 13 Advanced Python Scripts that can be a handy tool for you in your Projects.1293
5 Python Features That Has Made Me Less MiserableDon’t get me wrong — programming in Python is fun (more than other languages in my opinion). But certain aspects will probably be quite frustrating/annoying if these features didn’t exist.807
Web Scraping With Python For Beginners: How To Get StartedWeb scraping is the process of using programming tools to extract data from a website.3242
Getting started with Rocksdb and PythonIn this post, I am going to discuss RocksDB. RocksDB is an embeddable persistent key-value store system developed by Facebook. It was originally forked from LevelDB, which was created by Google.1118
Python CybersecurityLearn how to build a simple Python script that can be used to scan for open ports on a network. This tutorial covers the implementation steps needed to build the script using Python Programming.555
OWASP PygoatThe purpose is to give both developers and testers a platform for learning how to test applications and how to code securely. PyGoat is written in python and used Django web framework as a platform. It has both traditional web application vulnerabilities (i.e. XSS, SQLi) as well.80
Understanding async Python for the webPublished: . Filed under: Django, Python. Recently Django 4.1 was released, and the thing most people seem interested in is the expanded async support.4081
Two Tips With Coding In Python Changed My LifeEvery day we want to know more about python to develop our knowledge until we reach the professional stage and I am sure there are a lot of things in python we didn’t see ever but this is not a drawback in our brain, this is what makes us learn and search about new things every day we wake up in,493
A Practical 12-Week Course to Learn to Automate Stuff with PythonOne of the coolest things you can do with Python is automating tasks.889
I Made a Python Bot to Send “Good Night” Texts to My GFHaving a functioning relationship is hard, especially when you’re a full-time coder. You have to take care of her and her needs all the time, and most importantly, if she is clingy, you have to send “Good night” texts every single night.1262
4 Ways To Annoy Your Colleagues With Your Python CodeHere are 4 ways to write your code that will make your software engineer colleagues go “what the hell?” and give them a massive headache. Let’s say we need to add a and b together.1091
Python Web development in 2022: Which web frameworks are the most popular by Github stars?TL;DR: Django is the most popular web framework with 65,687 stars. The second place is Flask with 60,217 and the newcomer is FastAPI with 44,121 on the third place. The above chart shows that Django is in the lead with over 5,000 Stars, but fastapi is grown strong.701
This Is Why You Should Use Tortoise-ORM in Your Python ProjectsIntegrating relational databases into our code could be clunky, but it can be easier with ORM. In this article, I’ll introduce you all to a cutting-edge Python ORM package called tortoise ORM and give a hands-on example.395
Python 3 Cheat SheetToday I gonna tell you how to enhance your level in python. Python is a powerful yet easy to use programming language developed by Guido van Rossum, first released over a decade ago in 1991. With Python, you can quickly write a small project.970
4 books that will make you a python ninja .If you have stumbled to this post .. I can bet you love python … And when you love something you should take care of it . in this small blog post i have compiled a list of books that have helped me become a better python programmer .593
RegEx in Python: Introduction and The use of BackslashLets say, you have sorted out the ways an email address can be written and also you have a list of thousands of email addresses which may or may not be valid.853
6 More Things I Didn’t Know About Python Until RecentlyI’ve been programming in Python since 2017, and only knew of these in the past one year. Let’s say we have a complex data structure that we want to print eg. a multi-nested dictionary.885
Python Decorators (made easy)Decorator can be used to send function as argument and it can return a function. Its mainly used for one function can be used in another function or many function. On example 1, Here on down calling you can we are passing one function on another function.374
Class in Python : All you need to knowToday, we gonna introduce a fundamental principe in python: class. Class is everywhere, and almost all in python is a class, but first, we might take a look of what python is. Python is a high level language and an OOP language, an oriented object programming language.921
Spice up your terminal with RichEver thought of bringing whatever you see on the browser to your console? I felt the need for the same when I was working on my pet (truly pet :)) project WagginTails. I was not a UI/UX person as it requires a lot of patience and perseverance, hence I prefer to work on the middle layer.415
7 Useful Python Libraries You Should Use in Your Next ProjectWhy write custom functionality when a library can do it for you? Libraries are the best friends and life savors of developers. In my opinion, a good project makes use of some of the best libraries available.960
Hidden powers of pydanticDiscover some key features of pydantic you may not be aware of. For those who don’t know pydantic, it is a library for data validation leveraging type annotations feature added in python3.5. Here is an example taken from the documentation.1129
Python Web Development Framework in 2022Did you know that as of 2022, the speediest programming language in the world is? Python! Yes, you guessed it correctly: it is the most popular, readable, and user-friendly software programming language for web development.852
I Made A Python Cheat Sheet for Data Structures and Algorithms (Useful for Leetcode)Get a PDF of this sheet at the end of the article. Dictionaries are used to store data values in key:value pairs. Info about collections.Counter() available below.1756
Python Trick : functools.singledispatchYou might have seen code similar to the below example where you have to use multiple if-else statements inside your program to perform the different tasks based on the parameter type or condition. This pattern soon becomes tedious when the number of conditions and task functions starts to grow.225
Advanced Python: Classes, Objects, and MROLearn about the inner workings of classes, objects, and MRO in Python 3.1207
Best Code Editors and IDE For Python DevelopersMuch of your experience as a developer will be determined by the programming language you use to write your code and A good integrated development environment (IDE) or Code Editor that can help you work more efficiently.647
Python & Variables + Confusion About Memory AddressesVariables like in the previous article are names that represent a value stored in memory. So if we have variable, alpha and “I am human” in memory address id1009 then alpha represents id1009 which contains “I am human”. So that’s simple.622
🤔 Python generators. When to use?Python generators is a really powerful tool that can help you optimize your code. But sometimes its impact is more useless than useful. Let’s have a look at some examples to figure in which cases it is better to use them…346
10 Killer Automation Scripts For Your Daily StuffHaving your everyday task and work automated is an awesome way rather than doing it manually. Well for making it true this article presents you with 10 killer automation scripts that will automate your everyday task and problems. So put this article on your list and let's get started.2035
Fake webcam for your online meetings, with PythonPicture this. You’re in an online meeting, and for one reason or another you don’t really feel like putting your webcam on. But you see that everybody else has it on.1441
How to Create Callable Objects in Python: Python OOP Complete CourseHave you ever tried to call your class objects?? When you write your Python code, you can usually call your predefined functions and methods, but not your class objects.618
Python features that I was unaware even existedI’ve just discovered a new hobby: leisurely reading Python documentation. When you read anything for pleasure, you often pick up on intriguing details that you may have otherwise overlooked. So, the following is a collection of facts that I found interesting. Can you perform that in Python?819
These tools boost my development productivity while using my Mac, maybe it will help you tooMaccy is a simple yet essential tool for me. It is a clipboard manager that helps manage my copy and paste. I often do API testing in various environments, local, dev, and production. When it comes to API, copying and pasting the bearer token wasn’t the most pleasant thing to do.895
I finally found the best note taking app after trying multiple apps within the past yearBefore I begin this article I want to say that in the past couple of months I have been switching apps every now and then with the hopes to find the best note-taking app. While trying these different apps I found out that within each of the app there was something that I was missing.985
Sharing Code Using a setup.py File in PythonWhere both sub-projects <project1> and <project2> have a main.py file that use similar code. You (want to) store this shared code inside a utils.py file that sits in a third directory <common>.1525
A Guide to Python Libraries For Pentesters, Ethical Hackers and System Administrators.Cybersecurity engineers and penetration tester largely depend upon Python to perform a wide range of tasks. Python is widely used for data science and machine learning applications.627
yield fromWe now know what a generator is, how to send values to a generator, and how to close a generator. This article is looking at how we can have two-way communications using caller, sub-generator using yield from , yield and send. We know how we can generate and consume values. For eg.423
10 Python Scripts to Automate Your Daily StuffGetting your stuff automated is an awesome way to save most of your time by manually doing them again and again. In this article, I present you with 10 Python scripts to automate your stuff. Well put this article on a list and let's get started.2103
Knowing These Python Techniques Helped me in 2022Python-like all other programming language is easier if we learn the Pythonic ways to do stuff. I have listed 10 Python techniques that a Python Developer should know. Let’s get started —215
4 smart ways to write Python programDo you want to print “Hello World” without using print statement? Do you want to give multiple inputs in single line?178
7 Useful Python Libraries You Should Use in Your Next ProjectWhy write custom functionality when a library can do it for you? Libraries are the best friends and life savors of developers. In my opinion, a good project makes use of some of the best libraries available.898
Top IDE’s for Python in 2022Over the years, python has garnered a lot of publicity and popularity. According to Statista, over 48% of developers who took the survey use python as their programming language.858
Functional Programming in PythonFunctional programming is a programming paradigm in which the primary method of computation is evaluation of only functions. In this tutorial, you’ll explore functional programming in Python. Functional programming typically plays a fairly small role in Python code.1007
The Impossible Web ScrapingTo do data science we need data, of course. But getting the data is not always an easy task. One way data scientists get data is through web scraping, which is the process of extracting data from a webpage. But some websites seem impossible to scrape, until we find a way to do it.1303
4 Python Questions Not Many Can Solve In One Line Of CodeHere are 4 questions that are usually easy to solve under normal circumstances, but get pretty difficult once we try to solve them in only one line of code. Note — I’ve tested them out before, and all 4 are definitely solvable in one line of code (just not easy). Good luck!539
How to Protect Text Input from XML External Entity (XXE) Attacks using PythonEffective XML External Entity attacks look to interfere with your application’s processing of serialized data. Without a countermeasure to check XML text strings, such attacks can infect files and wreak havoc on your system internally.312
Improve Python Class Performance with “__slots__"When we create an object from a class, the attributes of the object will be stored in a dictionary called __dict__. We use this dictionary to get and set attributes. It allows us to dynamically create new attributes after the creation of the object. Let’s create a simple class InventoryItem.561
Whip up a stunning Dashboard with Python & Streamlit!Ever wanted to get a juicy dashboard that bedazzles people but don’t want to spend days on trying to center a div with css? Then you should go with Streamlit! Streamlit is an open-source Python library that makes it easy to create and share beautiful, custom web apps for showing your data.765
7 Useful Python Libraries You Should Use in Your Next ProjectWhy write custom functionality when a library can do it for you? Libraries are the best friends and life savors of developers. In my opinion, a good project makes use of some of the best libraries available.885
Four Tricks In Python You Don’t Knowbut what about if we want to get a list of the max numbers? this is the purpose of this article. let us keep goinig a little to see how to do it.452
10 Python Scripts For Automating Your Everyday ProblemsAutomating your everyday tasks is an awesome way to save most of your time from doing them manually. Imagine the tasks you do manually like fetching movies from IMDB, editing PDF files, reading daily headlines, and many more.2065
Python : __init__ Vs __new__ !!In python classes you might have seen __new__ and __init__ . The __new__ is called a constructor function and __init__ is called an initializer function. The __new__() is a static method of the built-in python object class. When you define a new class, it implicitly inherits from the object class.386
Python: Advanced Syntax of ClassCo-Author: Y. S. Huang, a master’s student studying AIVC and likes open-source, if you are interesting, go to check my Github! Last time we introduced some basic elements of class in python. This time we will focus on the class method and the different usage of the class.1621
An introduction to asyncio in pythonAsyncio is a tool for concurrent programming in python which is more light weight than threads and multi-processing. This works based on a event-loop which executes a collection of tasks and the significance is , these tasks have the liberty to choose when to yield control back to the event loop.770
How and when to use __slots__ in pythonEach python object has a _dict_ attribute which is a dictionary containing all other attributes. E.g. when you type self.attr python is actually doing self.dict[‘attr’]. As you can imagine using a dictionary to store attribute takes some extra space & time for accessing it.614
Python mmap: Doing File I/O With Memory MappingThe Zen of Python has a lot of wisdom to offer. One especially useful idea is that “There should be one—and preferably only one—obvious way to do it.” Yet there are multiple ways to do most things in Python, and often for good reason.232
7 Things I Never Knew About Python Until RecentlyIn this Dog class, the __name attribute has a getter method but not a setter method. By right, we as users should only be able to read the __name attribute and not have permission to set a new name for our Dog object. But private variables are not that private.712
Cleaner Python Code with PartialsI’ve been spending a lot of time lately trying to be lazy. It’s become my mantra as a data scientist: How can I do less work? In my quest for slacker nirvana I’ve discovered the concept of partial functions in Python.589
Callable Protocol in PythonOne of the great strengths of Python is the expressive power it contains through its protocols. Have you ever come across a new class that allows its instances to be called like a function and at the same time have other functionalities that are not standard for “function” objects?1090
Python Web Development Framework in 2022Did you know that as of 2022, the speediest programming language in the world is? Python! Yes, you guessed it correctly: it is the most popular, readable, and user-friendly software programming language for web development.852
Python 101 – How to Generate a PDFThe Portable Document Format (PDF) is a very popular way to share documents across multiple platforms. The goal of the PDF is to create a document that will look the same on multiple platforms and that will print the same (or very similar) on various printers.2850
Awesome PythonInspired by awesome-php. Libraries for administrative interfaces.2319
pikepdfPython + QPDF = "py" + "qpdf" = "pyqpdf", which looks like a dyslexia test. Say it out loud, and it sounds like "pikepdf". For users who want to build from source, see installation.495
Solve Real World Problems Using PythonJoin 37988 Pythonistas and start coding ... Wether you aspire to become a web developer, data scientist, DevOps or cybersecurity engineer, good chance you will greatly benefit from being well versed in Python!1234
microsoft/picologgingStatus This project is an early-alpha. There are some incomplete features (see Issues). Picologging is a high-performance logging library for Python. picologging is 4-10x faster than the logging module in the standard library.380
Your Guide to the CPython Source CodeAre there certain parts of Python that just seem magic? Like how are dictionaries so much faster than looping over a list to find an item.23684
Python Stacks, Queues, and Priority Queues in PracticeQueues are the backbone of numerous algorithms found in games, artificial intelligence, satellite navigation, and task scheduling. They’re among the top abstract data types that computer science students learn early in their education.21857
Deep Dive into Lambda Functions in PythonWhat is Lambda in PythonA lambda function in python is a Nameless Function, it has the Following properties:-It cannot be called again and used or can we pass any arguments into the function from another point of the codeit has no name , more clearly explaining it is an anonymous functiona Lambda fu293
Python Requests Library Caused a Production OutageBefore I go into the outage you’ll need to understand parts of the project which include code and architecture. First the project pulled down data from various third party services generally making web requests to pull, parse and format data for submission.849
Modern Functions in Python 3Python has thrived over the past few decades as the language which lets you work quickly and effectively. Like many modern companies, we use Python quite extensively for a majority of our stack, but in many cases, continue to live on Python 2.7. The harsh reality is that Python 2.1411
Run Your Python Code as Quickly as C++It is critical for my profession as an AI researcher to quickly code up a concept to check if it works or not. Python is a fantastic tool for doing precisely that. It helps you to concentrate on the concept rather than on boilerplate code and other boring tasks.847
Python best practices.Writing an aesthetic, readable, and structured code is vital when you want to deploy your code into production. An unstructured, unreadable and unoptimized code is difficult to debug and is not accepted for deployment.1124
7 Pip Commands (Python) That Make Your Life EasierPip Installs Packages (PIP) is a Python package manager that allows us to install 3rd party libraries in Python. And pip will automatically install pandas for us. Here are 7 other Pip commands that I’ve found pretty useful in managing my Python installations.540
DATETIME IN PYTHONDatetime is a library provided in python programming to access date and time. Generally datetime is denoted yyyy-mm-dd hh:mm:ss. There are two ways to call it: The difference in how to call the datetime above can be seen from the form of the datetime function call.1222
Python — 10 Common Beginner MistakesHow to recognize a Python Expert? The code should be working, lean & readable. Some of the below-listed mistakes are commonly made by Python Beginners. Well — they are not really mistakes, as the code still works— but they can be improved.820
Python With An AsteriskPython is a popular programming language, used in a variety of applications, from data science to web development. It has many nice features, it’s easy to learn, and you can create a nice application with just a couple of lines.682
Memory Management in PythonMemory management is the process of efficiently managing computer memory (RAM). It involves allocating a piece of memory at run-time to the program when the program requests it and freeing the allocated memory for re-use when the program no longer needs it.251
Multithreaded HTTP requests in PythonThis will be a rather brief overview and benchmark of 2 different ways you can parallelize HTTP requests in Python. The complete code snippet can be found at the end of this article.524
A Python project templateCreating a Python project is tiresome work. There are numerous repeated steps as creating setup.py, configuring MyPy, Pytests, and automating other stuff. Usually, you copy-paste everything from the previous project, modify it a little bit and make it work for the new project.886
Intro to Webhooks and How to Receive them with PythonBefore talking about webhooks, let’s talk about APIs. Below is the data flow for an API. You make a GET/POST request to the API and you get a response back.792
Best version of python: now can beat all languagesThe idea is to bring another update in python that will make it faster than all languages. Another version of python will also include efficient memory consumption, fast in mobile devices & easy to access database.884
The single most useful Python Decorator @cachePython is well known for its simplicity and many resources that can help you. Not only do we have many different resources in our community but we also have a lot of helpful resources inside Python standard libraries.767
Getting Started Debugging Python Apps in PyCharmGedalyah Reback is the Senior Product Marketing Manager at Rookout with experience explaining in plain language the deep technical aspects of digital technologies to non-technical and professional crowds. He is an avid blogger and lover of languages.1843
Context ManagersContext managers are an incredibly useful tool in Python. They allow you to create a block of code with defined variables that are defined in the block declaration.480
Python Best PracticesBest practices for writing better code in Python. This blog will help the beginners in python to write efficient and neat code. Even if you are an intermediate level programmer in python, I do recommend you to go through this blog you may find some new tricks and tips.831
Use Exceptions To Write Better Python ProgramsExceptions are usually raised when a program encounters an unexpected error. For example, if you divide by zero, or if you pass a string to a function that needed a number. But what are exceptions exactly? They are just objects, and they are all subclasses of the general Exceptionclass.1220
Python — Best Practices for Writing FunctionsWithout a doubt, functions are one of the most important concepts in Python. When doing coding, we break down big problems in the real world into small ones, and then process through functions. Functions are both the nemesis of repetitive code and the best weapon against code complexity.1249
5 Killer Python Scripts to Automate Your ProblemsDid you ever think about automating your daily routine task like Excel work, Creating Qr images of links, extract valuable data from PDF? Well in this article I present you with 5 killer Python scripts for automation. So sit back and let's get started.1076
Docstrings in PythonLet's talk about docstrings in Python. We wrote that message when we defined this function.953
Start Using Annotations In Your Python CodeThe programming languages such as C, C++, Java, etc. are statically typed languages meaning the data type of the variable must be declared before you can actually use it in your program.1165
Top Python Tricks That Will Boost Your SkillsPython is my favorite language from the start of my programming career. I always try to find shorthands and tricks to boost my skills and save time. I ended up searching on different tech forums and websites like StackOverflow and medium.1126
Automate WhatsApp Messages with Python in 3 StepsPython is probably one of the coolest languages. And this fascinating about it is that you can automate day-to-day tasks. One of such tasks we do every day is sending messages on WhatsApp.500
How Using ‘yield’ Instead of ‘return’ Can Make Your Python Code FasterWhen we started learning Python, we were probably taught to use the return keyword in functions rather than yield. In this article, I’ll quickly demonstrate why sometimes using yield is better and can make your code run faster (especially when dealing with lots of data).740
Databases with PythonLately, I’ve been studying Django, and I felt the necessity to improve my database skills. I’ve taken some introductory SQL courses, but I realized that I’m not comfortable with the thing.396
How to check the type of something in PythonIn Python, you may want to check for the type of a variable or object. The result could definitely be of use for your coding, but is there such a thing in Python that’s simple and quick? Luckily, there is!288
How to Build A Dashboard from Scratch in Python using StreamlitA Dashboard is a type of user interface which is used to have a visual representation of the relevant objective. The purpose of a dashboard is to simplify & streamline the data for the User.887
Master Python ComprehensionsOne of the most significant advantages of Python is that it’s a highly expressive language. Without much boilerplate, developers can come up with elegant solutions that, if well structured, read like a story. Here lies the beauty of the language, well presented in the Zen of Python.1043
TryHackMe | Python BasicsIn this story I will be sharing my process of completing the “Python Basics” Room in TryHackMe. Tasks 1–5 include some basic steps such as printing “Hello World” and I’m sure you all will get through it easily. Lets start from task 6:665
Setup a Ready-For-Production Python ProjectPython is one of the most used programming languages nowadays. It is very simple to set up, its syntax is quite user-friendly compared with Java, and has a lot of pre-built modules that can help to create machine learning algorithms. With Python, it’s very easy to build something that works.869
Python Useful Regex Quick ReferenceMore content at plainenglish.io. Sign up for our free weekly newsletter here.366
An Intro To HTTPXHttpx is a web client for Python that makes it easy to communicate with web servers. It supports multiple protocols, including HTTP, HTTPS, and FTP. It also supports authentication, including Basic and Digest authentication.928
5 More Python One-liners You Should UseIn this installment, we’ll be exploring some really cool sections of Python code. These short one-liners solve a wide range of problems and can get you out of a jam if you’ve managed to program yourself into a corner.1119
Built-in Python functions map( ), filter( ) & reduce( ) , you should literally learn right now.These functions are commonly used in functional-style python programming. These functions are most often used in conjunction with the anonymous ( lambda ) function, but you can use it with a normal function which defines by ( def ) key word.754
Logging in PythonThis article aims to outline the basics of logging and create a simple project that documents every event into a log file and later use this log file to analyze the errors.380
10 Advanced Automation Scripts for Your Python ProjectsThis cool automation script will compress your images into lower sizes without changing their Quality. The script uses the Pillow module and its built-in ANTIALIAS function. This automation script will help you to download and view Instagram DP.912
Hacking and Securing Python ApplicationsSecuring applications is not the easiest thing to do. An application has many components: server-side logic, client-side logic, data storage, data transportation, API, and more. With all these components to secure, building a secure application can seem really daunting.3938
PythonJonas A. In this tutorial, I’ll talk about how to send push notifications to yourself using Python and myNotifier.570
5 Python Libraries That Will Help Automate Your LifeThink of all the repetitive tasks you do at work. You send emails, create Excel reportings, extract data from PDFs, and (if you’re a data scientist like me) do tons of data analysis. Nobody wants to do that, but in the end, someone has to do it.1116
Automate Your Life Using PythonThere is a common trope in software that you have to be an expert to be able to write programs and this is just not true. In 2022, Software has become an integral part of life and everyone can get a piece of the pie.542
Malware extraction in Python with ScapyNetwork captures are common among security events. Malware present in any network communication can be easily extracted with tools like Wireshark. If you have many pcap files, how would you extract them all? Let’s walk through a script to extract PE Files from pcaps using Python and Scapy.1073
Async IO in Python: A Complete WalkthroughWatch Now This tutorial has a related video course created by the Real Python team. Watch it together with the written tutorial to deepen your understanding: Hands-On Python 3 Concurrency With the asyncio Module9957
Context Managers and Python's with StatementThe with statement in Python is a quite useful tool for properly managing external resources in your programs.7217
6 Python Libraries For Cyber Security Professionals and Ethical HackersThe Python libraries ethical hackers swear by.Python is one of the most growing computer languages in recent times due to its easiness and demand. But Python also plays a very crucial role in Cyber Security. In this article, I will mention 6 libraries which can give you a brief idea about same.503
How to Convert a String into a List in PythonWorking with a list in Python can be one of the most common tasks. However, not everything comes to you in the form of a list as input.549
3 Awesome Python Libraries That You Should Know AboutA few days ago, I published a blog on 5 Python Libraries That You Don’t Know About, But Should. That blog had dozens of thousands of views in less than a week. Thus, I decided to write a part two with other cool libraries that you should try out.1211
7 Python Libraries to Make Automation EasyOften it’s hard to find inspiration to automate using Python. I think knowing packages might give you an idea of what to automate. In this article, I’ll talk about 7 Python packages that can inspire your next automation. Usually, when you want to automate something, you might come across APIs.528
Understanding the Python GILDave Beazley's presentation from PyCon'2010 in Atlanta Georgia. This is a mirror of the original presentation hosted at http://blip.tv/pycon-us-videos-2009-2010-2011/pycon-2010-understanding-the-python-gil-82-3273690. David Beazley teaches intense in-person Python Programming and Computer Science0
Brython: Python in Your BrowserIf you’re a web developer who prefers writing Python over JavaScript, then Brython, a Python implementation that runs in the browser, may be an appealing option. JavaScript is the de facto language of front-end web development.14041
Creating the Perfect Python DockerfileIncrease your python code performance and security without changing the project source code. Having a reliable Dockerfile as your base can save you hours of headaches and bigger problems down the road.1820
CPython InternalsIf you haven’t heard of before, it’s a “guided tour” to the internals of the Python 3 interpreter. You’ll pick up the concepts, ideas, and technicalities of CPython in an approachable and hands-on fashion:467
Python monkey-patching like a bossIf you work in a big project, most likely you will meet situations, when you would like to change/improve used third-party library behaviour, and you try to modify it from your project. This is called monkey-patching and it is usually associated with something not obvious, which would like to avoid.997
Replacing an imported module dependencyIs it possible to make CustomModule replace its use of somemodule for somefakemodule without changing its code? That is, from ClientCode. Python will find somemodule in sys.modules and return the cached module, somefakemodule.305
Python sys.meta_path() ExamplesThe following are 30 code examples for showing how to use sys.meta_path(). These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example.2521
How to use sys.meta_path with Python 3.x?given is the one of the code snippet/ sample which we are using in my old application, I have to migrate this code from python2.7 to python3.7. If we run on python3 getting error as "KeyError: 'my_virtual_module'" but on python2 its giving an o/p "hello world".861
100 Helpful Python Tips You Can Learn Before Finishing Your Morning CoffeePython is quite popular nowadays, mainly due to its simplicity, and easiness to learn. You can use it for a wide range of tasks like data science and machine learning, web development, scripting, automation, etc.4708
Python 201: An Intro to importlibPython provides the importlib package as part of its standard library of modules. Its purpose is to provide the implementation to Python’s import statement (and the __import__() function).1101
An Intro to Threading in PythonWatch Now This tutorial has a related video course created by the Real Python team. Watch it together with the written tutorial to deepen your understanding: Threading in Python Python threading allows you to have different parts of your program run concurrently and can simplify your design.8541
Data Science Python TutorialsWhat is Python? Python is a common language for programming and scripting. It was created by Guido van Rossum and released in 1991.256
The Best VS Code Extensions for Python Developers for 2021We listed the best VS extensions for JS developers. Now, it’s time we do so for the Python community. Same as before: I’m a PyCharm user, I love PyCharm, and I won’t probably be changing editors anytime soon.887
Turn Photos into Cartoons Using PythonAs you might know, sketching or creating a cartoon doesn’t always need to be done manually. Nowadays, many apps can turn your photos into cartoons. But what if I tell you, that you can create your own effect with few lines of code?785
21 Python Mini Projects With CodeI have been using python for the last 1 and a half year, and the things that I most like about python is its one-liners and packages. One thing that I realize that the best way to learn a programming language is to build projects in it. In this blog, we will see 21 python projects with code.291