#-*-Coding: UTF-8 -*-
"""
Start with #-*-coding: UTF-8 -*-
Or #-*-coding: cp936-*-otherwise, an error is returned.
"""
Import OS
Import glob
Import time
"""
To separate the paths, the split () function Windows system must also add a double line in the import OS header file.
"""
Pathname = "E: // first // SRC // text. py"
(Dirname, filename) = OS. Path. Split (pathname)
Print pathname
Print dirname
Print filename
"""
List contents import glob
The glob module is another tool in the python standard library. It can obtain the contents of a directory through programming.
And it uses wildcards in the familiar command line. The glob module uses shell-style wildcards.
Find the file name with the suffix ". py" in the current directory and the file name with the 'test' in the file name.
"""
# Print glob. glob (r'e:/First/src/*. py '),
Print
Print glob. glob ('*. py '),
Print
Print glob. glob ('* test *. py ')
Print
"""
Get object meta
Getcwd (): Get the directory reference OS in the current working environment.
"""
Print (OS. getcwd ())
Print