Python CSV to UTF-8

This article concerns the conversion and handling of CSV file formats in combination with the UTF-8 encoding standard. πŸ’‘ The Unicode Transformation Format 8-Bit (UTF-8) is a variable-width character encoding used for electronic communication. UTF-8 can encode more than 1 million (more or less weird) characters using 1 to 4 byte code units. Example UTF-8 … Read more

How to Check the Plotly Dash Version in Python?

How to Check the Plotly Dash Version in the Terminal or Shell (Unix/macOS/Linux/Windows? To check the dash version in your Windows, Unix, macOS, or Linux environment, you can run the command pip list in your terminal or shell and locate the dash output with version information in the format x.y.z (e.g., 2.5.1) Here’s an example … Read more

How to Erase Contents of a File

Problem Formulation and Solution Overview In this article, you’ll learn how to erase the contents of a file in Python. To make it more fun, we have the following running scenario: Let’s say you have a Python script that retrieves the daily stock exchange prices for five (5) Tech Companies and saves it to prices.txt. … Read more

Python Getpass Module: A Simple Guide + Video

The Python getpass module provides portable password input functionality and allows you to accept an input string in a command-line interface (CLI) without the string being typed from being visible (echoed) in the interface. The getpass module also includes a getuser function for retrieving a username from the relevant environment variables. In this getpass Python … Read more

How to Open Multiple Files in Python

Problem Formulation and Solution Overview In this article, you’ll learn how to open multiple files in Python. πŸ’¬ Question: How would we write Python code to open multiple files? We can accomplish this task by one of the following options: Method 1: Open Multiple Text Files using open() Method 2:Open Multiple Text Files using open() … Read more

Computer Science Researcher – Income & Opportunity

Before we learn about the money, let’s get this question out of the way: What Does a Computer Science Research Scientist Do? A computer science researcher and scientist identifies and answers open research questions in computer science. They apply scientific reasoning and research techniques to push the state-of-the-art forward in various fields such as machine … Read more

Embedded Applications Engineer — Income and Opportunity

Before we learn about the money, let’s get this question out of the way: What is an Embedded Applications Engineer? An embedded systems engineer applies software development and embedded systems knowledge to design, create, develop, debug, and maintain embedded applications and products. Other terms with similar job descriptions are often used interchangeably: Embedded systems engineer … Read more

How to Search for Specific Files Only in Subdirectories in Python?

[toc] Problem Formulation: Let’s say we have a directory containing other subdirectories which further contain files. How do we search for a specific file in the subdirectories in our Python script? Scenario: We have a parent folder (Parent) with child folders (child_1, child_2, and child_3). There are files in the parent directory/folder as well as … Read more

Extract File Name From the Path, No Matter What the os/path Format

Summary: os.path.basename(path) enables us to get the file name from the path, no matter what the os/path format. Another workaround is to use the ntpath module, which is equivalent to os.path. ✨Problem: How to extract the filename from a path, no matter what the operating system or path format is? For example, let’s suppose that … Read more

How To Get The Filename Without The Extension From A Path In Python?

[toc] Problem Statement: How to get the filename without the extension from a path in Python? Example: Suppose you have a file with the following path: C:\Users\SHUBHAM SAYON\Documents\folder1 Here, we just need to get the filename, i.e. “demo“.  In Python, files are used to store information.  We can perform many operations on the files- read, write, … Read more