标题可能与我的问题无关,因为我实际上并不需要无线文件传输脚本,我需要一个文件管理器类型。在
我想要的东西,我可以连接我的手机与我的电脑(例如:热点和wifi),然后我想显示文本文件浏览器(我有它的代码),通过发送所有文件和文件夹列表使用os.listdir(),每当选择的选项是一个文件(os.path.isdir() == False),我想传输文件并运行它(如:图片,视频等)。在
我编写的文件浏览器代码运行在windows和Android上(在做了一些更改之后),使用qpython。在
我的密码import os
def FileBrowser(cwd = os.getcwd()):
while True:
if cwd[-1:] != "\\":
cwd = cwd + "\\"
files = os.listdir(cwd)
count = 1
tmpp = ""
print("\n\n" + "_"*50 +"\n\n")
print(cwd + "\n")
for f in files:
if os.path.isdir(cwd + f) == True:
s1 = str(count) + ". " + f
tmps1 = 40 - (len(s1)+5)
t2 = int(tmps1/3)
s1 = s1 +