-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreate_portfolio_structure.py
More file actions
50 lines (41 loc) · 1.05 KB
/
Copy pathcreate_portfolio_structure.py
File metadata and controls
50 lines (41 loc) · 1.05 KB
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
44
45
46
47
48
49
50
import os
# Define base folder path
base_path = "E:/wangdi_portfolio"
# Subfolders to create
folders = [
"files",
"images",
"scripts"
]
# HTML files to create
html_files = [
"index.html",
"about.html",
"research_projects.html",
"publications.html",
"skills.html",
"awards.html",
"cv.html",
"contact.html"
]
# Other files
other_files = [
"style.css",
"README.md"
]
# Create base folder
os.makedirs(base_path, exist_ok=True)
# Create subfolders
for folder in folders:
os.makedirs(os.path.join(base_path, folder), exist_ok=True)
# Create HTML files
for file in html_files:
file_path = os.path.join(base_path, file)
with open(file_path, 'w') as f:
f.write('') # create empty HTML files
# Create other files
for file in other_files:
file_path = os.path.join(base_path, file)
with open(file_path, 'w') as f:
f.write('') # create empty other files
print(f"Website structure with all 8 sections created successfully at {base_path}")