擅长:python、mysql、java
<pre><code>for ext in "txt png jpg zip gif iso epub ico".split():
for file in glob("*.%s"%ext): #if there are no files of this type it just skips it
move_files(file,ext)
</code></pre>
<p>也许吧?你的问题不太清楚</p>
<p>在某种意义上,这是“自动检测”的,因为如果没有符合模式的文件,它将跳过<code>move_files</code>步骤</p>