Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import os
- ######
- # Lyend
- #Get current directory
- current = os.path.dirname(os.path.realpath(__file__))
- #open Template
- file = open(current+'/template/red.css', 'r') #Css example here : http://pastebin.com/tS8pAwMF
- #Lets try not to kill memory consumption
- contents = file.read(1024)
- file.close()
- print(contents + "\n\n")
- def getNames():
- global i
- i = 0
- print('Element Names: ')
- #Grab all the element names from template, I dunno even know how I did this and it worked so goddamn well lmao
- for elementName in contents.split("}"):
- element_split = elementName.split("{")
- #turn the list into a string, and get rid of extra padding
- elements = str(element_split[0].replace('\n', ''))
- #print(elements)
- #get the styles for each element
- elementStyle = str(element_split[1:2])
- print(elements) #Just need to separate this into variables
- #print(elementStyle)
- print('\n\n'+elements) #Woah, returns nothing.
- getNames()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement