Files
NoteNextra-origin/toolboxes/LNG_v1.0.py
Zheyuan Wu 33c02dc4a8
Some checks failed
Sync from Gitea (main→main, keep workflow) / mirror (push) Has been cancelled
? what changes?
2026-01-12 15:36:25 -06:00

19 lines
590 B
Python

import os
course_code=input('We will follow the naming pattern of {class}_L{lecture number}.md, enter the course code to start.\n')
start=input('enter the number of lecture that you are going to start.\n')
end=input('Enter the end of lecture (exclusive).\n')
start=int(start)
end=int(end)
cur_dir = os.path.dirname(os.path.abspath(__file__))
while start<end:
# create a empty text file
file_name = os.path.join(cur_dir, f'{course_code}_L{start}.md')
fp = open(file_name, 'w')
fp.write(f'# Lecture {start}')
fp.close()
start+=1
print("Complete")