반응형 Python - folder 제거(remove) with os(import)1 Python - folder 제거(remove) with os(import) Code 1 2 3 4 5 6 7 8 import os dir_path = 'D:\\new_folder' if os.path.exists(dir_path): os.rmdir(dir_path) print(f"removed folder: {dir_path}") else: print(f'There is no {dir_path}') cs Result #> python .\folder_remove.py removed folder: D:\new_folder 2022. 12. 29. 이전 1 다음 반응형