(对不起,如果这个问题有误导性,我也不知道怎么说得好。)
使用此代码时:
Which do you wish to modify?boom.wav
File does not exist or not available. please select another.
这表明该文件存在,而且' boom.wav'正在被代码看到。然而,在" #Section with Trouble" (即输入boom.wav),我得到输出:
{{1}}
这意味着它提升了其他'言。
为什么我无法访问' boom.wav'?
答案 0 :(得分:0)
更改
if selected_file in ("Imports")
到
if selected_file in os.listdir("Imports")
("Imports")
只是一个字符串,不是你想要的。
答案 1 :(得分:0)
if selected_file in ("Imports"):
正在检查字符串'boom.wav'
中是否"Imports"
(显然不是)。这意味着'port'
或'mpo'
之类的内容会匹配。
使用:
if selected_file in os.listdir('Imports'):