file_list(path):遍历文件列表[python]
import os def __file_list__(path, level):
files = os.listdir(path);
for i in files:
path_tmp = path + i;
if True == os.path.isdir(path_tmp):
print("%s[DIR] %s" % (level_flag * level, path_tmp));
__file_list__(path_tmp + "/", level + 1);
else:
print("%s[FILE] %s" % (level_flag * level, path_tmp));
pass def file_list(path):
level = 0;
global level_flag; # 定义为全局变量
level_flag = "\t";
__file_list__(path, level);
pass def main():
path = "E:/workspace/Python/201802/";
file_list(path);
pass main();
output:
E:\workspace\Python\201802\venv\Scripts\python.exe E:/workspace/Python/201802/py_study/fileList.py
[DIR] E:/workspace/Python/201802/.idea
[FILE] E:/workspace/Python/201802/.idea/201802.iml
[DIR] E:/workspace/Python/201802/.idea/inspectionProfiles
[FILE] E:/workspace/Python/201802/.idea/misc.xml
[FILE] E:/workspace/Python/201802/.idea/modules.xml
[FILE] E:/workspace/Python/201802/.idea/webResources.xml
[FILE] E:/workspace/Python/201802/.idea/workspace.xml
[FILE] E:/workspace/Python/201802/execute.py
[FILE] E:/workspace/Python/201802/Perceptron.py
[DIR] E:/workspace/Python/201802/py_study
[FILE] E:/workspace/Python/201802/py_study/fileList.py
[FILE] E:/workspace/Python/201802/py_study/file_demo.py
[FILE] E:/workspace/Python/201802/py_study/helloWorld.py
[FILE] E:/workspace/Python/201802/test_data.csv
[DIR] E:/workspace/Python/201802/venv
[DIR] E:/workspace/Python/201802/venv/Include
[FILE] E:/workspace/Python/201802/venv/Include/abstract.h
[FILE] E:/workspace/Python/201802/venv/Include/accu.h
[FILE] E:/workspace/Python/201802/venv/Include/asdl.h
[FILE] E:/workspace/Python/201802/venv/Include/ast.h
[FILE] E:/workspace/Python/201802/venv/Include/bitset.h
[FILE] E:/workspace/Python/201802/venv/Include/bltinmodule.h
[FILE] E:/workspace/Python/201802/venv/Include/boolobject.h
[FILE] E:/workspace/Python/201802/venv/Include/bytearrayobject.h
[FILE] E:/workspace/Python/201802/venv/Include/bytesobject.h
[FILE] E:/workspace/Python/201802/venv/Include/bytes_methods.h
[FILE] E:/workspace/Python/201802/venv/Include/cellobject.h
[FILE] E:/workspace/Python/201802/venv/Include/ceval.h
[FILE] E:/workspace/Python/201802/venv/Include/classobject.h
[FILE] E:/workspace/Python/201802/venv/Include/code.h
[FILE] E:/workspace/Python/201802/venv/Include/codecs.h
[FILE] E:/workspace/Python/201802/venv/Include/compile.h
[FILE] E:/workspace/Python/201802/venv/Include/complexobject.h
[FILE] E:/workspace/Python/201802/venv/Include/datetime.h
[FILE] E:/workspace/Python/201802/venv/Include/descrobject.h
[FILE] E:/workspace/Python/201802/venv/Include/dictobject.h
[FILE] E:/workspace/Python/201802/venv/Include/dtoa.h
[FILE] E:/workspace/Python/201802/venv/Include/dynamic_annotations.h
[FILE] E:/workspace/Python/201802/venv/Include/enumobject.h
[FILE] E:/workspace/Python/201802/venv/Include/errcode.h
[FILE] E:/workspace/Python/201802/venv/Include/eval.h
[FILE] E:/workspace/Python/201802/venv/Include/fileobject.h
[FILE] E:/workspace/Python/201802/venv/Include/fileutils.h
[FILE] E:/workspace/Python/201802/venv/Include/floatobject.h
[FILE] E:/workspace/Python/201802/venv/Include/frameobject.h
[FILE] E:/workspace/Python/201802/venv/Include/funcobject.h
[FILE] E:/workspace/Python/201802/venv/Include/genobject.h
[FILE] E:/workspace/Python/201802/venv/Include/graminit.h
[FILE] E:/workspace/Python/201802/venv/Include/grammar.h
[FILE] E:/workspace/Python/201802/venv/Include/import.h
[FILE] E:/workspace/Python/201802/venv/Include/intrcheck.h
[FILE] E:/workspace/Python/201802/venv/Include/iterobject.h
[FILE] E:/workspace/Python/201802/venv/Include/listobject.h
[FILE] E:/workspace/Python/201802/venv/Include/longintrepr.h
[FILE] E:/workspace/Python/201802/venv/Include/longobject.h
[FILE] E:/workspace/Python/201802/venv/Include/marshal.h
[FILE] E:/workspace/Python/201802/venv/Include/memoryobject.h
[FILE] E:/workspace/Python/201802/venv/Include/metagrammar.h
[FILE] E:/workspace/Python/201802/venv/Include/methodobject.h
[FILE] E:/workspace/Python/201802/venv/Include/modsupport.h
[FILE] E:/workspace/Python/201802/venv/Include/moduleobject.h
[FILE] E:/workspace/Python/201802/venv/Include/namespaceobject.h
[FILE] E:/workspace/Python/201802/venv/Include/node.h
[FILE] E:/workspace/Python/201802/venv/Include/object.h
[FILE] E:/workspace/Python/201802/venv/Include/objimpl.h
[FILE] E:/workspace/Python/201802/venv/Include/odictobject.h
[FILE] E:/workspace/Python/201802/venv/Include/opcode.h
[FILE] E:/workspace/Python/201802/venv/Include/osdefs.h
[FILE] E:/workspace/Python/201802/venv/Include/osmodule.h
[FILE] E:/workspace/Python/201802/venv/Include/parsetok.h
[FILE] E:/workspace/Python/201802/venv/Include/patchlevel.h
[FILE] E:/workspace/Python/201802/venv/Include/pgen.h
[FILE] E:/workspace/Python/201802/venv/Include/pgenheaders.h
[FILE] E:/workspace/Python/201802/venv/Include/pyarena.h
[FILE] E:/workspace/Python/201802/venv/Include/pyatomic.h
[FILE] E:/workspace/Python/201802/venv/Include/pycapsule.h
[FILE] E:/workspace/Python/201802/venv/Include/pyconfig.h
[FILE] E:/workspace/Python/201802/venv/Include/pyctype.h
[FILE] E:/workspace/Python/201802/venv/Include/pydebug.h
[FILE] E:/workspace/Python/201802/venv/Include/pydtrace.h
[FILE] E:/workspace/Python/201802/venv/Include/pyerrors.h
[FILE] E:/workspace/Python/201802/venv/Include/pyexpat.h
[FILE] E:/workspace/Python/201802/venv/Include/pyfpe.h
[FILE] E:/workspace/Python/201802/venv/Include/pygetopt.h
[FILE] E:/workspace/Python/201802/venv/Include/pyhash.h
[FILE] E:/workspace/Python/201802/venv/Include/pylifecycle.h
[FILE] E:/workspace/Python/201802/venv/Include/pymacconfig.h
[FILE] E:/workspace/Python/201802/venv/Include/pymacro.h
[FILE] E:/workspace/Python/201802/venv/Include/pymath.h
[FILE] E:/workspace/Python/201802/venv/Include/pymem.h
[FILE] E:/workspace/Python/201802/venv/Include/pyport.h
[FILE] E:/workspace/Python/201802/venv/Include/pystate.h
[FILE] E:/workspace/Python/201802/venv/Include/pystrcmp.h
[FILE] E:/workspace/Python/201802/venv/Include/pystrhex.h
[FILE] E:/workspace/Python/201802/venv/Include/pystrtod.h
[FILE] E:/workspace/Python/201802/venv/Include/Python-ast.h
[FILE] E:/workspace/Python/201802/venv/Include/Python.h
[FILE] E:/workspace/Python/201802/venv/Include/pythonrun.h
[FILE] E:/workspace/Python/201802/venv/Include/pythread.h
[FILE] E:/workspace/Python/201802/venv/Include/pytime.h
[FILE] E:/workspace/Python/201802/venv/Include/py_curses.h
[FILE] E:/workspace/Python/201802/venv/Include/rangeobject.h
[FILE] E:/workspace/Python/201802/venv/Include/setobject.h
[FILE] E:/workspace/Python/201802/venv/Include/sliceobject.h
[FILE] E:/workspace/Python/201802/venv/Include/structmember.h
[FILE] E:/workspace/Python/201802/venv/Include/structseq.h
[FILE] E:/workspace/Python/201802/venv/Include/symtable.h
[FILE] E:/workspace/Python/201802/venv/Include/sysmodule.h
[FILE] E:/workspace/Python/201802/venv/Include/token.h
[FILE] E:/workspace/Python/201802/venv/Include/traceback.h
[FILE] E:/workspace/Python/201802/venv/Include/tupleobject.h
[FILE] E:/workspace/Python/201802/venv/Include/typeslots.h
[FILE] E:/workspace/Python/201802/venv/Include/ucnhash.h
[FILE] E:/workspace/Python/201802/venv/Include/unicodeobject.h
[FILE] E:/workspace/Python/201802/venv/Include/warnings.h
[FILE] E:/workspace/Python/201802/venv/Include/weakrefobject.h
[DIR] E:/workspace/Python/201802/venv/Lib
[FILE] E:/workspace/Python/201802/venv/Lib/abc.py
[FILE] E:/workspace/Python/201802/venv/Lib/base64.py
[FILE] E:/workspace/Python/201802/venv/Lib/bisect.py
[FILE] E:/workspace/Python/201802/venv/Lib/codecs.py
[DIR] E:/workspace/Python/201802/venv/Lib/collections
[FILE] E:/workspace/Python/201802/venv/Lib/collections/abc.py
[FILE] E:/workspace/Python/201802/venv/Lib/collections/__init__.py
[DIR] E:/workspace/Python/201802/venv/Lib/collections/__pycache__
[FILE] E:/workspace/Python/201802/venv/Lib/collections/__pycache__/abc.cpython-36.opt-1.pyc
[FILE] E:/workspace/Python/201802/venv/Lib/collections/__pycache__/abc.cpython-36.opt-2.pyc
[FILE] E:/workspace/Python/201802/venv/Lib/collections/__pycache__/abc.cpython-36.pyc
[FILE] E:/workspace/Python/201802/venv/Lib/collections/__pycache__/__init__.cpython-36.opt-1.pyc
[FILE] E:/workspace/Python/201802/venv/Lib/collections/__pycache__/__init__.cpython-36.opt-2.pyc
[FILE] E:/workspace/Python/201802/venv/Lib/collections/__pycache__/__init__.cpython-36.pyc
[FILE] E:/workspace/Python/201802/venv/Lib/copy.py
[FILE] E:/workspace/Python/201802/venv/Lib/copyreg.py
[DIR] E:/workspace/Python/201802/venv/Lib/distutils
[FILE] E:/workspace/Python/201802/venv/Lib/distutils/distutils.cfg
[FILE] E:/workspace/Python/201802/venv/Lib/distutils/__init__.py
[DIR] E:/workspace/Python/201802/venv/Lib/distutils/__pycache__
[FILE] E:/workspace/Python/201802/venv/Lib/distutils/__pycache__/__init__.cpython-36.pyc
[DIR] E:/workspace/Python/201802/venv/Lib/encodings
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/aliases.py
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/ascii.py
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/base64_codec.py
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/big5.py
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/big5hkscs.py
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/bz2_codec.py
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/charmap.py
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/cp037.py
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/cp1006.py
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/cp1026.py
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/cp1125.py
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/cp1140.py
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/cp1250.py
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/cp1251.py
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/cp1252.py
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/cp1253.py
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/cp1254.py
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/cp1255.py
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/cp1256.py
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/cp1257.py
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/cp1258.py
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/cp273.py
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/cp424.py
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/cp437.py
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/cp500.py
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/cp65001.py
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/cp720.py
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/cp737.py
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/cp775.py
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/cp850.py
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/cp852.py
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/cp855.py
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/cp856.py
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/cp857.py
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/cp858.py
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/cp860.py
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/cp861.py
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/cp862.py
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/cp863.py
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/cp864.py
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/cp865.py
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/cp866.py
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/cp869.py
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/cp874.py
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/cp875.py
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/cp932.py
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/cp949.py
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/cp950.py
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/euc_jisx0213.py
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/euc_jis_2004.py
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/euc_jp.py
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/euc_kr.py
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/gb18030.py
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/gb2312.py
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/gbk.py
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/hex_codec.py
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/hp_roman8.py
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/hz.py
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/idna.py
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/iso2022_jp.py
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/iso2022_jp_1.py
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/iso2022_jp_2.py
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/iso2022_jp_2004.py
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/iso2022_jp_3.py
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/iso2022_jp_ext.py
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/iso2022_kr.py
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/iso8859_1.py
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/iso8859_10.py
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/iso8859_11.py
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/iso8859_13.py
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/iso8859_14.py
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/iso8859_15.py
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/iso8859_16.py
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/iso8859_2.py
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/iso8859_3.py
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/iso8859_4.py
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/iso8859_5.py
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/iso8859_6.py
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/iso8859_7.py
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/iso8859_8.py
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/iso8859_9.py
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/johab.py
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/koi8_r.py
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/koi8_t.py
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/koi8_u.py
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/kz1048.py
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/latin_1.py
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/mac_arabic.py
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/mac_centeuro.py
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/mac_croatian.py
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/mac_cyrillic.py
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/mac_farsi.py
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/mac_greek.py
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/mac_iceland.py
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/mac_latin2.py
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/mac_roman.py
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/mac_romanian.py
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/mac_turkish.py
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/mbcs.py
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/oem.py
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/palmos.py
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/ptcp154.py
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/punycode.py
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/quopri_codec.py
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/raw_unicode_escape.py
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/rot_13.py
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/shift_jis.py
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/shift_jisx0213.py
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/shift_jis_2004.py
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/tis_620.py
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/undefined.py
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/unicode_escape.py
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/unicode_internal.py
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/utf_16.py
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/utf_16_be.py
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/utf_16_le.py
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/utf_32.py
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/utf_32_be.py
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/utf_32_le.py
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/utf_7.py
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/utf_8.py
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/utf_8_sig.py
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/uu_codec.py
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/zlib_codec.py
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/__init__.py
[DIR] E:/workspace/Python/201802/venv/Lib/encodings/__pycache__
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/__pycache__/aliases.cpython-36.opt-1.pyc
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/__pycache__/aliases.cpython-36.opt-2.pyc
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/__pycache__/aliases.cpython-36.pyc
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/__pycache__/ascii.cpython-36.opt-1.pyc
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/__pycache__/ascii.cpython-36.opt-2.pyc
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/__pycache__/ascii.cpython-36.pyc
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/__pycache__/base64_codec.cpython-36.opt-1.pyc
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/__pycache__/base64_codec.cpython-36.opt-2.pyc
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/__pycache__/base64_codec.cpython-36.pyc
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/__pycache__/big5.cpython-36.opt-1.pyc
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/__pycache__/big5.cpython-36.opt-2.pyc
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/__pycache__/big5.cpython-36.pyc
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/__pycache__/big5hkscs.cpython-36.opt-1.pyc
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/__pycache__/big5hkscs.cpython-36.opt-2.pyc
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/__pycache__/big5hkscs.cpython-36.pyc
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/__pycache__/bz2_codec.cpython-36.opt-1.pyc
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/__pycache__/bz2_codec.cpython-36.opt-2.pyc
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/__pycache__/bz2_codec.cpython-36.pyc
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/__pycache__/charmap.cpython-36.opt-1.pyc
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/__pycache__/charmap.cpython-36.opt-2.pyc
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/__pycache__/charmap.cpython-36.pyc
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/__pycache__/cp037.cpython-36.opt-1.pyc
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/__pycache__/cp037.cpython-36.opt-2.pyc
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/__pycache__/cp037.cpython-36.pyc
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/__pycache__/cp1006.cpython-36.opt-1.pyc
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/__pycache__/cp1006.cpython-36.opt-2.pyc
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/__pycache__/cp1006.cpython-36.pyc
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/__pycache__/cp1026.cpython-36.opt-1.pyc
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/__pycache__/cp1026.cpython-36.opt-2.pyc
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/__pycache__/cp1026.cpython-36.pyc
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/__pycache__/cp1125.cpython-36.opt-1.pyc
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/__pycache__/cp1125.cpython-36.opt-2.pyc
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/__pycache__/cp1125.cpython-36.pyc
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/__pycache__/cp1140.cpython-36.opt-1.pyc
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/__pycache__/cp1140.cpython-36.opt-2.pyc
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/__pycache__/cp1140.cpython-36.pyc
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/__pycache__/cp1250.cpython-36.opt-1.pyc
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/__pycache__/cp1250.cpython-36.opt-2.pyc
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/__pycache__/cp1250.cpython-36.pyc
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/__pycache__/cp1251.cpython-36.opt-1.pyc
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/__pycache__/cp1251.cpython-36.opt-2.pyc
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/__pycache__/cp1251.cpython-36.pyc
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/__pycache__/cp1252.cpython-36.opt-1.pyc
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/__pycache__/cp1252.cpython-36.opt-2.pyc
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/__pycache__/cp1252.cpython-36.pyc
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/__pycache__/cp1253.cpython-36.opt-1.pyc
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/__pycache__/cp1253.cpython-36.opt-2.pyc
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/__pycache__/cp1253.cpython-36.pyc
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/__pycache__/cp1254.cpython-36.opt-1.pyc
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/__pycache__/cp1254.cpython-36.opt-2.pyc
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/__pycache__/cp1254.cpython-36.pyc
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/__pycache__/cp1255.cpython-36.opt-1.pyc
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/__pycache__/cp1255.cpython-36.opt-2.pyc
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/__pycache__/cp1255.cpython-36.pyc
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/__pycache__/cp1256.cpython-36.opt-1.pyc
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/__pycache__/cp1256.cpython-36.opt-2.pyc
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/__pycache__/cp1256.cpython-36.pyc
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/__pycache__/cp1257.cpython-36.opt-1.pyc
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/__pycache__/cp1257.cpython-36.opt-2.pyc
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/__pycache__/cp1257.cpython-36.pyc
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/__pycache__/cp1258.cpython-36.opt-1.pyc
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/__pycache__/cp1258.cpython-36.opt-2.pyc
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/__pycache__/cp1258.cpython-36.pyc
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/__pycache__/cp273.cpython-36.opt-1.pyc
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/__pycache__/cp273.cpython-36.opt-2.pyc
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/__pycache__/cp273.cpython-36.pyc
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/__pycache__/cp424.cpython-36.opt-1.pyc
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/__pycache__/cp424.cpython-36.opt-2.pyc
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/__pycache__/cp424.cpython-36.pyc
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/__pycache__/cp437.cpython-36.opt-1.pyc
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/__pycache__/cp437.cpython-36.opt-2.pyc
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/__pycache__/cp437.cpython-36.pyc
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/__pycache__/cp500.cpython-36.opt-1.pyc
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/__pycache__/cp500.cpython-36.opt-2.pyc
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/__pycache__/cp500.cpython-36.pyc
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/__pycache__/cp65001.cpython-36.opt-1.pyc
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/__pycache__/cp65001.cpython-36.opt-2.pyc
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/__pycache__/cp65001.cpython-36.pyc
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/__pycache__/cp720.cpython-36.opt-1.pyc
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/__pycache__/cp720.cpython-36.opt-2.pyc
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/__pycache__/cp720.cpython-36.pyc
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/__pycache__/cp737.cpython-36.opt-1.pyc
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/__pycache__/cp737.cpython-36.opt-2.pyc
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/__pycache__/cp737.cpython-36.pyc
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/__pycache__/cp775.cpython-36.opt-1.pyc
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/__pycache__/cp775.cpython-36.opt-2.pyc
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/__pycache__/cp775.cpython-36.pyc
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/__pycache__/cp850.cpython-36.opt-1.pyc
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/__pycache__/cp850.cpython-36.opt-2.pyc
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/__pycache__/cp850.cpython-36.pyc
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/__pycache__/cp852.cpython-36.opt-1.pyc
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/__pycache__/cp852.cpython-36.opt-2.pyc
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/__pycache__/cp852.cpython-36.pyc
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/__pycache__/cp855.cpython-36.opt-1.pyc
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/__pycache__/cp855.cpython-36.opt-2.pyc
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/__pycache__/cp855.cpython-36.pyc
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/__pycache__/cp856.cpython-36.opt-1.pyc
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/__pycache__/cp856.cpython-36.opt-2.pyc
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/__pycache__/cp856.cpython-36.pyc
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/__pycache__/cp857.cpython-36.opt-1.pyc
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/__pycache__/cp857.cpython-36.opt-2.pyc
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/__pycache__/cp857.cpython-36.pyc
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/__pycache__/cp858.cpython-36.opt-1.pyc
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/__pycache__/cp858.cpython-36.opt-2.pyc
[FILE] E:/workspace/Python/201802/venv/Lib/encodings/__pycache__/cp858.cpython-36.pyc Process finished with exit code 0
file_list(path):遍历文件列表[python]的更多相关文章
- 遍历文件路径python版,java版
python: # 获取所有txt路径列表 file_list = [] def gci(filepath): files=os.listdir(filepath) for fi in files: ...
- Python 遍历文件夹清理磁盘案例
import os suffix_name_list = [".pdb", ".ilk"] def find_file(path): # 遍历文件夹 for i ...
- python中遍历文件的3个方法
转自: http://www.jb51.net/article/54640.htm 用python进行文件遍历有多种方法,这里列举并说明一下. os.path.walk() 这是一个传统的用法. wa ...
- 使用Python脚本获取指定格式文件列表的方法
在Python环境下获取指定后缀文件列表的方式. 来源stackoverflow 这里简单以*.txt的作为例子. 使用glob(推荐) import glob, os os.chdir(" ...
- 用Python来实现列举某个文件夹内所有的文件列表
用Python来实现列举某个文件夹内所有的文件列表.吾八哥我动手写代码之前分析了下,遍历一个文件夹,肯定是需要用到os模块了,查阅模块帮助信息,可知os.listdir()方法可以列举某个文件夹内的所 ...
- 一句python,一句R︱模块导入与查看、数据读写出入、数据查看函数、数据类型、遍历文件
先学了R,最近刚刚上手python,所以想着将python和R结合起来互相对比来更好理解python.最好就是一句python,对应写一句R. pandas中有类似R中的read.table的功能,而 ...
- 使用python遍历文件夹取出特定的字符串
# -*- coding: utf-8 -* import re import os # 需要处理的文件夹路径(绝对路径) path = u"/Users/a140/Downloads/te ...
- Python高效率遍历文件夹寻找重复文件
前言 为什么要写这篇文章呢...主要还是业务中有个需求,遍历一个将近200w数据的文件夹,大部分还都是视频文件那种,但是这玩意用的次数还不多,做文件夹index也不是很ok,所以写了一个脚本来处理这个 ...
- python 遍历文件夹 文件
python 遍历文件夹 文件 import os import os.path rootdir = "d:\data" # 指明被遍历的文件夹 for parent,dirn ...
随机推荐
- A1105. Spiral Matrix
This time your job is to fill a sequence of N positive integers into a spiral matrix in non-increasi ...
- html 网页背景图片根据屏幕大小CSS自动缩放
https://blog.csdn.net/coslay/article/details/47109281 腾讯微博和QQ空间的登录背景图片是根据访客的屏幕大小自动缩放的,但是好像是用JQuery代码 ...
- ElasticSearch6.3.2------入门
先去官网下载,方便测试用的Windows版本的 都解压了 --- 启动ElasticSearch和Kibana [E:\elasticsearch-]$ .\bin\elasticsearch.bat ...
- Jquery Mobile表单
三个前提: 1.每个form必须设置method和action属性 2.每个form必须有页面范围内唯一的id标识 3.每个form必须有一个label标签,通过设置它的for属性来匹配元素的id & ...
- 7.Django
1.遍历数据 2.正则表达式匹配数字 ##url超链接 ##配置url ##POST请求需要设置csrf_token
- ubuntu下cmake编译opencv 3.4.3源码;
在进行编译前,准备工作: 1) 到opencv官网下载源码(https://opencv.org/releases.html): 2) 安装qt(http://download.qt.io/); ...
- root登陆欢迎界面设置
root登陆欢迎界面设置 #!/bin/bash echo -ne "\033[0;36m" cat<<EOF _oo0oo_ (| -_- |) \ = / ___/ ...
- Redash 安装部署
介绍 是一款开源的BI工具,提供了基于web的数据库查询和数据可视化功能. 官网:https://redash.io/ GitHub:https://github.com/getredash/reda ...
- shell关于文件操作
一.如何将一个十进制的整数用2进制表示出来? echo "obase=2;50" | bc 二.Linux下经常需要删除空白行,grep,sed,awk,tr等工具均可实现 gre ...
- 使用mysql存放Ambari元数据的配置案例
使用mysql存放Ambari元数据的配置案例 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 一.环境准备 详情请参考我之前的笔记:离线方式部署Ambari2.6.0.0 中关 ...