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]的更多相关文章

  1. 遍历文件路径python版,java版

    python: # 获取所有txt路径列表 file_list = [] def gci(filepath): files=os.listdir(filepath) for fi in files: ...

  2. Python 遍历文件夹清理磁盘案例

    import os suffix_name_list = [".pdb", ".ilk"] def find_file(path): # 遍历文件夹 for i ...

  3. python中遍历文件的3个方法

    转自: http://www.jb51.net/article/54640.htm 用python进行文件遍历有多种方法,这里列举并说明一下. os.path.walk() 这是一个传统的用法. wa ...

  4. 使用Python脚本获取指定格式文件列表的方法

    在Python环境下获取指定后缀文件列表的方式. 来源stackoverflow 这里简单以*.txt的作为例子. 使用glob(推荐) import glob, os os.chdir(" ...

  5. 用Python来实现列举某个文件夹内所有的文件列表

    用Python来实现列举某个文件夹内所有的文件列表.吾八哥我动手写代码之前分析了下,遍历一个文件夹,肯定是需要用到os模块了,查阅模块帮助信息,可知os.listdir()方法可以列举某个文件夹内的所 ...

  6. 一句python,一句R︱模块导入与查看、数据读写出入、数据查看函数、数据类型、遍历文件

    先学了R,最近刚刚上手python,所以想着将python和R结合起来互相对比来更好理解python.最好就是一句python,对应写一句R. pandas中有类似R中的read.table的功能,而 ...

  7. 使用python遍历文件夹取出特定的字符串

    # -*- coding: utf-8 -* import re import os # 需要处理的文件夹路径(绝对路径) path = u"/Users/a140/Downloads/te ...

  8. Python高效率遍历文件夹寻找重复文件

    前言 为什么要写这篇文章呢...主要还是业务中有个需求,遍历一个将近200w数据的文件夹,大部分还都是视频文件那种,但是这玩意用的次数还不多,做文件夹index也不是很ok,所以写了一个脚本来处理这个 ...

  9. python 遍历文件夹 文件

    python 遍历文件夹 文件   import os import os.path rootdir = "d:\data" # 指明被遍历的文件夹 for parent,dirn ...

随机推荐

  1. 这些保护Spring Boot 应用的方法,你都用了吗?

    这些保护Spring Boot 应用的方法,你都用了吗? 生如夏花 SpringForAll社区 今天 Spring Boot大大简化了Spring应用程序的开发.它的自动配置和启动依赖大大减少了开始 ...

  2. ava EE 7 - Injection into Runnable/Callable object ejb entityManager Concurrency ManagedExecutorService 异步调用如何获取context

    或者直接把 MyTask类内嵌如MyBean中,这样可以在myBean中inject 数据库连接,在内嵌类内访问. java ee 引入了并发执行.因为是在服务器执行并发,所以要用java ee包里面 ...

  3. POJ3734Blocks(递推+矩阵快速幂)

    题目链接:http://poj.org/problem?id=3734 题意:给出n个排成一列的方块,用红.蓝.绿.黄四种颜色给它们染色,求染成红.绿的方块个数同时为偶数的方案数模10007的值. 题 ...

  4. 使用WinForm Chart控件 制作饼装,柱状,折线图

    http://blog.csdn.net/dream2050csdn/article/details/53510340 chart控件的属性很多,主要用到Chart控件图表区域的属性有五个属性 1.A ...

  5. c#委托中的匿名方法和lambda表达式

    一.一般委托方式 Func<int, int, int> AddMethodHander; public unName() { AddMethodHander += AddMethod; ...

  6. jenkins发版svn

    1.在mac上直接安装Jenkins,下载地址 : 2.安装插件:系统管理-->插件管理 publish over ssh Exec command: cd /usr/local/apache- ...

  7. 对manacher的一点感性理解

    因为总是忘掉板子所以这里贴一下我个人对\(manacher\)的感性理解. 可能不够严谨求轻喷\(QwQ\) char ch = getchar (); s[0] = s[1] = '#'; whil ...

  8. 微信小程序中出现:脚本错误或者未正确调用 Page()

    错误: ​ 解决方法: //在页面当中的.js文件里面加上 Page({ })即可

  9. day05-(validate&bootstred)

    网站分享: http://www.runoob.com/ 回顾: html:展示 文件 标签: <html> <head> <title></title> ...

  10. MySQL数据库基础学习

    MySQL基础知识 ----------- MySQL数据库简介 内存:一断电数据就没有了---------数据库:可以实现数据的持久化存储,有完整的管理系统管理,方便查询--------- DB:数 ...