我有这个文件夹结构:
在mixed
文件夹中有各种文件,作为名称的第一个字符,有0到9之间的数字。我想要做的是将所有以0开头的文件移动到0文件夹,所有以1到1文件夹开头的等等......
我尝试了this解决方案,但似乎无效。
答案 0 :(得分:1)
您可以使用import os
path = <path_of_main_folder>
for file in os.listdir(path + '\\mixed'):
full_path = path + '\\mixed\\' + file
os.rename(full_path, path + '\\' + file[0] + '\\' + file) #move from mixed to folder w/ same first char
模块。
private fun getTouchX(): Int = when(arguments)
containsKey(KEY_DOWN_X) -> getInt(KEY_DOWN_X)
else -> centerX()
}