aboutsummaryrefslogtreecommitdiff
path: root/challenge-203/eric-cheung/python/ch-2.py
diff options
context:
space:
mode:
authorMohammad S Anwar <mohammad.anwar@yahoo.com>2023-02-13 06:51:38 +0000
committerMohammad S Anwar <mohammad.anwar@yahoo.com>2023-02-13 06:51:38 +0000
commitd1cdd6bd2914289bf868f4cdd4c99979d5464a13 (patch)
treee69d5e1f31a95c9832902756298e063e71ce84ba /challenge-203/eric-cheung/python/ch-2.py
parent5ccac734c46826df9dedf843701fb1514175c2a6 (diff)
downloadperlweeklychallenge-club-d1cdd6bd2914289bf868f4cdd4c99979d5464a13.tar.gz
perlweeklychallenge-club-d1cdd6bd2914289bf868f4cdd4c99979d5464a13.tar.bz2
perlweeklychallenge-club-d1cdd6bd2914289bf868f4cdd4c99979d5464a13.zip
- Added solutions by Mark Anderson.
- Added solutions by W. Luis Mochan. - Added solutions by Peter Campbell Smith. - Added solutions by Duncan C. White. - Added solutions by Luca Ferrari. - Added solutions by Dave Jacoby. - Added solutions by David Ferrone. - Added solutions by Thomas Kohler. - Added solutions by Mariano Spadaccini. - Added solutions by Carlos Oliveira. - Added solutions by Roger Bell_West. - Added solutions by Chicagoist. - Added solutions by Robbie Hatley. - Added solutions by Jorg Sommrey. - Added solutions by E. Choroba. - Added solutions by Kjetil Skotheim. - Added solutions by Arne Sommer. - Added solutions by Pip Stuart. - Added solutions by Robert Ransbottom. - Added solutions by Athanasius. - Added solutions by James Smith. - Added solutions by Flavio Poletti. - Added solutions by Cheok-Yin Fung. - Added solutions by Solathian. - Added solutions by Jan Krnavek. - Added solutions by Eric Cheung. - Added solutions by Ulrich Reike. - Added solutions by Robert DiCicco.
Diffstat (limited to 'challenge-203/eric-cheung/python/ch-2.py')
-rwxr-xr-xchallenge-203/eric-cheung/python/ch-2.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/challenge-203/eric-cheung/python/ch-2.py b/challenge-203/eric-cheung/python/ch-2.py
new file mode 100755
index 0000000000..fedcb744a3
--- /dev/null
+++ b/challenge-203/eric-cheung/python/ch-2.py
@@ -0,0 +1,19 @@
+
+## Remarks
+## https://www.geeksforgeeks.org/python-copy-directory-structure-without-files/
+
+import shutil
+import os
+
+
+## Define the Function to Ignore the Files If Present in Any Folder
+def GetIgnoreFiles(strDir, strFiles):
+ return [strFileLoop for strFileLoop in strFiles if os.path.isfile(os.path.join(strDir, strFileLoop))]
+
+
+strSourceFolderPath = "/a/b/c"
+strTargetFolderPath = "/x/y"
+
+
+## Calli the shutil.copytree() method and Pass the strSourceFolderPath, strTargetFolderPath and Ignore Parameter
+shutil.copytree(strSourceFolderPath, strTargetFolderPath, ignore = GetIgnoreFiles)