str.format() 基本语法是通过 {} 和 : 来代替以前的 % 。 format 函数可以接受不限个参数,位置可以不按顺序。 "{}".format(str) str就是代入{}里面。 这个涉及路径文件的时候很常用。