Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/334.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python sqlite3中可用的所有数据库和表的列表_Python_Django_Sqlite_Django Views - Fatal编程技术网

Python sqlite3中可用的所有数据库和表的列表

Python sqlite3中可用的所有数据库和表的列表,python,django,sqlite,django-views,Python,Django,Sqlite,Django Views,我正在尝试获取sqlite3中所有数据库的列表。在这里,我只想打印我可用的所有数据库名称,一旦单击某个特定数据库,我将打印该特定数据库下可用的所有表。以下是我的视图代码片段: def analyzer(request): serv = sqlite3.connect(host = "localhost", user = "root", passwd = "abcdefg") c = serv.cursor() c.execute(&qu

我正在尝试获取sqlite3中所有数据库的列表。在这里,我只想打印我可用的所有数据库名称,一旦单击某个特定数据库,我将打印该特定数据库下可用的所有表。以下是我的视图代码片段:

def analyzer(request):
serv = sqlite3.connect(host = "localhost", user = "root", passwd = "abcdefg")
c = serv.cursor()
c.execute("SHOW DATABASES")
l = c.fetchall()
print (l)
# l = [ i[0] for i in l ]
# print (l)
return render(request, 'analyzer.html')