Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # INSUFFICENT PROJECT CREATOR #
- # 2021 #
- # VERSION 1.0 (DEV VERSION) #
- # MAIN VARIABLES/OTHER
- supportedprojtypes = ["html"]
- class textcolors:
- HEADER = '\033[95m'
- OKBLUE = '\033[94m'
- OKCYAN = '\033[96m'
- OKGREEN = '\033[92m'
- WARNING = '\033[93m'
- FAIL = '\033[91m'
- ENDC = '\033[0m'
- BOLD = '\033[1m'
- UNDERLINE = '\033[4m'
- # IMPORTS
- import os
- # ACTUAL PROGRAM
- print("---- Project Creator By Insufficent ----")
- print("Enter project type: ")
- projtype = input(">>> ")
- if projtype not in supportedprojtypes:
- print(f"{textcolors.FAIL}Error: No such type exists!{textcolors.ENDC}")
- print("Enter project name: ")
- projname = input(">>> ")
- # TEMPLATES
- htmlprojhtml = """<!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 href="style.css" rel="stylesheet"/>
- <title>Document</title>
- </head>
- <body>
- <!-- Content Here -->
- <script src="script.js"></script>
- </body>
- </html>
- """
- htmlprojcss = """body {
- margin: 0;
- padding: 0;
- }
- """
- projectpath = os.path.join(os.getcwd(), projname)
- if projtype == "html":
- os.mkdir(projectpath)
- newHTMLfle = open(f"{projectpath}/index.html", "w").write(htmlprojhtml)
- newCSSfile = open(f"{projectpath}/style.css", "w").write(htmlprojcss)
- newJSfile = open(f"{projectpath}/script.js", "w") # Requires no write() since its content will be empty.
- print(f"{textcolors.OKGREEN}{textcolors.BOLD}Project Successfully Created!{textcolors.ENDC}")
- print(f"At path {os.getcwd()}")
- else:
- print(f"{textcolors.FAIL}Error: Project Not Created, No Such type exists!{textcolors.ENDC}")
Advertisement
Add Comment
Please, Sign In to add comment