Bored of traditional CLIs? Develop interactive command lines with PyInquirer

Image for post
Image for post
Photo by Sigmund on Unsplash

Introduction:

Motivation:

  1. Are you bored of the traditional cli’s?
  2. Are you bored of documenting the commands for every single feature in the cli?


Understand the nuances of deep and shallow copy

Image for post
Image for post
Photo by Florian Olivo on Unsplash

Introduction:

Why is copy needed?


Generate pre-signed URLs for S3 objects in Python

Image for post
Image for post

Introduction:

Pre-signed URLs:


And how not to concatenate strings

Image for post
Image for post
Photo by Lance Grandahl on Unsplash

A simple concatenation:

x =  "hello"
y = "world"
print(x + y)
Output:
helloworld


Master the basics of Big O notation

Image for post
Image for post
Photo by Aron Visuals on Unsplash

What is Big O?

  1. Time-complexity
  2. space-complexity


Remove duplicates from a linked list in Python

Image for post
Image for post
Photo by Markus Spiske on Unsplash

Problem Statement:


Understanding namedtuples and their uses in Python

Image for post
Image for post
Photo by Markus Spiske on Unsplash

What are Named Tuples in python?

Revisiting tuples:


Create temporary files and directories in Python using tempfile

Image for post
Image for post
Photo by Ilya Pavlov on Unsplash


Develop asynchronous APIs using FastAPI

Image for post
Image for post
Photo by Jamie Street on Unsplash
from flask import Flask, jsonify

app = Flask(__name__)


@app.route("/", methods = ["GET"])
def index():
return jsonify({"appname" :"firstapp"}),200


if __name__ == "__main__":
app.run(debug=True)
* Serving Flask app "myflaskapi" (lazy loading)
* Environment: production
WARNING: This is a development server. Do not use it in a production deployment.
Use a production WSGI server instead.
* Debug mode: on
* Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
* Restarting with stat
* Debugger is active!
* Debugger PIN: 207-495-435
127.0.0.1 - - [25/Sep/2020 12:35:03] "GET / HTTP/1.1" …


try/except with return in python

Behaviour of return with try/except in Python

Image for post
Image for post

try/except statements

try:
f = open("testfile.txt")
...
except FileNotFoundError as e:
print(f" Error while reading file {e} ")
Output:
Error while reading file [Errno 2] No such file or directory: 'testfile.txt'

About

Dinesh Kumar K B

Python Developer, AWS certified solutions architect associate | CSM | Django | Flask | www.linkedin.com/in/dineshkumarkb

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store