本文整理匯總了Python中simplesqlite.SimpleSQLite.get_table_name_list方法的典型用法代碼示例。如果您正苦於以下問題:Python SimpleSQLite.get_table_name_list方法的具體用法?Python SimpleSQLite.get_table_name_list怎麽用?Python SimpleSQLite.get_table_name_list使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類simplesqlite.SimpleSQLite
的用法示例。
在下文中一共展示了SimpleSQLite.get_table_name_list方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: SimpleSQLite
# 需要導入模塊: from simplesqlite import SimpleSQLite [as 別名]
# 或者: from simplesqlite.SimpleSQLite import get_table_name_list [as 別名]
#!/usr/bin/env python
# encoding: utf-8
from simplesqlite import SimpleSQLite
import six
con = SimpleSQLite("sample.sqlite", "w")
con.create_table_with_data(
table_name="hoge",
attribute_name_list=["attr_a", "attr_b"],
data_matrix=[[1, "a"], [2, "b"]])
six.print_(con.get_table_name_list())
示例2: open
# 需要導入模塊: from simplesqlite import SimpleSQLite [as 別名]
# 或者: from simplesqlite.SimpleSQLite import get_table_name_list [as 別名]
#!/usr/bin/env python
# encoding: utf-8
from simplesqlite import SimpleSQLite
import six
file_path = "sample_data_single.json"
# create sample data file ---
with open(file_path, "w") as f:
f.write("""[
{"attr_b": 4, "attr_c": "a", "attr_a": 1},
{"attr_b": 2.1, "attr_c": "bb", "attr_a": 2},
{"attr_b": 120.9, "attr_c": "ccc", "attr_a": 3}
]""")
# create table ---
con = SimpleSQLite("sample.sqlite", "w")
con.create_table_from_json(file_path)
# output ---
for table_name in con.get_table_name_list():
six.print_("table: " + table_name)
six.print_(con.get_attribute_name_list(table_name))
result = con.select(select="*", table_name=table_name)
for record in result.fetchall():
six.print_(record)
six.print_()
示例3: SimpleSQLite
# 需要導入模塊: from simplesqlite import SimpleSQLite [as 別名]
# 或者: from simplesqlite.SimpleSQLite import get_table_name_list [as 別名]
#!/usr/bin/env python
# encoding: utf-8
from __future__ import print_function
from simplesqlite import SimpleSQLite
con = SimpleSQLite("sample.sqlite", "w")
con.create_table_from_data_matrix(
table_name="hoge",
attr_name_list=["attr_a", "attr_b"],
data_matrix=[[1, "a"], [2, "b"]])
print(con.get_table_name_list())