Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random
- import os, signal
- from datetime import datetime
- logfile = open('log.txt', 'r+')
- definitions = open('definitionsHtml.txt', 'r')
- rights = open ('rights.txt', 'r')
- #logfile.truncate()
- loglines = logfile.readlines()
- global deflines
- deflines = definitions.readlines()
- rlines = rights.readlines()
- rline1 = rlines[0]
- rline2 = rlines[1]
- rline3 = rlines[2]
- noRun = random.randrange(1, 100)
- if noRun == 50:
- print()
- print("The program just don't like you right now. It no want to run :P")
- print()
- os.kill(os.getpid(), signal.SIGTERM)
- def Start():
- logfile.write('Session started at: ' + datetime.now().ctime() + 'nn')
- print(logfile.readlines())
- print()
- print("This tool was made to help programmers, like myself,")
- print("with HTML tags. It takes your input, say you typed")
- print("<div>, it would give you an accurate description of")
- print("that tag and a list of its uses.")
- print()
- print("Guest users please login as 'Guest'")
- print()
- print("(Remember, type BASE tags -<p>- ONLY)")
- print()
- while True:
- Username = input("Username: ")
- if Username == 'Guest':
- Username = 'Guest'
- logfile.write('User: Guest' + 'nn')
- print()
- print('CHECKING..')
- time.sleep(2)
- print('''
- Welcome, Guest!
- ''')
- Block()
- break
- elif Username == '/admin061503':
- Username = "Admin Chase"
- logfile.write('User: Admin Chase' + 'nn')
- Pass = input("Password: ")
- if Pass == '*************':
- Username = 'Admin Chase'
- logfile.write('logged in!' + 'nn')
- print()
- print('CHECKING..')
- time.sleep(2)
- print('''
- Welcome, Admin Chase!
- ''')
- Block()
- break
- else:
- print()
- print("The Input is Incorrect")
- print()
- logfile.write('Wrong Password has been inputed.' + 'nn')
- else:
- print()
- print('CHECKING..')
- time.sleep(2)
- print('''
- Incorrect Username
- ''')
- def Block():
- Input = input("TAG: ")
- if Input == 'exit':
- answerexit = input("Are you sure? ")
- if answerexit == 'yes':
- logfile.write('''session ended at: ''' +
- datetime.now().ctime() + 'nnn')
- logfile.close()
- print()
- print("SHUTTING DOWN..")
- print()
- time.sleep(2)
- os.kill(os.getpid(), signal.SIGTERM)
- elif answerexit == 'no':
- print()
- print("SHUTDOWN ABORTED..")
- print()
- Block()
- elif Input == 'restart':
- print()
- print("RESTARTING..")
- print()
- time.sleep(1.5)
- Start()
- elif Input == '':
- print()
- print("Please enter a tag or command.")
- print()
- Block()
- elif Input == 'credits':
- print()
- print(rline1)
- print(rline2)
- print(rline3)
- print()
- Block()
- elif Input == '<!DOCTYPE html>':
- print()
- print(deflines[0])
- time.sleep(1)
- Block()
- elif Input == '<p>':
- print()
- print(deflines[1], deflines[2], deflines[3], deflines[4], deflines[5], deflines[6], deflines[7], deflines[8])
- print()
- time.sleep(1)
- Block()
- elif Input == '<h>':
- print()
- print(deflines[9], deflines[10], deflines[11], deflines[12], deflines[13], deflines[14], deflines[15], deflines[16])
- print()
- time.sleep(1)
- Block()
- elif Input == '<a>':
- print()
- print(deflines[17], deflines[18], deflines[19], deflines[20], deflines[21], deflines[22], deflines[23], deflines[24], deflines[25])
- print()
- time.sleep(1)
- Block()
- elif Input == '<div>':
- print(deflines[26], deflines[27], deflines[28], deflines[29], deflines[30], deflines[31], deflines[32], deflines[33], deflines[34])
- time.sleep(1)
- Block()
- elif Input == '<link>':
- print(deflines[35], deflines[36], deflines[37])
- time.sleep(1)
- Block()
- elif Input == '<br>':
- print(deflines[38], deflines[39], deflines[40], deflines[41])
- time.sleep(1)
- Block()
- elif Input == '<button>':
- print(deflines[42], deflines[43], deflines[44])
- time.sleep(1)
- Block()
- elif Input == '<iframe>':
- print(deflines[45], deflines[46])
- time.sleep(1)
- Block()
- else:
- print()
- print('''The tag or command you entered is Not Recognized or is not yet
- supported by this tool.''')
- print()
- Block()
- Start()
- <!DOCTYPE html> is the declaration tag for a standard HTML document. This is used to tell the browser what kind of HTML document it is.
- <p> This tag defines a PARAGRAPH. These are highly customisable in CSS, and can be used in any HTML version. There are variations of this tag, such as:
- <p1>
- <p2>
- <p3>
- <p4>
- <p5>
- <p6>
- and so on..
- <h> This tag defines a HEADER. These, like PARAGRAPHS (see <p>), are highly custonizable in CSS, and, like PARAGRAPHS, can be used in any HTML version. There are variations of this tag, such as:
- <h1>
- <h2>
- <h3>
- <h4>
- <h5>
- <h6>
- and so on..
- <a> This tag defines a HYPERLINK. This can be used to turn ANY block or peice of text into a clickable link. This has a variety of uses, such as:
- Redirection
- Buttons
- Drop down menus
- Navigations bars
- and many more.
- A hyperlink's syntax is as shows:
- <a href = "#" target = "(_blank, _parent, _self, and _top are your options)" type = "(specify the type of linked document.)"></a>
- The closing tag is nessesary for this to work with your given parameters.
- <div> This tag defines a DIVIDED BLOCK where you can store content, such as pictures, videos, buttons, text, and just about anything you can think of. This is mainly used for containing things such as:
- Navigation bars
- Buttons
- The entire page (Formally known as "Wrapper")
- ETC.
- This DIV's syntax is as shows:
- <div class = "#"></div>
- The closing tag is nessesary for this to work with your given parameters.
- <link> This tag will LINK (a) CSS file(s) to your HTML document. You can LINK multiple CSS files to a single HTML document. You can LINK files from Google, as well as your own .css files.
- The LINK's syntax is as shows:
- <link href = "#.css" (OR) "#.com" rel = "Stylesheet" type = "text/css">
- <br> This tag creates a LINE BREAK. Just like in any text-editor program, you can create a LINE BREAK using ENTER, or the RETURN KEY. This tag is a very basic one, and it takes like, 5 minutes to remember.
- The LINE BREAK's syntax is as shows:
- <br>
- Simple right?!
- <button> This tag defines a BUTTON. These BUTTONS, by default, are just derpy looking grey buttons, until they are customised using CSS.
- The BUTTON's syntax is as shows:
- <button class = "#"></button>
- <iframe> This tag defines an IFRAME. This is used to design webpages that include links to other sites and/or files. Using an IFRAME, you can display other webpages, such as google.com, w3schools.com, and youtube.com are a few. These are moderately customizable in CSS, and can be used virtually anywhere in a webpage, as long as there is enough space.
- The IFRAME's syntax is as follows:
- <iframe src = "#"></iframe>
- Hey, You! Hello there! This programs function is to give information
- about HTML tags and their uss/functions.
- CHANGELOG:
- Version_1 (9/15/2017):
- Login Feature added
- Six tags are added:
- <!DOCTYPE html>
- <p>
- <a>
- <h>
- <link>
- <div>
- Startup info added
- Shutdown feature added (Does not shutdown your computer, just the file)
- added TWO users:
- -Admin Chase
- -Guest
- MOVED INTO ALPHA STAGE
- Version_2: (9/21/17)
- Created errfile.txt (Contains errs)
- Added error messages
- Restart feature fixed
- Login feature now checks for Username - Pointless at the moment.
- Compacted Login Feature
- Added protected passwords
- Added keywords:
- <br>
- <button>
- <iframe>
- MOVED INTO BETA STAGE
- Version_3: (9/28/17)
- Moved all definitions into definitionsHtml.txt.
- Removed 4 bugs from the code:
- err1: The program ran into an unexpected error, and must now close. Sorry for the inconvenience.
- err2: Could not execute Block() = Function.
- err3: (Partally removed) Incorrect Username.
- err4: Program crashed while Reset was commencing. (%s +% completion)
- added one error for comedic purposes.
- fixed the pointless 46-line deflines block.
- fixed bug where program crashes when a tag that doesn't exist is inputed.
- fixed bug where program crashes when incorrect username is inputed.
- removed errfile.txt.
- log.txt now records ALL sessions, not most recent.
- added keyword(s):
- credits
- changed two keywords:
- /exit --> exit
- /reset --> restart
- Secret: There are plans to make a "command mode"
- MOVED INTO INDEV STAGE
- ---------------------------------------------------------------------------
- Users:
- Username: Guest
- Password: -
- Username: /admin061503
- Password: *************
- ---------------------------------------------------------------------------
- How To Use:
- DO NOT open in pythons command prompt, open
- through IDLE or Python shell (IDLE)
- Enter Username on startup, then password. (If set)
- After you are logged in, Enter a tag or command!
- List of all keywords:
- <!DOCTYPE html>
- <p>
- <h>
- <a>
- <div>
- <link>
- <br>
- <button>
- <iframe>
- credits
- restart
- exit
- yes
- no
- This tool was made by Chase Barnes
- @2017
- This is OPEN SOURCE software, free to edit and use by anybody.
Add Comment
Please, Sign In to add comment