-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathadd_makefiles.py
More file actions
43 lines (39 loc) · 987 Bytes
/
add_makefiles.py
File metadata and controls
43 lines (39 loc) · 987 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import os
from shutil import copy
folders = [
"100-doors",
"Factors-of-an-integer",
"ABC-Problem",
"Fibonacci-sequence",
"Ackermann-function",
"Greatest-common-divisor",
"Arithmetic-geometric-mean",
"Greatest-element-of-a-list",
"Binary-digits",
"Guess-the-number",
"Binary-search",
"Hailstone-sequence",
"Caesar-cipher",
"Least-common-multiple",
"Factorial",
"N-queens-problem",
"Remove-duplicate-elements",
"Sieve-of-Eratosthenes",
"Sorting-algorithms-Merge-sort",
"Sorting-algorithms-Quicksort",
"Towers-of-Hanoi"
]
make_folder = "/home/marco/tests/makes_languages"
def main():
for folder in folders:
print("Task:", folder)
for root, dirs, files in os.walk(folder):
for d in dirs:
print("\t", "Lang:", d)
lang_folder = os.path.join(root, d)
makefile = os.path.join(make_folder, d, "Makefile")
if os.path.isfile(makefile):
print("\t\t", "OK")
copy(makefile, lang_folder)
if __name__ == '__main__':
main()