tar -xvzf Python-2.7.3.tgz
./configure -prefix=/usr/local/python2.7
make
make install
ln -sf /usr/local/python2.7/bin/python2.7 /usr/bin/python
**********************************************************************************************:循环遍历绝对路径下及子目录下的.mp4文件
# coding utf-8
import os,sys
import fnmatch
def all_files(root,patterns='*',single_level=False,yield_folders=False):
patterns =patterns.split(';')
for path,subdir,files in os.walk(root):
if yield_folders:
files.extend(subdir)
files.sort()
for name in files:
for pattern in patterns:
if fnmatch.fnmatch(name, pattern):
yield os.path.join(path,name)
break
if single_level:
break
if __name__ == "__main__":
for path in all_files('/opt/360','*.mp4'):
print path
分享到:
相关推荐
Python全套教程 Python基础python基础课代码+文档2023最新教程【樵夫教你学Python】Python全套教程 Python基础python基础课代码+文档2023最新教程【樵夫教你学Python】Python全套教程 Python基础python基础课代码+...
python3.7_python3.8_python3.9_python3.10对应的dlib安装包.whl.zippython3.7_python3.8_python3.9_python3.10对应的dlib安装包.whl.zippython3.7_python3.8_python3.9_python3.10对应的dlib安装包.whl.zippython...
Python4Delphi 是一个强大的工具,它允许 Delphi 和 C++Builder 开发人员在他们的应用程序中无缝集成 Python 语言。这个工具提供了丰富的接口,使得 Delphi 和 Python 之间可以进行高效的交互,极大地扩展了 Delphi ...
python管理系统(python+mysql)代码.zipPython管理系统(python+mysql)代码.zipPython管理系统(python+mysql)代码.zipPython管理系统(python+mysql)代码.zipPython管理系统(python+mysql)代码.zipPython管理...
Python零基础入门到精通Python零基础入门到精通学习教程--Python零基础入门到精通Python零基础入门到精通学习教程--Python零基础入门到精通Python零基础入门到精通学习教程--Python零基础入门到精通Python零基础入门...
Python 根据用户输入编码批量生成EAN-13条形码 Python源码Python 根据用户输入编码批量生成EAN-13条形码 Python源码Python 根据用户输入编码批量生成EAN-13条形码 Python源码Python 根据用户输入编码批量生成EAN-13...