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( 'Ошибка', 'Неправильно введен логин или пароль')
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.")
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()
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()
#!/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_())
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_())
def main(): """ Initiate the app and the UI """ app = wx.App() ex = main_window(None) ex.Show() app.MainLoop()
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] )
__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_()
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_())
#!/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()
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)
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_())
from main_window import main_window if __name__ == "__main__": main = main_window() main.make_frame() main.make_buttons() main.window.mainloop()
#!/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)
def main(): connect_four_app = QApplication([]) main_window_cf = main_window() main_window_cf.show() exit(connect_four_app.exec_())
#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_())