🎨 Update terminal examples and Typer note (#1139)

* 🎨 Update terminal examples with Termynal

* 🍱 Add Termynal scripts and styles from Typer for terminal examples
This commit is contained in:
Sebastián Ramírez
2020-03-19 14:39:29 +01:00
committed by GitHub
parent 025b38df40
commit faf88cea0b
22 changed files with 801 additions and 77 deletions

View File

@@ -12,10 +12,14 @@ In your FastAPI application, import and run `uvicorn` directly:
The main purpose of the `__name__ == "__main__"` is to have some code that is executed when your file is called with:
```bash
python myapp.py
<div class="termy">
```console
$ python myapp.py
```
</div>
but is not called when another file imports it, like in:
```Python
@@ -28,10 +32,14 @@ Let's say your file is named `myapp.py`.
If you run it with:
```bash
python myapp.py
<div class="termy">
```console
$ python myapp.py
```
</div>
then the internal variable `__name__` in your file, created automatically by Python, will have as value the string `"__main__"`.
So, the section: