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)