In today’s fast-paced world of software development, concurrency and multithreading are essential concepts that every developer should understand. These concepts enable developers to write efficient, scalable, and responsive applications by leveraging the power of multiple cores in modern computing architectures.

1 min read
async def fetch(url: str) -> str:
 async with aiohttp.ClientSession() as session:
 async with session.get(url) as response:
 return await response.text()

WSGI vs ASGI Protocols

Comprehensive guide comparing WSGI and ASGI protocols in Python web development. Learn key differences, implementation examples, and when to use each protocol for optimal web application performance.

1 min read
def app(environ, start_response):
 start_response('200 OK', [('Content-Type', 'text/plain')])
 return [b'Hello, World!'] 

Réflexions 2024

Un résumé des livres que j'ai lus et des choses que j'ai apprises en 2024.

1 min read
> La simplicité est la sophistication ultime. - Leonardo da Vinci

Python Virtual Environments

1 min read
 FROM python:3.7
 WORKDIR ['/app']
 COPY ['requirements.txt', '/app']
 RUN ['pip', 'install', '--no-cache-dir', 'upgrade', '-r', 'requirements.txt']
 COPY ['/app', '/app']
 CMD ['uvicorn', 'app:app', '--host', '0.0.0.0', '--port', '80' 

Python Great Features

Python have great features that make it easy to use different programming paradigms. Let's explore some of the best features of Python.

1 min read
def stateful_function():
 cache = {}
 def wrapper_function(*args, **kwargs):
    key = str(args) + st(kwargs)
    if key not in cache:
       cache[key] = func(*args, **kwargs)
     return cache[key]

 return wrapper_function

@stateful_function
 def fibonacci(n):
    if n < 2:
      return n
    return fibonacci(n-1) + fibonacci(n-2) 

Terminal Basics

Terminal Basics for Linux and Mac OS

1 min read
 mkdir dir_name
 cd dir_name
 touch file_name
 echo 'foo' > file_name
 ls
 cat file_name
 rm file_name
 

Python Basics

Python is a great language for beginners and experts alike. Let's explore the basics of Python. From modules, packages, scope, and more. Let's dive in!

1 min read
def outer():
  x = 'local'
  def inner():
     nonlocal x
     x = 'nonlocal'
 inner()

if __name__ == '__main__':
   outer()