以下代码会产生listdir()
import os
dir = '.'
allfiles = os.listdir(dir)
files = [ fname for fname in allfiles if fname.endswith('.mp4')]
print files
答案 0 :(得分:1)
试试此代码
<IfModule mod_rewrite.c>
RewriteBase /www/
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([a-zA-Z0-9_-]+)$ profile.php?u=$1 [L]
RewriteRule ^([a-zA-Z0-9_-]+)/$ profile.php?u=$1 [L]
RewriteRule ^albums/([a-zA-Z0-9_-]+)$ view_albums.php?u=$1 [L]
RewriteRule ^albums/view_photo/([a-zA-Z0-9_-]+)$ view_photo.php?uid=$1 [L]
</ifModule>