📝 Add docs for first steps

This commit is contained in:
Sebastián Ramírez 2019-12-24 13:32:50 +01:00
parent fad33cb49d
commit 02a63e73b2
5 changed files with 51 additions and 0 deletions

View file

@ -0,0 +1,9 @@
import typer
def main():
typer.echo("Hello World")
if __name__ == "__main__":
typer.run(main)

View file

@ -0,0 +1,9 @@
import typer
def main(name: str):
typer.echo(f"Hello {name}")
if __name__ == "__main__":
typer.run(main)

View 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)

View 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)

View 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)