os.path.sep
is a string constant not a function. It returns the path separator (eg.
) used by the underlying OS. So doing os.path.sep()
is like doing ""()
which is why you get the error that str
is not callable
If you want to split the path into its components use os.path.split()
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…