(Sep-27-2022, 10:03 AM)mg24 Wrote: without using global keyboard.Hmm global keyboard? maybe you meant global keyword.
files = Path.cwd().glob(f"*{coll}*") just for learning purpose.
It not a global keyword and it's ok to use like this.
Path.glob a trick it to make make it recursively is to add
**
.files = Path.cwd().glob(f"**/{coll}*")
(Sep-27-2022, 10:03 AM)mg24 Wrote: @app.command() what this line meanIt's a decorator this mean that can get a clean interface and hide all code that needed in background.
The author of Typer is also author of FastAPI where you see same decorator pattern.
Flask was one the library's first that used this way pattern a lot.
Flask
from flask import Flask app = Flask(__name__) @app.route("/") def hello_world(): return "<p>Hello, World!</p>"FastAPI
from fastapi import FastAPI app = FastAPI() @app.get("/") def read_root(): return {"Hello": "World"}Typer.
import typer app = typer.Typer() @app.command() def hello(name: str): print(f"Hello {name}")