This repository has been archived by the owner on Jan 2, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mac.py
72 lines (60 loc) · 1.5 KB
/
mac.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
import os
import win as w
def trying(cur_path):
def_path="/Users/'username'/Desktop/"
mypath=os.path.join(def_path,cur_path)
try:
os.chdir(mypath)
print("the folder exists")
except OSError as Error:
print("This is new project ")
create(mypath,cur_path)
def create(mypath,cur_path):
os.mkdir(mypath)
asstes=os.path.join(mypath,"assests")
os.mkdir(asstes)
os.chdir(mypath)
f=open("index.html","w+")
stylepath=os.path.join(mypath,"style")
os.mkdir(stylepath)
os.chdir(stylepath)
f2=open("style.css","w+")
css=('''*{
margin:0;
padding: 0;
box-sizing: border-box;
}''')
f2.write(css)
f2.close
html=('''<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{}</title>
</head>
<body>
</body>
</html>'''.format(cur_path))
f.write(html)
f.close()
if(os.path.exists(mypath)):
print("done")
else:
print("requests rejected")
def opinon(option):
if(option==1):
cre_path=input("Enter the project name :")
print("Checking if the project exists...")
trying(cre_path)
else:
exit()
def lint(cur_path):
def_path="Documents/github/Html/"
mypath=os.path.join(def_path,cur_path)
try:
os.chdir(mypath)
print("the folder exists")
except OSError as Error:
print("This is new project ")
create(mypath,cur_path)