本文整理汇总了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())