def convert(val, ans): if "int" in val: return int(ans) elif "numeric" in val: return float(ans) elif "bool" == val: return True if ans == "true" else False else: return ans db = PlayStore() tables = sorted(db.schema_struct.keys()) puts(colored.green(figlet("PlayStore"))) style = style_from_dict({ Token.Separator: "#15ff00", Token.QuestionMark: "#673ab7 bold", Token.Selected: "#cc5454", # default Token.Pointer: "#66d9ef bold", Token.Instruction: "#ae81ff", # default Token.Answer: "#f44336 bold", Token.Question: "#66d9ef", }) q1 = [{ "type": "list", "message":
def main(args=None): if args is None: args = sys.argv[1:] # setup operator = "" nameOfItem = "" typeOfItem = "Execute" commandOfItem = "" foundMenu = False #---------------------------------------------------------------------- figText = figlet(font='slant') print(bccolors.TITLE + figText.renderText('obia')) #get home path home = str(Path.home()) #concant w/ rest of dir configDir = home + "/.config/openbox/menu.xml" nameOfMenu = input(bccolors.TITLE + '>>>' + bccolors.MAIN + " Name of The Menu: ") nameOfItem = input(bccolors.TITLE + '>>>' + bccolors.MAIN + " Name of Menu Item: ") commandOfItem = input(bccolors.TITLE + '>>>' + bccolors.MAIN + " Item Command: ") idMenu = "id=\"" + nameOfMenu #------------------------------------------------------------------------------------ #TODO find a way to not make this crappy string xmlEntry = " <item label=\"" + nameOfItem + "\">\n <action name=\"" + typeOfItem + "\">\n <command>\n " + commandOfItem + "\n </command>\n </action>\n </item>\n" print(bccolors.ALT + "\nLooking for menu in file...") #open file for reading and get contents with open(configDir, "r") as sf: for line in sf: if idMenu in line: foundMenu = True print("Menu found!") with open(configDir, "r") as f: content = f.readlines() f.close() #TODO remove this if statement if (foundMenu == False): print("Error: Menu " + nameOfMenu + " not found") exit() #get index index = [ x for x in range(len(content)) if nameOfMenu in content[x].lower() ] print("Adding to menu.xml...") #insert text into file at index plus 1 content.insert(index[0] + 1, xmlEntry) #write f = open(configDir, "w") content = "".join(content) f.write(content) f.close() print("Done!")
import hashlib, sys, time from termcolor import colored as color from pyfiglet import figlet_format as figlet if len(sys.argv)==2: if sys.argv[1]=='gen': print (color(figlet('md5'), 'red')) str = input(color('Enter string: ', 'blue')) result = hashlib.md5(str.encode()) result = result.hexdigest() print (color('Hash is : ' + result, 'cyan')) elif sys.argv[1]=='crack': print (color(figlet('md5'), 'red')) print (color('cracking mode...', 'green')) hash = input('Enter hash: ') wordlist = input(color('Enter wordlist [defult : words.txt] : ', 'green')) try: words = open(wordlist, 'r') except: print (color('[-] Wordlist not found', 'red')) exit() start = time.time() for word in words.readlines(): word = word.strip() h = hashlib.md5(word.encode()) c_hash = h.hexdigest() if hash==c_hash: print (color('[!] Hash found : ' + word, 'green')) print (color('[+] Hash found in ' + str(time.time()-start), 'red')) exit() else:
"""import requests url = "http://www.google.com" response = requests.get(url) print(f"your request to {url} came back w/ status code {response.status_code}") help(requests)""" from pyfiglet import figlet_format as figlet from termcolor import colored as color from random import choice import requ kirgiw = 'My DAD JOKE!!!!' osigo = figlet(kirgiw) c = color(osigo,color="magenta") print(c) url = "https://icanhazdadjoke.com/search" koyu = str(input("Kandai Prikol Tigain: ")) response = requests.get( url, headers={"Accept": "application/json"}, params={"term": koyu} ) data = response.json() form = len(data["results"])