當前位置: 首頁>>代碼示例>>Python>>正文


Python SimpleSQLite.get_table_name_list方法代碼示例

本文整理匯總了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())
開發者ID:furikake,項目名稱:SimpleSQLite,代碼行數:16,代碼來源:sample_get_table_name_list.py

示例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_()
開發者ID:furikake,項目名稱:SimpleSQLite,代碼行數:32,代碼來源:sample_create_table_from_json_single.py

示例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())
開發者ID:yedan2010,項目名稱:SimpleSQLite,代碼行數:16,代碼來源:sample_get_table_name_list.py


注:本文中的simplesqlite.SimpleSQLite.get_table_name_list方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。