Last active
April 19, 2024 07:05
-
-
Save ftnext/ab31bd23ebe5244df0ee2792af7ada43 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /// script | |
# dependencies = ["pydantic"] | |
# /// | |
import argparse | |
from pathlib import Path | |
from pydantic.dataclasses import dataclass | |
@dataclass | |
class Args: | |
path: Path | |
parser = argparse.ArgumentParser() | |
parser.add_argument("path") | |
args = parser.parse_args(namespace=Args) | |
print(args.path) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment