Basics

pathlib

Why patblib? The pathlib module, introduced in Python 3.4 (PEP 428), gathers the necessary functionality in one place and makes it available through methods and properties on an easy-to-use Path object.

2020-12-26

glob

The glob module finds all the pathnames matching a specified pattern according to the rules used by the Unix shell. If you need a list of filenames that all have a certain extension, prefix, or any common string in the middle, use glob instead of writing code to scan the directory contents yourself.

2020-12-25

YAML in Python

YAML YAML = YAML Ain’t Markup Language Human-readable data-serialization language It is commonly used for configuration files, but it is also used in data storage (e.g. debugging output) or transmission (e.

2020-12-09

JSON

TL;DR Python and JSON conversion JSON (JavaScript Object Notation) is a popular data format used for representing structured data. It’s common to transmit and receive data between a server and web application in JSON format.

2020-12-09

File I/O

What is a File? At its core, a file is a contiguous set of bytes used to store data. This data is organized in a specific format and can be anything as simple as a text file or as complicated as a program executable.

2020-11-19

Working with Files

with open(...) as ... pattern open() opens file for reading or writing and returns a file handle Use appropriate methods to read or write this file handel Example Read with open('data.

2020-11-19

Modules and Packages

Modular programming refers to the process of breaking a large, unwieldy programming task into separate, smaller, more manageable subtasks or modules. Individual modules can then be cobbled together like building blocks to create a larger application.

2020-10-29

f-string

Python f-string is the newest Python syntax to do string formatting. Python f-strings provide a faster, more readable, more concise, and less error prone way of formatting strings in Python. 👏

2020-10-21

Getting Started

Source This is the summary of the book “A Whirlwind Tour of Python” by Jake VanderPlas. You can view it in nbviewer: A whirlwind Tour of Python, or Github: A whirlwind Tour of Python import this The Zen of Python, by Tim Peters Beautiful is better than ugly.

2020-08-30

[Issues] Dictionary

Get Dictionary Items with Specified Initialization dict.get(key, default = None)) returns the value of the item with the specified key. Parameters key − This is the Key to be searched in the dictionary.

2020-07-08