操作系统 中的OS实用。 文件和文件夹示例 from os import cd from os import cwd from os import exists from os import mkdir from os import rm from os import touch from os import which def main (): if which ( "ls" ) is not None : print ( "executable ls found" ) mkdir ( "foo" ) cd ( "foo" ) print ( "Current working directory is" , cwd ()) touch ( "bar" ) if exists ( "bar" ): print