Skip to content

Commit a99f642

Browse files
adetorcykamwoods
authored andcommittedJun 10, 2022
Update header fields example
1 parent 6093bfc commit a99f642

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed
 

‎header_fields.ipynb

+6-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"source": [
1010
"from pathlib import Path\n",
1111
"\n",
12+
"from prettytable import PrettyTable\n",
1213
"from sqlalchemy import create_engine\n",
1314
"from sqlalchemy.orm import sessionmaker\n",
1415
"\n",
@@ -168,8 +169,12 @@
168169
"outputs": [],
169170
"source": [
170171
"# Header fields for that message\n",
172+
"results = PrettyTable(field_names=[\"name\", \"value\"], align=\"l\")\n",
173+
"\n",
171174
"for header in message.header_fields:\n",
172-
" print(f\"{header.name}: {header.value}\")"
175+
" results.add_row([header.name, header.value])\n",
176+
"\n",
177+
"print(results)"
173178
]
174179
},
175180
{

‎requirements.in

+1
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ ipywidgets
88
matplotlib
99
sklearn
1010
terminado
11+
prettytable

‎requirements.txt

+3
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,8 @@ preshed==3.0.6
269269
# libratom
270270
# spacy
271271
# thinc
272+
prettytable==3.3.0
273+
# via -r requirements.in
272274
prometheus-client==0.14.1
273275
# via
274276
# jupyter-server
@@ -442,6 +444,7 @@ wcwidth==0.2.5
442444
# via
443445
# blessed
444446
# libratom
447+
# prettytable
445448
# prompt-toolkit
446449
webencodings==0.5.1
447450
# via

0 commit comments

Comments
 (0)