uke4
This commit is contained in:
parent
16ced51fa8
commit
bb9f20981a
24
uke4.py
Normal file
24
uke4.py
Normal file
@ -0,0 +1,24 @@
|
||||
from pathlib import Path
|
||||
|
||||
def generate_exercise_list(project_assignments_start, total_exercises):
|
||||
return [str(i) for i in range(1, project_assignments_start)] + [f'{i}{part}' for i in range(project_assignments_start, total_exercises + 1) for part in ['a', 'b']]
|
||||
|
||||
def create_directories(directory, exercises, students):
|
||||
parent_directory = Path.cwd() / directory
|
||||
|
||||
for exercise in exercises:
|
||||
exercise_path = parent_directory / Path('exercise_' + exercise)
|
||||
for student in students:
|
||||
student_path = exercise_path / student
|
||||
studentstudent_path.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
for directory in parent_directory.glob('**/*'):
|
||||
print(directory)
|
||||
|
||||
def main():
|
||||
exercises = generate_exercise_list(5, 12)
|
||||
students = ['Ole', 'Sarah', 'Ferdinand', 'Mattis']
|
||||
create_directories('projects', exercises, students)
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
Loading…
Reference in New Issue
Block a user