コード例 #1
0
ファイル: controller.py プロジェクト: flo10696/LPTHW
    def __init__(self):


        self.app = gui.QApplication(sys.argv)
        self.gui = gui.Gui(self)
        self.translator = translation_watson.Translator()
        self.gui.initUI()


        sys.exit(self.app.exec_())
コード例 #2
0
    # initialize smtp (email sending) and imap (email recieving) protocols
    receive = receive.Receive(username, password)
    send = send.Send(username, password)
    # send.send_message(username, "sadasd", "asdasdffasasfdsfa")

    msgs = []
    file_name = 'messages.data'
    # if msg file exists then read from it, else retreive msgs using imap
    if os.path.exists(file_name):
        msgs = gui.read_from_file(file_name)
    else:
        for label in labels:
            msgs.append(receive.get_message(category=label))

    # print inbox category only
    # for msg in msgs:
    #     print("To:\t", msg[1])
    #     print("Date:\t", msg[2])
    #     print("Subject:\t", msg[4])
    #     print("Content:\n", msg[5])
    #     print("_"*40)

    # load gui
    app = gui.QApplication(gui.sys.argv)
    ex = gui.App(mails_lst=msgs,
                 my_mail=username,
                 send=send,
                 receive=receive,
                 labels=labels)
    gui.sys.exit(app.exec_())
コード例 #3
0
ファイル: run.py プロジェクト: topher235/Kindling
# exec(open("gui.py").read(), globals())
import sys
from foldercount import numfile

import gui

exec(open('gatherimages.py').read())

train_q = gui.QApplication([])
train_app = gui.App('train')
# Continue training while there are images left in /images
while numfile('./training_data/like') + numfile(
        './training_data/dislike') < numfile('./images/'):
    train_app.photoChange('./images/')
train_q.quit()

predict_q = gui.QApplication([])
predict_app = gui.App('predict')

# sys.argv = ['gui.py','train']
# exec(open('gui.py').read())

# sys.argv = ['gui.py','predict']
# exec(open('gui.py').read())
コード例 #4
0
def main():
    app = gui.QApplication(sys.argv)

    window = gui.MainWindow()
    window.show()
    app.exec_()