예제 #1
0
    def press(self):
        if not (self.login.get() or self.password.get()):
            messagebox.askretrycancel('Пустое поле',
                                      'Не введен логин и пароль')
        elif not self.login.get():
            messagebox.askretrycancel('Пустое поле', 'Не введен логин')
        elif not self.password.get():
            messagebox.askretrycancel('Пустое поле', 'Не введен пароль')
        else:
            with open('privatekey', 'r') as private:
                priv_key = tuple(int(i) for i in private.readline().split(','))
            self.cursor.execute("SELECT USERNAME FROM users")
            all_data = self.cursor.fetchall()
            if not self.proverka(all_data, self.login.get(), 'USERNAME'):
                messagebox.showerror('Ошибка',
                                     'Неправильно введен логин или пароль')
            else:
                self.cursor.execute(
                    "SELECT password FROM users WHERE ? = USERNAME",
                    (self.login.get(), ))
                all_data = self.cursor.fetchone()
                if self.password.get() == rsa.decrypt(
                        all_data['password'],
                        rsa.PrivateKey(*priv_key)).decode('utf-8'):
                    self.LOGIN.destroy()
                    self.cursor.execute(
                        "SELECT theme FROM Users WHERE ? = USERNAME",
                        (self.login.get(), ))
                    main_window.main_window(self.cursor.fetchone()['theme'],
                                            self.login.get())

                else:
                    messagebox.showerror(
                        'Ошибка', 'Неправильно введен логин или пароль')
예제 #2
0
def log_me():
    try:
        database = mysql.connector.connect(host="localhost",
                                           user=login.get(),
                                           password=password.get(),
                                           database="wypozyczalnia_kostiumow")
        root.destroy()
        main_window.main_window(database, root)
    except:
        messagebox.showerror("Błąd", "Wprowadzono niepoprawne dane.")
예제 #3
0
def valid():
    a = entuser.get()
    b = entpass.get()

    #print a
    #print "sssssssssssssssss"
    if (a == "pydetector" and b == 'admin'):
        print a
        print a
        m = main_window.main_window()
        m.main()
    else:
        d = main_window.main_window()
        d.invalid()
예제 #4
0
def valid():
    a=entuser.get()
    b=entpass.get()

    #print a
    #print "sssssssssssssssss"
    if(a=="pydetector" and b=='admin'):
        print a
        print a
        m=main_window.main_window()
        m.main()
    else:
        d=main_window.main_window()
        d.invalid()
예제 #5
0
#!/usr/bin/python3
# -*- coding: UTF-8 -*-


import sys

from PyQt5.QtWidgets import QApplication
import main_window

if __name__ == '__main__':
			
	app = QApplication(sys.argv)
	window = main_window.main_window()
	window.show()
    
	sys.exit(app.exec_())
예제 #6
0
r ( events.spawn_wave, g.spawn_wave )
r ( events.move_all, g.move_all )
r ( events.die, g.die )
r ( events.take_damage, g.take_damage )
r ( events.fire_tower, g.fire_tower )
r ( events.fire_all, g.fire_all )
r ( events.tick, tick)
r ( events.loose, lambda: None)
r ( events.win, lambda: None)
r ( events.loose_life, g.loose_life)
r ( events.get_money, g.get_money)
r ( events.loose_money, g.loose_money)

del r

#testing stuff

e ( events.load_level, "data/levels/1.yaml" )


#create main window
app = QtGui.QApplication(sys.argv)
mw = main_window(event_callback = e, gamestate = g, interval = 20)
mw.show()
e(events.tick)
sys.exit(app.exec_())




예제 #7
0
def main():
    """ Initiate the app and the UI """
    app = wx.App()
    ex = main_window(None)
    ex.Show()
    app.MainLoop()
예제 #8
0
g = game(1 , e)
p = list(g.players())[0]

card_types = load_type_dir ( d.card_types )
deck = load_deck ( d.decks / (sys.argv[1] + '.deck') , card_types )
g.load_deck ( p , deck )
g.cardworld() [ g.location ( p , pl.deck ) ].cardstack().shuffle()

#for c in card_types.values():
#	try:
#		print (c['color'])
#	except:
#		print ('error: ' + c['title'])

app = QtGui.QApplication(sys.argv)
mw = main_window()

mw.stack_reveal.highlighting ( False )

guiworld = cardworld_gui()
guiworld [ g.location ( p , pl.hand ) ] = mw.stack_hand
guiworld [ g.location ( p , pl.reveal ) ] = mw.stack_reveal
guiworld [ g.location ( p , pl.play ) ] = mw.stack_play
guiworld.update ( g.cardworld() )

def draw ():
	g.draw (p)

def move ( origin , destination ):
	guiworld.move ( origin , destination , g.cardworld()[destination] )
예제 #9
0
파일: main.py 프로젝트: jordsti/stigame
__author__ = 'JordSti'
from PyQt4 import QtGui, QtCore
import main_window
import sys

if __name__ == '__main__':

    app = QtGui.QApplication(sys.argv)
    _main_window = main_window.main_window()
    _main_window.show()
    app.exec_()
예제 #10
0
import formula
from PyQt4 import QtCore, QtGui, uic
import sys
from main_window import main_window
import logic_manip

if __name__ == "__main__":
    app = QtGui.QApplication(sys.argv)
    window = QtGui.QMainWindow()
    ui = main_window()
    ui.setupUi(window)
    window.show()
    sys.exit(app.exec_())



예제 #11
0
파일: main.py 프로젝트: al3xc1985/ssi
#!/usr/bin/env python3

import main_window
from PyQt4 import QtGui
import os
import sys
import sip

app = QtGui.QApplication(sys.argv)
wnd = main_window.main_window()


def main():
    sip.setdestroyonexit(False)
    wnd.show()
    sys.exit(app.exec())


if __name__ == '__main__':
    main()
예제 #12
0
import mysql.connector
import main_window
'''connecting to local database'''
database = mysql.connector.connect(host="localhost",
                                   user="******",
                                   password="******",
                                   database="wypozyczalnia_kostiumow")

# print(database)

cursor = database.cursor()

# my_cursor.execute("SHOW TABLES")
# for x in my_cursor:
#   print(x)
'''example of sql query'''
cursor.execute("SELECT * FROM klient")
clients = cursor.fetchall()
for client in clients:
    print(client)

main_window.main_window(database)
예제 #13
0
import sys

from PyQt5 import QtWidgets
from main_window import main_window 

if __name__ == "__main__":
    app = QtWidgets.QApplication(sys.argv)
    myapp = main_window()
    myapp.show()
    sys.exit(app.exec_())
예제 #14
0
from main_window import main_window

if __name__ == "__main__":
    main = main_window()
    main.make_frame()
    main.make_buttons()

    main.window.mainloop()
예제 #15
0
파일: pyhw-qt.py 프로젝트: lv-zheng/PyHW-Qt
#!/usr/bin/env python
# Copyright (C) 2015 Lv Zheng <*****@*****.**>
import sys

from PyQt4.QtGui import QApplication
from main_window import main_window

app = QApplication(sys.argv)

w = main_window(app)

w.show()

rv = app.exec_()

sys.exit(rv)
예제 #16
0
def main():
    connect_four_app = QApplication([])
    main_window_cf = main_window()
    main_window_cf.show()
    exit(connect_four_app.exec_())
예제 #17
0
#register events

r = e.register_event

r ( events.spawn_attacker, g.spawn_attacker )
r ( events.move, g.move )
r ( events.load_level, load_level )
r ( events.place_tower, g.place_tower )
r ( events.spawn_wave, g.spawn_wave )
r ( events.move_all, g.move_all )
r ( events.die, g.die )
r ( events.take_damage, g.take_damage )
r ( events.fire_tower, g.fire_tower )
r ( events.fire_all, g.fire_all )
r ( events.tick, event_tick)
r ( events.lose, event_lose )
r ( events.win, event_win )
r ( events.lose_life, g.lose_life )
r ( events.get_money, g.get_money)
r ( events.lose_money, g.lose_money)

del r

#create main window
app = QtGui.QApplication(sys.argv)
mw = main_window(event_callback = e, interval = 20)
mw.show()
sys.exit(app.exec_())