-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathproject.py
executable file
·57 lines (52 loc) · 1.54 KB
/
project.py
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
51
52
53
54
55
56
57
#!/usr/bin/env python
from pathlib import Path
import time
import os
def main(): # sourcery skip: ensure-file-closed, extract-duplicate-method
project_name = input("Enter project name :")
baseurl = "/Users/bryanwills/code/examples"
print("Creating project structure...")
time.sleep(1.5)
project_path = os.path.join(baseurl, project_name)
print("Creating project directory...")
os.makedirs(project_path)
time.sleep(1.5)
print("Project directory created!")
time.sleep(1.5)
print("Creating files for project...")
os.chdir(project_path)
time.sleep(1.5)
print("Creating project image directory...")
os.mkdir("img", 0o0755)
time.sleep(1.5)
html_file_name = "Project title is: {}".format(project_name)
print(html_file_name)
html_title = {'title': 'html_file_name'}
html_file = open('index.html', 'w')
html_file.write('''<!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="style.css">
<title></title>
</head>
<body>
<script src="main.js"></script>
</body>
</html>''')
html_file.close()
css_file = open('style.css', 'w')
css_file.close()
js_file = open('main.js', 'w')
js_file.close()
time.sleep(2)
print("Created index.html")
time.sleep(1)
print("Created style.css")
time.sleep(1)
print("Created main.js")
time.sleep(1)
if __name__ == '__main__':
main()