Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the use of the copytree () function in python

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces what is the use of copytree () function in python, which has certain reference value. Interested friends can refer to it. I hope you will gain a lot after reading this article. Let Xiaobian take you to understand it together.

copytree()

Description: Copy the entire directory file, unwanted file types can not be copied

syntax: shutil. copytree (origin, designpath, ignore = shutil. ignore_patterns ("*. xls ","*. doc "))

Parameters:

origin path: "origin path"

despath: "destination path"

ignore: shutil. ignore_patterns () is to ignore the content filter, ignore the corresponding content.

import shutil, os path 2 = os. path. join (os. getcwd (),"kaggle ") path 2 'C:\\Users\\wuzhengxiang\\Desktop\\Python knowledge summary\\kaggle'#bbb and ccc folder can not exist, will automatically create path 3 = os.path.join (os. getcwd ()," bbb "," ccc ") path 3 'C:\\Users\\wuzhengxiang\\Desktop\\Python Knowledge Point Summary\\bbb\\ccc'#Ignore "abc.txt","bcd.txt", do not copy shutil. copytree (path 2, path 3, ignore = shutil. ignore_patterns ("abc.txt "," bcd.txt ")) Thank you for reading this article carefully. I hope that Xiaobian will share" What is the use of copytree () function in python" This article is helpful to everyone. At the same time, I hope that everyone will support it. Pay attention to the industry information channel, more relevant knowledge waiting for you to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report