How do you move tree with ignore patterns in python

0 votes

with the shutil.copytree I can copy an entire directory with files and folders into a folder within itself and at the same time ignore certain folders and there content.

source = htpc.root
destination = os.path.join(htpc.root, "old")

shutil.copytree(source, destination, ignore=shutil.ignore_patterns('userdata', 'old'))

Is there a way to do this exact same thing except move and not copy so I'll only be left userdata and old in the root directory with all the old files and folders within old. Any assistance would be great. Thanks

Nov 22, 2022 in Python by sarit
• 1,830 points
685 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In Python

0 votes
1 answer
0 votes
1 answer

How do you get the logical xor of two variables in Python?

If you're already normalizing the inputs to ...READ MORE

answered May 29, 2018 in Python by aryya
• 7,450 points
10,467 views
0 votes
1 answer

How do you get the logical xor of two variables in Python?

What i found is that you can use ...READ MORE

answered Aug 10, 2018 in Python by Priyaj
• 58,090 points
11,333 views
0 votes
1 answer

How do you express binary literals in Python?

For reference—future Python possibilities: Starting with Python 2.6 you ...READ MORE

answered Aug 14, 2018 in Python by aryya
• 7,450 points
727 views
0 votes
1 answer

How do you create nested dict in Python?

It is important to remember when using ...READ MORE

answered Aug 16, 2018 in Python by Priyaj
• 58,090 points
3,252 views
+2 votes
1 answer

How do you make a block comment in python?

''' This is a multiline comment. I ...READ MORE

answered Aug 23, 2018 in Python by Priyaj
• 58,090 points
743 views
0 votes
2 answers
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 7, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 4,069 views
0 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP