📝 Add docs for first steps
This commit is contained in:
parent
fad33cb49d
commit
02a63e73b2
5 changed files with 51 additions and 0 deletions
9
docs/src/first_steps/tutorial001.py
Normal file
9
docs/src/first_steps/tutorial001.py
Normal file
|
@ -0,0 +1,9 @@
|
|||
import typer
|
||||
|
||||
|
||||
def main():
|
||||
typer.echo("Hello World")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
typer.run(main)
|
9
docs/src/first_steps/tutorial002.py
Normal file
9
docs/src/first_steps/tutorial002.py
Normal file
|
@ -0,0 +1,9 @@
|
|||
import typer
|
||||
|
||||
|
||||
def main(name: str):
|
||||
typer.echo(f"Hello {name}")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
typer.run(main)
|
9
docs/src/first_steps/tutorial003.py
Normal file
9
docs/src/first_steps/tutorial003.py
Normal file
|
@ -0,0 +1,9 @@
|
|||
import typer
|
||||
|
||||
|
||||
def main(name: str, lastname: str):
|
||||
typer.echo(f"Hello {name} {lastname}")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
typer.run(main)
|
12
docs/src/first_steps/tutorial004.py
Normal file
12
docs/src/first_steps/tutorial004.py
Normal file
|
@ -0,0 +1,12 @@
|
|||
import typer
|
||||
|
||||
|
||||
def main(name: str, lastname: str, formal: bool = False):
|
||||
if formal:
|
||||
typer.echo(f"Good day Ms. {name} {lastname}.")
|
||||
else:
|
||||
typer.echo(f"Hello {name} {lastname}")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
typer.run(main)
|
12
docs/src/first_steps/tutorial005.py
Normal file
12
docs/src/first_steps/tutorial005.py
Normal file
|
@ -0,0 +1,12 @@
|
|||
import typer
|
||||
|
||||
|
||||
def main(name: str, lastname: str = "", formal: bool = False):
|
||||
if formal:
|
||||
typer.echo(f"Good day Ms. {name} {lastname}.")
|
||||
else:
|
||||
typer.echo(f"Hello {name} {lastname}")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
typer.run(main)
|
Loading…
Reference in a new issue