windows不文件命名规则是:在文件名或文件夹名中,最多可以有255个字符。其中包含驱动器和路径名。不能出现以下字符:
\ / : * ? " < > →
import re filenemae = "<aaaaaaaaa/" file = re.sub(r'[\/:*?"<>|]', " ", filenemae) print(file)
windows不文件命名规则是:在文件名或文件夹名中,最多可以有255个字符。其中包含驱动器和路径名。不能出现以下字符:
\ / : * ? " < > →
import re filenemae = "<aaaaaaaaa/" file = re.sub(r'[\/:*?"<>|]', " ", filenemae) print(file)