擅长:python、mysql、java
<p>您可以使用自己的排序函数</p>
<pre><code>def custom_sort(x, y):
pass
#your custom sort
files_list = [x for x in sorted(os.listdir(path+"/slides/"), cmp=custom_sort) if os.path.isfile(path+"/slides/"+x)]
</code></pre>
<p><a href="https://wiki.python.org/moin/HowTo/Sorting/#The_Old_Way_Using_the_cmp_Parameter" rel="nofollow">doc</a></p>
<p>同时检查<a href="https://pypi.python.org/pypi/natsort" rel="nofollow">natsort</a></p>