diff options
author | luke@maurits.id.au <luke@maurits.id.au@0f58610c-415a-11de-9c03-5d6cfad8e937> | 2013-02-08 06:01:18 +0000 |
---|---|---|
committer | luke@maurits.id.au <luke@maurits.id.au@0f58610c-415a-11de-9c03-5d6cfad8e937> | 2013-02-08 06:01:18 +0000 |
commit | 8512d40283ea74c8506d8e5ba0a67529073a64bf (patch) | |
tree | 53cac5c416e73536794b10720b5914ceb48d28a9 | |
parent | 46f76a4731e195b332492573c09ab41b0343db64 (diff) | |
download | python-prettytable-8512d40283ea74c8506d8e5ba0a67529073a64bf.tar.gz |
Documented from_html.
git-svn-id: http://prettytable.googlecode.com/svn/branches/0.7@107 0f58610c-415a-11de-9c03-5d6cfad8e937
-rw-r--r-- | README | 13 |
1 files changed, 12 insertions, 1 deletions
@@ -64,9 +64,20 @@ fp = open("myfile.csv", "r") mytable = from_csv(fp) fp.close() +== Importing data from a HTML string == + +If you have a string containing a HTML <table>, you can read this data into a +PrettyTable like this: + +from prettytable import from_html +mytable = from_html(html_string) + == Importing data from a database cursor == -If you have your table data in a database which you can access using a library which confirms to the Python DB-API (e.g. an SQLite database accessible using the sqlite module), then you can build a PrettyTable using a cursor object, like this: +If you have your table data in a database which you can access using a library +which confirms to the Python DB-API (e.g. an SQLite database accessible using +the sqlite module), then you can build a PrettyTable using a cursor object, +like this: import sqlite3 from prettytable import from_db_cursor |