From f7a2fbcc5adc9a66a9e7f2943cef116a3fb1498a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jure=20=C5=A0orn?= Date: Sun, 15 Sep 2019 22:32:45 +0200 Subject: [PATCH] Table --- README.md | 7 +++---- index.html | 7 +++---- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index db56075..7c03ffd 100644 --- a/README.md +++ b/README.md @@ -2271,13 +2271,12 @@ Table #### Prints a CSV file as an ASCII table: ```python # $ pip3 install tabulate -from tabulate import tabulate -import csv +import csv, tabulate with open(, encoding='utf-8', newline='') as file: rows = csv.reader(file) header = [a.title() for a in next(rows)] - table = tabulate(rows, header) - print(table) + table = tabulate.tabulate(rows, header) +print(table) ``` diff --git a/index.html b/index.html index 8b39ae5..e4d2c6e 100644 --- a/index.html +++ b/index.html @@ -1958,13 +1958,12 @@ pyplot.show() # Displays figure.# Clears figure.

#Table

Prints a CSV file as an ASCII table:

# $ pip3 install tabulate
-from tabulate import tabulate
-import csv
+import csv, tabulate
 with open(<filename>, encoding='utf-8', newline='') as file:
     rows   = csv.reader(file)
     header = [a.title() for a in next(rows)]
-    table  = tabulate(rows, header)
-    print(table)
+    table  = tabulate.tabulate(rows, header)
+print(table)