示例#1
0
def print_big(text, color):
    result = ff(value)
    if color in colors:
        coloredText = co(result, color=color)
    else:
        coloredText = co(result, color="red")
    print(coloredText)
示例#2
0
from pyfiglet import figlet_format as ff
from termcolor import colored as c 
import random as r
import requests

url = "https://icanhazdadjoke.com/search"

print(c(ff("Dad jokes 9999"), color = "magenta"))

search = input("Please enter the search value: ")

response = requests.get(url, 
	headers = {"Accept": "application/json"},
	params  = {"term" : search }
)

result = (response.json())['results']
count = 1

if len(result):
	print(f"I have got {len(result)} related jokes here is one")
	print(r.choice(result)["joke"])

else:
	print(f"sorry we done have joke related to {search} please try again")


# for jk in result:
# 	print(f"Joke {count}:  {jk['joke']}")

# 	count += 1
示例#3
0
    "haya",
    "timchen",
    "lmntl dj",
    "jimmymcjimface",
    "jbrown",
]

staffpassword = [
    "7ebf013ae25747d5f9646b5380adf0d1add777f912ebd88f64cd2ca95faeddb81c33107a7e1231a754f40bdc0289135d11cbb17573d2f2724afb1692ac15adb5"
]

semistaffpassword = [
    "0913de549bbebb374c0a55eb695a0e6cc556c7db15b2d5c759c7abb06320e6eb3addd75052b9a0d65a43ccf6658e69e28dd60964c36f5e42caa7508744e7b858"
]

cp(ff("""PyBot\n   v0.9.4""", font="starwars"), "yellow", attrs=["bold"])

print("\n" * 10)

nickname = input("What Should I Call You: ")

clear()

cp(ff("PyBot\n   v0.9.4", font="starwars"), "yellow", attrs=["bold"])

print("\n" * 10)

lang = input("what's your spoken language: ")

if lang.lower() == "":
    lang = "english"
示例#4
0
from pathfinding.core.diagonal_movement import DiagonalMovement
from pathfinding.core.grid import Grid
from pathfinding.finder.a_star import AStarFinder

from pyfiglet import figlet_format as ff

import time as t

#finder
finder = AStarFinder(diagonal_movement=DiagonalMovement.always)

print(ff("Path Finder") + "\n")
print("0 = Obstacle")
print("1 = Way\n")

is_error = False


def error(msg):
    is_error = True
    print("*" * 20)
    print(msg)
    print("*" * 20 + "\n")
    t.sleep(2)


while True:
    is_error = False
    w = int(input("Matrix Width: "))
    h = int(input("Matrix Height: "))
    if (h <= 0 or w <= 0):
示例#5
0
from pyfiglet import figlet_format as ff
from termcolor import colored

print(colored(ff("Webins"), color="cyan", attrs=["blink"]))
示例#6
0
from random import randint
from time import sleep as sl
#A função sleep() suspende o programa pelo tempo solicitado
from pyfiglet import figlet_format as ff

print(ff('DivinationGame'))
sl(2)

print('=-' * 40)
print('Estou pensando em um número...')
sl(2)
print('Entre 0 e 5..')
sl(2)
print('=-' * 40)
sl(2)
n = randint(0, 5)
#Variável que receberá um valor aleatório(O número que o computador "pensou")

t = int(input('Adivinhe o número: '))

print('Entããããoo....')
sl(4)

if t == n:
    print('Você Ganhou!')
    #Se o número adivinhado for igual ao número sorteado

else:
    print(f'Perdeu! eu pensei no {n}.')
    #Caso o número adivinhado não for o mesmo que o sorteado
from pyfiglet import figlet_format as ff
print(ff(input()))

示例#8
0
def tf_dense_sequential(data):
    x_train, ys_train, ya_train, x_test, ys_test, ya_test = data

    in_len = len(x_train[0])
    in_shp = np.shape(x_train[0])
    print(in_len, in_shp)

    l_sz = [10, 25, 50, 100, 250, 500, 1000]
    d_r = [0, 0.01, 0.025, 0.05, 0.1, 0.2, 0.3, 0.4]

    pdf_outs = PdfPages("Keras_Models.pdf")

    count = 0

    for layers in range(1, 11):
        for l in l_sz:
            for d in d_r:
                model = Sequential()

                model.add(Dense(in_len, activation='relu', input_shape=in_shp))
                for i in range(layers - 1):
                    model.add(Dense(l, activation='relu'))
                    if d > 0:
                        model.add(DO(d))
                model.add(Dense(l, activation='relu'))

                model.add(Dense(8, activation='sigmoid'))

                model.compile(optimizer='adam',
                              loss='binary_crossentropy',
                              metrics=['accuracy'])

                out_str = "Layers: " + str(layers) + " --> Layer Size: " + str(
                    l) + " --> Dropout Rate: " + str(d)

                print(ff("Layers: " + str(layers)))
                print(ff("Layer Size: " + str(l)))
                print(ff("Dropout Rate: " + str(d)))

                model.summary()

                history = model.fit(np.array(x_train),
                                    np.array(ya_train),
                                    epochs=150,
                                    validation_data=(np.array(x_test),
                                                     np.array(ya_test)))

                # Plots History of model
                fig = plt.figure()
                plt.plot(history.history['accuracy'])
                plt.plot(history.history['val_accuracy'])
                plt.title(out_str)
                plt.ylabel('accuracy')
                plt.xlabel('epoch')
                plt.legend(['train', 'test'], loc='upper left')

                count += 1
                pdf_outs.savefig(fig)
                plt.clf()

        #        if count > 3:
        #            break
        #    if count > 3:
        #        break
        #if count > 3:
        #    break

    pdf_outs.close()
    return
示例#9
0
from termcolor import colored
from pyfiglet import figlet_format as ff
# help(termcolor) -- Shows documentation

text = colored('Hi There!',
               color='yellow',
               on_color='on_cyan',
               attrs=['blink'])
# print(text)

valid_colors = ('red', 'green', 'yellow', 'blue', 'magenta', 'cyan', 'white')

msg = input('What would youlike to print? ')
color = input('What color? ')

if color not in valid_colors:
    color = 'magenta'

ascii_art = ff(msg)
colored_ascii = colored(ascii_art, color=color)
print(colored_ascii)
示例#10
0
            yt = YouTube(iurl)
            print('[-] success: ', yt.title)
            yt.streams.filter(only_audio=True).first().download()
            if output == '1':
                os.system("ffmpeg -i \"" + aname + "\" -ab 160k \"" +
                          aname.split('.')[0] + "_.mp3" + "\"")
                os.remove(aname)
    else:
        print('[*] Enter correct choice like 243')
        playlist()


if __name__ == "__main__":

    # Wanna Be Cool
    print(
        ff('YToff', font=['block', 'isometric1', 'isometric2'][randint(0, 2)]))

    url = input('[+] Url for Video/Playlist: ')

    # Decide if playlist or single track
    try:
        if 'https://www.youtube.com/playlist?' in url:
            playlist(url)
        else:
            single(url)
    except Exception as e:
        print(e, '\n[*] Give YouTube Video or Playlist link.')

    input('            [F][U][L][L][][S][U][C][C][E][S][S]            ')
示例#11
0
import requests as r
from random import choice
from pyfiglet import figlet_format as ff
from termcolor import colored

print(colored(ff("Random Joke"), color="cyan", attrs=["blink"]))

topic = input("Let me tell you a joke! Give me a topic: ")

url = "https://icanhazdadjoke.com/search"
response = r.get(url,
                 headers={
                     "Accept": "application/json"
                 },
                 params={
                     "term": topic
                 }).json()

size = response["total_jokes"]
data = response["results"]

if size > 1:
    print(f"I've got {size} joke about {topic} Here it is one:\n")
    print(colored(choice(data)["joke"], color="cyan"))
    print()
elif size == 1:
    print(f"I have only one joke about {topic}. Here it is:")
    print(colored(data[0]["joke"], color="cyan"))
    print()
else:
    print(
示例#12
0
from termcolor import colored
from pyfiglet import figlet_format as ff

user_txt = input("Waht message do you want to enter?: ")
user_color = input("What color?: ").lower()
valid_colors = ('red', 'green', 'yellow', 'blue', 'magenta', 'cyan', 'white')

if user_color not in valid_colors or user_color == "":
    user_color = 'red'

fig_txt = ff(user_txt)
col_txt = colored(fig_txt, color=user_color)

print(fig_txt)
print(col_txt)