Skip to content

Commit d736792

Browse files
committed
Level 01: getpass in Notebook
1 parent 2874fdd commit d736792

2 files changed

Lines changed: 33 additions & 40 deletions

File tree

Level_01/Ein_Ausgabe.py

Lines changed: 0 additions & 38 deletions
This file was deleted.

Level_01/Level_1.ipynb

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -535,6 +535,32 @@
535535
"print(type(eingabe))"
536536
]
537537
},
538+
{
539+
"cell_type": "markdown",
540+
"metadata": {},
541+
"source": [
542+
"Wenn wir statt `input()` `getpass()` verwenden, dann verhält es sich quasi genau so, nur die Eingabe wird nicht angezeigt:"
543+
]
544+
},
545+
{
546+
"cell_type": "code",
547+
"execution_count": 4,
548+
"metadata": {},
549+
"outputs": [
550+
{
551+
"name": "stdout",
552+
"output_type": "stream",
553+
"text": [
554+
"geheim\n"
555+
]
556+
}
557+
],
558+
"source": [
559+
"from getpass import getpass\n",
560+
"password = getpass(\"Passwort: \")\n",
561+
"print(password)"
562+
]
563+
},
538564
{
539565
"cell_type": "markdown",
540566
"metadata": {},
@@ -665,7 +691,7 @@
665691
],
666692
"metadata": {
667693
"kernelspec": {
668-
"display_name": "Python 3",
694+
"display_name": "Python 3.10.6 64-bit",
669695
"language": "python",
670696
"name": "python3"
671697
},
@@ -679,7 +705,12 @@
679705
"name": "python",
680706
"nbconvert_exporter": "python",
681707
"pygments_lexer": "ipython3",
682-
"version": "3.6.7"
708+
"version": "3.10.6"
709+
},
710+
"vscode": {
711+
"interpreter": {
712+
"hash": "767d51c1340bd893661ea55ea3124f6de3c7a262a8b4abca0554b478b1e2ff90"
713+
}
683714
}
684715
},
685716
"nbformat": 4,

0 commit comments

Comments
 (0)