7 Sources of Passive Income for Coders

These are the types of passive income: Affiliate earnings Advertising earnings eBooks Online courses SaaS Index funds and exchange-traded funds (ETFs) Real estate ChrisWhile working as a researcher in distributed systems, Dr. Christian Mayer found his love for teaching computer science students. To help students reach higher levels of Python success, he founded the programming … Read more

Python One Line Reverse Shell

This article will be fun! You’ll learn about an important concept in security: reverse shells. You’ll also learn how to create reverse shells in Python in a single line of code. So, let’s start with the big question: What is a Reverse Shell? Here’s the definition of a Reverse Shell: A reverse shell is used … Read more

How to Execute Multiple Lines in a Single Line Python From Command-Line?

Summary: To make a Python one-liner out of any multi-line Python script, replace the new lines with a new line character ‘\n’ and pass the result into the exec(…) function. You can run this script from the outside (command line, shell, terminal) by using the command python -c “exec(…)”. Problem: Given a multi-line code script … Read more

Python One Line Exception Handling

Summary: You can accomplish one line exception handling with the exec() workaround by passing the one-linerized try/except block as a string into the function like this: exec(‘try:print(x)\nexcept:print(“Exception!”)’). This general method works for all custom, even multi-line, try and except blocks. However, you should avoid this one-liner code due to the bad readability. Surprisingly, there has … Read more

Python Freelancing: My First Fiverr Gig and How I Solved It

Basic Webscraping Script in Python | Requests | BeautifulSoup | ArgParse Sold Gig ($35) This is the gig description I offered on my profile to get my first gig: An email marketing company hired me to write a Python script that satisfies the following requirements. Requirements What is the input? (file, file type, email, text,…) … Read more