コード例 #1
0
def countEsAndReturn(writ, lst, simple):
    for i, c in enumerate(writ):
        eCount = ord(c)
        if simple:
            eCount = eCount - 95
            if (eCount < 2 or eCount > 27) and unSimpli:
                sg.EasyPrint('That isn\'t simplified. Try again.')
                unsimpli = False
                break
        lst.append(("y") + ("e" * eCount) + ('t'))
コード例 #2
0
def countEsAndReturn(writ,lst,simple):
    """Appends a yeet with corresponding e's to the string"""
    for c in writ:
        print(c)
        print(' ')
        eCount = ord(c)
        if simple:
            eCount = eCount-95
            if (eCount<2 or eCount>27) and unSimpli:
                sg.EasyPrint("That isn't simplified. Try again.")
                unsimpli = False
                break
        lst.append(("y") + ("e" * eCount) + ('t'))
コード例 #3
0
ファイル: psirt.py プロジェクト: neilmaldy/Psirt
def print_to_log(log_string):
    """ Print to log file (stderr)
    Prints the logString to stderr, prepends date and time
    """
    global logs

    log = time.strftime("%H:%M:%S") + ": " + log_string
    print(log, file=sys.stderr)
    logging.info(log)
    logs.append(log)
    sg.EasyPrint(log, size=(180, 50))

    if debug_it:
        with open("temp.log", mode='a', encoding='utf-8') as templog:
            print(time.strftime("%H:%M:%S") + ": " + log_string, file=templog)
コード例 #4
0
def gudPrint(lst):
    finalPrint = ''.join(lst)
    sg.EasyPrint(finalPrint)
    finalPrint = ''
コード例 #5
0
            elif yeetishRaw.count('b') == 2:
                yeetishRaw = yeetishRaw[4:]
                ##words = yeetishRaw.split()
                newYeet = []  #create variable to store list of unyeeted
                words = [word.split('y') for word in yeetishRaw.split()]
                ##nyewYeet.pop(0)
                ##print(nyewYeet)
                for word in words:
                    #indieYeet = word.split('y')
                    word.pop(0)
                    for y in word:
                        countE = y.count('e')
                        countE = countE + 95
                        newYeet.append(chr(countE))
                    newYeet.append(' ')
                gudPrint(newYeet)

        elif values['yts'] == True:
            yeetishRaw = values['text']
            tts = gTTS(yeetishRaw, lang='en')
            tts.save('yeet.mp3')
            playsound('yeet.mp3')
            tts = 0

        else:  #if version number has no parser
            sg.EasyPrint('I see you are bad at following instructions')

    else:
        break
コード例 #6
0
def gudPrint(lst):
    """Succintly prints a string from a list to the EasyPrint module"""
    finalPrint = ''.join(lst)
    sg.EasyPrint(finalPrint)
コード例 #7
0
    layout = [[Sg.Button("Download Videos", key="VIDEO")],
              [Sg.Button("Download Audios", key="AUDIO")],
              [Sg.Cancel()]]
    window = Sg.Window("Youtube-dl Downloader", layout=layout)
    event, values = window.Read()
    window.Close()
    if event == "Cancel":
        exit(0)
    else:
        return event


def main_mit_gui():
    file_type: str = video_or_audio()
    links: List[str] = get_links_window()
    path: str = get_folder_input_window()
    if file_type == "VIDEO":
        options = None
    elif file_type == "AUDIO":
        options = {'format': 'bestaudio[ext=m4a]/bestaudio/best'}
    else:
        raise NotImplementedError("Unsupported file type.")
    main(links, path, ydl_options=options)


if __name__ == "__main__":
    from loguru import logger
    logger.remove()
    logger.add(lambda msg: Sg.EasyPrint(msg), level='DEBUG', colorize=False, backtrace=True, diagnose=True)
    main_mit_gui()