-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
linyisonger
committed
Jun 12, 2024
1 parent
a5c951f
commit 219005e
Showing
3 changed files
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# 自动编号 | ||
import os | ||
import shutil | ||
import sys | ||
if __name__ == '__main__': | ||
args = sys.argv[1:] | ||
|
||
index = 1 | ||
useNumList = [] | ||
|
||
for file in os.listdir(os.getcwd()): | ||
if file.endswith(".html"): | ||
if file.split(".")[0].isdigit(): | ||
useNumList.append(int(file.split(".")[0])) | ||
|
||
while index in useNumList: | ||
index+=1 | ||
|
||
index = f'{index}'.zfill(3) | ||
newFileName =f'{index}.{args[0]}.html' | ||
shutil.copy(os.path.join(os.getcwd(), 'build', 'template.html'),os.path.join(os.getcwd(), newFileName)) | ||
|
||
print('新建文件成功', newFileName) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<meta charset="UTF-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<link rel="stylesheet" href="./assets/global.css"> | ||
</head> | ||
|
||
<body> | ||
|
||
</body> | ||
|
||
</html> |