python 游戏代码 百度网盘_Python | 用python代码导出百度网盘文件目录

用python代码导出百度网盘文件目录

fb98477756b8?utm_campaign=maleskine&utm_content=note&utm_medium=seo_notes&utm_source=recommendation

PyCharm 创建项目

一、用PyCharm 创建项目

新建一个py文件,baiduexport.py,贴入以下代码:

__title__ = ''

__author__ = 'jungle'

__mtime__ = '2019-01-18'

"""

#!/usr/bin/env python3

# -*- coding:utf-8 -*-

from tkinter import *

from tkinter.filedialog import askopenfilename

from tkinter.filedialog import asksaveasfilename

from tkinter.ttk import *

import sqlite3

def select_db_file():

db_file = askopenfilename(title="请选择BaiduYunCacheFileV0.db文件", filetypes=[('db', '*.db')])

db.set(db_file)

def select_save_file():

save_file = asksaveasfilename(filetypes=[('文件', '*.txt')])

f.set(save_file + ".txt")

def write_file(file_dict, f, item, gap=""):

if item == "/":

f.write("━" + "/" + "\n")

for i in file_dict["/"]:

f.write("┣" + "━" + i + "\n")

i = item + i + "/"

if i in file_dict:

write_file(file_dict, f, i, gap="┣━")

else:

gap = "┃ " + gap

for i in file_dict[item]:

f.write(gap + i + "\n")

i = item + i + "/"

if i in file_dict:

write_file(file_dict, f, i, gap)

def create_baiduyun_filelist():

file_dict = {}

conn = sqlite3.connect(db.get())

cursor = conn.cursor()

cursor.execute("select * from cache_file")

while True:

value = cursor.fetchone()

if not value:

break

path = value[2]

name = value[3]

size = value[4]

isdir = value[6]

if path not in file_dict:

file_dict[path] = []

file_dict[path].append(name)

else:

file_dict[path].append(name)

with open(f.get(), "w", encoding='utf-8') as fp:

write_file(file_dict, fp, "/")

root = Tk()

root.title('百度云文件列表生成工具')

db_select = Button(root, text=' 选择DB文件 ', command=select_db_file)

db_select.grid(row=1, column=1, sticky=W, padx=(2, 0), pady=(2, 0))

db = StringVar()

db_path = Entry(root, width=80, textvariable=db)

db_path['state'] = 'readonly'

db_path.grid(row=1, column=2, padx=3, pady=3, sticky=W + E)

save_path = Button(root, text='选择保存地址', command=select_save_file)

save_path.grid(row=2, column=1, sticky=W, padx=(2, 0), pady=(2, 0))

f = StringVar()

file_path = Entry(root, width=80, textvariable=f)

file_path['state'] = 'readonly'

file_path.grid(row=2, column=2, padx=3, pady=3, sticky=W + E)

create_btn = Button(root, text='生成文件列表', command=create_baiduyun_filelist)

create_btn.grid(row=3, column=1, columnspan=2, pady=(0, 2))

root.columnconfigure(2, weight=1)

root.mainloop()

二、运行

fb98477756b8?utm_campaign=maleskine&utm_content=note&utm_medium=seo_notes&utm_source=recommendation

运行结果

三、选择db文件目录

选择百度云安装文件夹的users文件夹下的BaiduYunCacheFileV0.db这个文件。

四、设置生成的目录文件位置

可设置到任何你找到的位置,文件为txt文本文件。

fb98477756b8?utm_campaign=maleskine&utm_content=note&utm_medium=seo_notes&utm_source=recommendation

设置

五、单击“生成文件列表”

fb98477756b8?utm_campaign=maleskine&utm_content=note&utm_medium=seo_notes&utm_source=recommendation

部分目录

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
python学习课件+python源码90个合集: 002用Python设计第一个游戏(课件+源代码) 004改进我们的小游戏(课件+源代码) 005闲聊之Python的数据类型(课件+源代码) 007了不起的分支和循环(课件) 008了不起的分支和循环2(课件+源代码) 009了不起的分支和循环3(课件+源代码) 017函数:Python的乐高积木(课件+源代码) 019函数:我的地盘听我的(课件+源代码) 022函数:递归是神马(课件+源代码) 023递归:这帮小兔崽子(课件+源代码) 024递归:汉诺塔(课件+源代码) 028文件:因为懂你,所以永恒(课件+源代码) 029文件:一个任务(课件+源代码) 031永久存储:腌制一缸美味的泡菜(课件+源代码) 034丰富的else语句及简洁的with语句(课件+源代码) 034丰富的else语句及简洁的with语句(课件+源代码)(1) 036类和对象:给大家介绍对象(课件 源代码) 037类和对象:面向对象编程(课件 源代码) 038类和对象:继承(课件 源代码) 039类和对象:拾遗(课件 源代码) 045魔法方法:属性访问(课件 源代码) 046魔法方法:描述符(Property的原理)(课件 源代码) 047魔法方法:定制序列(课件 源代码) 048魔法方法:迭代器(课件 源代码) 049乱入:生成器(课件) 050模块:模块就是程序(课件 源代码) 051模块:__name__=_'__main___'、搜索路径和包(课件 源代码) 052模块:像个极客一样去思考(课件) 053论一只爬虫的自我修养(课件) 054论一只爬虫的自我修养2:实战(课件 源代码) 055论一只爬虫的自我修养3:隐藏(课件 源代码) 056论一只爬虫的自我修养4:OOXX(源代码) 062论一只爬虫的自我修养10:安装Scrapy(课件+软件包) 063论一只爬虫的自我修养11:Scrapy框架之初窥门径(课件 源代码) 064GUI的终极选择:Tkinter(课件 源代码) 065GUI的终极选择:Tkinter2(源代码) 066GUI的终极选择:Tkinter3(源代码) 067GUI的终极选择:Tkinter4(源代码) 068GUI的终极选择:Tkinter5(源代码) 069GUI的终极选择:Tkinter6(源代码) 070GUI的终极选择:Tkinter7(源代码) 071GUI的终极选择:Tkinter8(源代码) 072GUI的终极选择:Tkinter9(源代码) 073GUI的终极选择:Tkinter10(源代码) 074GUI的终极选择:Tkinter11(源代码) 075GUI的终极选择:Tkinter12(源代码) 076GUI的终极选择:Tkinter13(源代码) 077GUI的终极选择:Tkinter14(源代码) 078Pygame:初次见面,请大家多多关照(源代码) 080Pygame:事件(源代码) 081Pygame:提高游戏的颜值1(源代码) 082Pygame:提高游戏的颜值2(源代码) 083Pygame:提高游戏的颜值3(源代码) 084Pygame:基本图形绘制(源代码) 085Pygame:动画精灵(源代码) 086Pygame:碰撞检测(源代码) 087Pygame:播放声音和音效(课件 源代码) 088Pygame:摩擦摩擦(源代码) 089Pygame:游戏胜利(源代码) 090Pygame:飞机大战1(源代码) 091Pygame:飞机大战2(源代码) 093Pygame:飞机大战4(源代码) 094Pygame:飞机大战5(源代码) 095Pygame:飞机大战6(源代码) 096Pygame:飞机大战7(源代码) easygui-docs-0.96 Pyhon之常用操作符(课件) 下载必看.txt 元组:戴上了枷锁的列表(课件) 函数:内嵌函数和闭包(课件) 函数:灵活即强大(课件) 列表:一个打了激素的数组2(课件) 列表:一个打了激素的数组3(课件) 列表:一个打了激素的数组(课件) 字典:当索引不好用时(课件) 字符串:各种奇葩的内置方法(课件) 字符串:格式化(课件) 小插曲之变量和字符串(课件) 序列!序列!(课件) 异常处理:你不可能总是对的(课件) 愉快的开始(课件)
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值