pathlib.PurePath(task.task_work_path).as_posix()可以将\\,变为/,和下面两种方式等同,但是会更简洁,得到的变量是str类型'/'.join( xxx.split('\\' ) )xxx.replace('\\', '/')