#-*-coding: utf-8 -*-
import sys
from PyQt5.QtCore import Qt
from PyQt5 import QtCore, QtGui, QtWidgets
import speech_recognition as sr
import os
import webbrowser
import sqlite3
from sqlite3 import dbapi2 as sqlite3
import pyttsx3
import time
import datetime
from random import choice
from PyQt5.QtWidgets import QWidget, QApplication, QHBoxLayout, QLabel, QDialog
from PyQt5.QtWidgets import QGraphicsScene, QGraphicsView, QGraphicsLinearLayout, QGraphicsWidget
from PyQt5.QtGui import QMovie
from PyQt5.QtWidgets import (QMainWindow, QCheckBox, QGridLayout, QSpacerItem, QSizePolicy, QPushButton, QLineEdit, QInputDialog)
from PyQt5.QtCore import QCoreApplication, QSettings, QRect
speak_engine = pyttsx3.init()
candycash = 0
count_temp = 0
level = 1
message_candy = ''
message_user = ''
buy2 = "2000 CandyCash"
interface = 0
login = ""
password = ""
game = ""
count_candycash = 'Candycash: ' + str(candycash)
def say(message):
speak_engine.say( message )
speak_engine.runAndWait()
speak_engine.stop()
def data_base():
con = sqlite3.connect('CandyBase.db')
cur = con.cursor()
cur.execute('CREATE TABLE IF NOT EXISTS database(CandyCash REAL,'
'CandyLevel REAL,'
'Interface REAL)')
cur.close()
con.commit()
class CandyMarket(QWidget):
def __init__(self):
super(CandyMarket, self).__init__()
self.setWindowTitle('CandyMarket')
self.setupUi(self)
self.settings = QSettings('CandyAssistent', 'CandyCompany', self)
self.loadSettings()
def setupUi(self, Form):
Form.setObjectName("Form")
Form.resize(775, 452)
Form.setStyleSheet("")
self.label = QtWidgets.QLabel(Form)
self.label.setGeometry(QtCore.QRect(310, 30, 261, 61))
self.label.setStyleSheet("QLabel {font-size: 30px;}")
self.label.setObjectName("label")
self.pushButton = QtWidgets.QPushButton(Form)
self.pushButton.setGeometry(QtCore.QRect(40, 140, 151, 261))
self.pushButton.setStyleSheet("")
self.pushButton.setObjectName("pushButton")
self.pushButton_2 = QtWidgets.QPushButton(Form)
self.pushButton_2.setGeometry(QtCore.QRect(220, 140, 151, 261))
self.pushButton_2.setObjectName("pushButton_2")
self.pushButton_3 = QtWidgets.QPushButton(Form)
self.pushButton_3.setGeometry(QtCore.QRect(400, 140, 151, 261))
self.pushButton_3.setObjectName("pushButton_3")
self.pushButton_4 = QtWidgets.QPushButton(Form)
self.pushButton_4.setGeometry(QtCore.QRect(580, 140, 151, 261))
self.pushButton_4.setObjectName("pushButton_4")
self.label_2 = QtWidgets.QLabel(Form)
self.label_2.setGeometry(QtCore.QRect(30, 10, 731, 31))
self.label_2.setStyleSheet("QLabel {font-size: 15px;}")
self.label_2.setObjectName("label_2")
self.retranslateUi(Form)
QtCore.QMetaObject.connectSlotsByName(Form)
def retranslateUi(self, Form):
_translate = QtCore.QCoreApplication.translate
Form.setWindowTitle(_translate("Form", "CandyMarket"))
self.label.setText(_translate("Form", "CandyMarket"))
self.pushButton.setText(_translate("Form", "Интерфейсы"))
self.pushButton_2.setText(_translate("Form", "Голоса/Звуки"))
self.pushButton_3.setText(_translate("Form", "Игры"))
self.pushButton_4.setText(_translate("Form", ("CandyCash")))
self.label_2.setText(_translate("Form", "CandyCash:" + str(candycash)))
self.pushButton.clicked.connect(self.interface_button)
def interface_button(self):
self.close()
self.MI = MarketInterface()
self.MI.show()
def closeEvent(self, e):
self.saveSettings()
e.accept()
def loadSettings(self):
pass
def saveSettings(self):
global candycash
global level
global interface
con = sqlite3.connect('CandyBase.db')
cur = con.cursor()
sql = "DELETE FROM database"
cur.execute(sql)
info_database = [str(candycash), str(level), str(interface)]
cur.execute('INSERT INTO database VALUES(?, ?, ?)', info_database)
con.commit()
class MarketInterface(QWidget):
def __init__(self):
super(MarketInterface, self).__init__()
self.setWindowTitle('CandyMarket')
self.interfaces(self)
self.settings = QSettings('CandyAssistent', 'CandyCompany', self)
self.loadSettings()
def interfaces(self, Form):
Form.setObjectName("Form")
Form.resize(773, 452)
self.label = QtWidgets.QLabel(Form)
self.label.setGeometry(QtCore.QRect(300, 10, 381, 101))
self.label.setStyleSheet("QLabel {font-size: 30px;}")
self.label.setObjectName("label")
self.label_2 = QtWidgets.QLabel(Form)
self.label_2.setGeometry(QtCore.QRect(330, 100, 141, 41))
self.label_2.setStyleSheet("QLabel {font-size: 20px;}")
self.label_2.setObjectName("label_2")
self.pushButton = QtWidgets.QPushButton(Form)
self.pushButton.setGeometry(QtCore.QRect(170, 180, 171, 231))
self.pushButton.setObjectName("pushButton")
self.pushButton_2 = QtWidgets.QPushButton(Form)
self.pushButton_2.setGeometry(QtCore.QRect(420, 180, 171, 231))
self.pushButton_2.setObjectName("pushButton_2")
self.label_3 = QtWidgets.QLabel(Form)
self.label_3.setGeometry(QtCore.QRect(230, 420, 131, 16))
self.label_3.setObjectName("label_3")
self.label_4 = QtWidgets.QLabel(Form)
self.label_4.setGeometry(QtCore.QRect(470, 420, 111, 16))
self.label_4.setObjectName("label_4")
self.label_5 = QtWidgets.QLabel(Form)
self.label_5.setGeometry(QtCore.QRect(30, 10, 731, 31))
self.label_5.setStyleSheet("QLabel {font-size: 15px;}")
self.label_5.setObjectName("label_5")
self.retranslateUi(Form)
QtCore.QMetaObject.connectSlotsByName(Form)
def retranslateUi(self, Form):
global candycash
global buy2
_translate = QtCore.QCoreApplication.translate
Form.setWindowTitle(_translate("Form", "CandyMarket"))
self.label.setText(_translate("Form", "CandyMarket"))
self.label_2.setText(_translate("Form", "Интерфейсы"))
self.pushButton.setText(_translate("Form", "Базовый интерфейс"))
self.pushButton_2.setText(_translate("Form", "Интерфейс 1 уровня"))
self.label_3.setText(_translate("Form", "КУПЛЕНО"))
self.label_4.setText(_translate("Form", buy2))
self.label_5.setText(_translate("Form", "CandyCash:" + str(candycash)))
self.pushButton.clicked.connect(self.interface1_button)
self.pushButton_2.clicked.connect(self.interface2_button)
def interface1_button(self):
self.close()
self.interface1 = Interface1()
self.interface1.show()
def interface2_button(self):
global candycash
global buy2
buy2 = 'КУПЛЕНО'
if candycash >= 2000:
candycash -= 2000
self.close()
self.interface2 = Interface2()
self.interface2.show()
def closeEvent(self, e):
self.saveSettings()
e.accept()
def loadSettings(self):
pass
def saveSettings(self):
global candycash
global level
global interface
con = sqlite3.connect('CandyBase.db')
cur = con.cursor()
sql = "DELETE FROM database"
cur.execute(sql)
info_database = [str(candycash), str(level), str(interface)]
cur.execute('INSERT INTO database VALUES(?, ?, ?)', info_database)
con.commit()
class Interface2(QtWidgets.QMainWindow):
def __init__(self):
global interface
global buy2
buy2 = 'КУПЛЕНО'
interface = 2
super(Interface2, self).__init__()
self.setWindowTitle('CandyAssistent')
self.interface2_open(self)
self.button_candy.clicked.connect(self.interface_operation)
self.keyboard.clicked.connect(self.go_open_keyboard_interface)
self.candymarket.clicked.connect(self.open_CandyMarket)
self.settings = QSettings('CandyAssistent', 'CandyCompany', self)
self.loadSettings()
def interface2_open(self, Form):
Form.setObjectName("Form")
Form.resize(351, 550)
Form.setCursor(QtGui.QCursor(QtCore.Qt.ArrowCursor))
Form.setStyleSheet("QWidget {background-color: white;}")
self.button_candy = QtWidgets.QPushButton(Form)
self.button_candy.setGeometry(QtCore.QRect(130, 440, 91, 91))
self.button_candy.setStyleSheet("QPushButton {border: None;}")
self.button_candy.setText("")
icon = QtGui.QIcon()
icon.addPixmap(QtGui.QPixmap("logo_inter2.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.button_candy.setIcon(icon)
self.button_candy.setIconSize(QtCore.QSize(100, 100))
self.button_candy.setObjectName("button_candy")
self.pushButton_2 = QtWidgets.QPushButton(Form)
self.pushButton_2.setGeometry(QtCore.QRect(10, 10, 41, 41))
self.pushButton_2.setStyleSheet("QPushButton {border: None;}")
self.pushButton_2.setText("")
icon1 = QtGui.QIcon()
icon1.addPixmap(QtGui.QPixmap("candycash_logo.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.pushButton_2.setIcon(icon1)
self.pushButton_2.setIconSize(QtCore.QSize(40, 40))
self.pushButton_2.setObjectName("pushButton_2")
self.keyboard = QtWidgets.QPushButton(Form)
self.keyboard.setGeometry(QtCore.QRect(270, 490, 61, 51))
self.keyboard.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
self.keyboard.setStyleSheet("QPushButton {border: None}")
self.keyboard.setText("")
icon2 = QtGui.QIcon()
icon2.addPixmap(QtGui.QPixmap("logo_keyboard.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.keyboard.setIcon(icon2)
self.keyboard.setIconSize(QtCore.QSize(50, 50))
self.keyboard.setObjectName("keyboard")
self.candymarket = QtWidgets.QPushButton(Form)
self.candymarket.setGeometry(QtCore.QRect(20, 490, 61, 51))
self.candymarket.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
self.candymarket.setStyleSheet("QPushButton {border: None}")
self.candymarket.setText("")
icon3 = QtGui.QIcon()
icon3.addPixmap(QtGui.QPixmap("logo_candymarket.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.candymarket.setIcon(icon3)
self.candymarket.setIconSize(QtCore.QSize(50, 50))
self.candymarket.setObjectName("candymarket")
self.label = QtWidgets.QLabel(Form)
self.label.setGeometry(QtCore.QRect(60, 20, 101, 21))
self.label.setObjectName("label")
self.pushButton_5 = QtWidgets.QPushButton(Form)
self.pushButton_5.setGeometry(QtCore.QRect(180, 10, 61, 51))
self.pushButton_5.setStyleSheet("QPushButton {border: None;}")
self.pushButton_5.setText("")
icon4 = QtGui.QIcon()
icon4.addPixmap(QtGui.QPixmap("logo_lvl.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.pushButton_5.setIcon(icon4)
self.pushButton_5.setIconSize(QtCore.QSize(50, 50))
self.pushButton_5.setObjectName("pushButton_5")
self.label_2 = QtWidgets.QLabel(Form)
self.label_2.setGeometry(QtCore.QRect(250, 20, 91, 21))
self.label_2.setObjectName("label_2")
self.textEdit = QtWidgets.QTextEdit(Form)
self.textEdit.setGeometry(QtCore.QRect(20, 70, 311, 361))
self.textEdit.setObjectName("textEdit")
self.retranslateUi(Form)
QtCore.QMetaObject.connectSlotsByName(Form)
def retranslateUi(self, Form):
global level
global candycash
_translate = QtCore.QCoreApplication.translate
Form.setWindowTitle(_translate("Form", "CandyAssistent"))
self.label.setText(_translate("Form", str(candycash)))
self.textEdit.setReadOnly(True)
self.label_2.setText(_translate("Form", str(level)))
def open_CandyMarket(self):
global message_user
message_user = "открой candy market"
Program_operation.answere_candy(self, message_user)
def go_open_keyboard_interface(self):
self.close()
self.interface2_keyboard_open = Interface2_keyboard()
self.interface2_keyboard_open.show()
def interface_operation(self):
global count_temp
global candycash
global message_user
global message_candy
self.button_candy.setEnabled(False)
self.keyboard.setEnabled(False)
self.candymarket.setEnabled(False)
Program_operation()
self.user_message()
Program_operation.answere_candy(self, message_user)
self.candy_message()
self.button_candy.setEnabled(True)
self.keyboard.setEnabled(True)
self.candymarket.setEnabled(True)
if "вв" and 'код разработчика' in message_user:
self.creatorCode_win()
elif 'давайте поиграем' in message_user or 'давай поиграем' in message_user and ('камень ножницы бумага' in message_user or 'камень-ножницы бумага' in message_user or 'камень ножницы-бумага' in message_user or 'камень-ножницы-бумага' in message_user):
self.button_candy.setEnabled(False)
self.keyboard.setEnabled(False)
self.candymarket.setEnabled(False)
message_user = 'да'
message_candy = 'Объясню вам правила: Вы выбираете либо камень, либо ножницы, либо бумагу. После этого делает выбор Candy. Ножницы сильнее бумаги, камень сильнее ножниц, а бумага сильнее камня.'
self.candy_message()
say(message_candy)
while ('да' in message_user or 'конечно' in message_user or 'естественно' in message_user) and 'нет' not in message_user:
message_candy = 'Делайте выбор.'
self.candy_message()
say(message_candy)
Program_operation()
self.user_message()
choice_candy = choice(['ножницы', 'камень', 'бумага'])
say("А у меня " + choice_candy + ".")
message_candy = "А у меня " + choice_candy + "."
self.candy_message()
Program_operation.game_knb_for_lvl(self, choice_candy)
self.candy_message()
self.level_print()
message_candy = 'Играем дальше?'
self.candy_message()
say(message_candy)
Program_operation()
if 'не' in message_user:
message_candy = "Было приятно с вами играть."
self.candy_message()
say(message_candy)
self.button_candy.setEnabled(True)
self.keyboard.setEnabled(True)
self.candymarket.setEnabled(True)
elif ('поиграем' in message_user or "игр" in message_user or "сыграть" in message_user or "сыграем" in message_user) and (("ор" in message_user and "реш" in message_user) or ("реш" in message_user and "ор" in message_user)):
self.button_candy.setEnabled(False)
self.keyboard.setEnabled(False)
self.candymarket.setEnabled(False)
message_candy = "Вас приветствует игра орёл и решка. Вам доступно несколько режимов:"
self.candy_message()
say(message_candy)
message_candy = "Первый: Режим новичка. За выигрыш вы получите 10 CandyCash."
self.candy_message()
say(message_candy)
message_candy = "Второй: Режим любителя. За выигрыш вы получте 100 CandyCash, а за проигрыш вы потеряете 50 CandyCash."
self.candy_message()
say(message_candy)
message_candy = "Третий: Режим опытного игрока. За выигрыш вы получите 300 CandyCash, а за проигрыш вы потеряете 150 CandyCash."
self.candy_message()
say(message_candy)
message_candy = "Четвёртый: Режим эксперта. За выигрыш вы получите 500 CandyCash, а за проигрыш вы потеряете 250 CandyCash."
self.candy_message()
say(message_candy)
say("Выбирайте.")
Program_operation()
self.user_message()
while count_temp == 0:
if "1" in message_user or "первый" in message_user or "один" in message_user or "режим новичка" in message_user or "нович" in message_user:
candycashPlus = 10
self.user_message()
count_temp = 1
elif "2" in message_user or "второй" in message_user or "два" in message_user or "режим любителя" in message_user or "любит" in message_user:
self.user_message()
candycashPlus = 100
count_temp = 1
elif "3" in message_user or "третий" in message_user or "три" in message_user or "режим опытного" in message_user or "опыт" in message_user:
candycashPlus = 300
count_temp = 1
self.user_message()
elif "4" in message_user or "четвёртый" in message_user or "четыре" in message_user or "режим эксперта" in message_user or "экс" in message_user:
candycashPlus = 500
count_temp = 1
self.user_message()
else:
message_candy = "Такого режима ещё нет, если вы передумали играть то скажите прекратить игру. Для продолжения называйте режим."
say(message_candy)
self.candy_message()
Program_operation()
self.user_message()
if 'прекр' in message_user and "иг" in message_user:
count_temp = 2
self.button_candy.setEnabled(True)
Interface2()
if count_temp != 2:
message_candy = "Объясню вам правила: У вас есть выбор между орлом и решкой. После этого Candy бросает монетку. Если ваш ответ совпал со стороной монетки то вы получите CandyCash, иначе вы его потеряете."
self.candy_message()
say(message_candy)
if candycash >= (candycashPlus / 2) or candycashPlus == 10:
message_user = 'да'
while ('да' in message_user or 'конечно' in message_user or 'естественно' in message_user) and 'нет' not in message_user:
message_candy = 'Орёл или решка?'
self.candy_message()
say(message_candy)
Program_operation()
self.user_message()
if "ор" in message_user or "реш" in message_user:
self.user_message()
choice_candy = choice(['орёл', 'решка'])
if choice_candy == "орёл":
message_candy = "Выпал орёл."
else:
message_candy = "Выпала решка."
self.candy_message()
say(message_candy)
Program_operation.game_orel_and_reshka_for_cc(self, candycashPlus, choice_candy)
self.candy_message()
self.candycash_print()
message_candy = 'Играем дальше?'
self.candy_message()
say(message_candy)
Program_operation()
self.user_message()
if ('да' in message_user or 'конечно' in message_user or 'естественно' in message_user) and 'нет' not in message_user:
message_user = "да"
else:
message_candy = "Было приятно с вами играть."
self.candy_message()
say(message_candy)
self.button_candy.setEnabled(True)
self.keyboard.setEnabled(True)
self.candymarket.setEnabled(True)
else:
message_user = "да"
else:
message_candy = "Что бы начать игру вам не хватает CandyCash. Вы можете купить его у разработчика (2 CandyCash = 1 рубль) в директе () или во Вконтакте (). Ну или просто сыграть в режим новичка."
self.candy_message()
say(message_candy)
self.button_candy.setEnabled(True)
self.keyboard.setEnabled(True)
self.candymarket.setEnabled(True)
def creatorCode_win(self):
global candycash
global message_user
global creator
global level
text, ok = QInputDialog.getText(self, 'CreatorCode', 'Введите код разработчика: ')
if ok:
if text == 'Q5du7cc4opEQ1189':
candycash = 999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999
level = 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999
say('Код верный!')
creator = True
self.candycash_print()
self.level_print()
else:
say('Код неверный!')
def candycash_print(self):
global candycash
self.label.setText(str(candycash))
def level_print(self):
global level
self.label_2.setText(str(level))
def candy_message(self):
global message_candy
text = 'Candy: ' + message_candy
self.textEdit.append(text)
def user_message(self):
global message_user
txt = message_user[0].upper() + message_user[1:]
text = 'You: ' + txt
self.textEdit.append(text)
def closeEvent(self, e):
self.saveSettings()
e.accept()
def loadSettings(self):
if self.settings.contains('geometry'):
self.setGeometry(self.settings.value('geometry'))
def saveSettings(self):
global candycash
global level
global interface
self.settings.setValue('geometry', self.geometry())
con = sqlite3.connect('CandyBase.db')
cur = con.cursor()
sql = "DELETE FROM database"
cur.execute(sql)
info_database = [str(candycash), str(level), str(interface)]
cur.execute('INSERT INTO database VALUES(?, ?, ?)', info_database)
con.commit()
class Interface2_keyboard(QWidget):
def __init__(self):
super().__init__()
self.setWindowTitle('CandyAssistent')
self.open_win_keyboard_interface2(self)
self.button_candy.clicked.connect(self.go_open_interface)
self.pushButton.clicked.connect(self.go_text)
self.candymarket.clicked.connect(self.open_CandyMarket)
self.settings = QSettings('CandyAssistent', 'CandyCompany', self)
self.loadSettings()
def open_win_keyboard_interface2(self, Form):
Form.setObjectName("Form")
Form.resize(351, 550)
Form.setStyleSheet("QWidget {background-color: white;}")
self.candymarket = QtWidgets.QPushButton(Form)
self.candymarket.setGeometry(QtCore.QRect(20, 490, 61, 51))
self.candymarket.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
self.candymarket.setStyleSheet("QPushButton {border: None}")
self.candymarket.setText("")
icon = QtGui.QIcon()
icon.addPixmap(QtGui.QPixmap("logo_candymarket.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.candymarket.setIcon(icon)
self.candymarket.setIconSize(QtCore.QSize(50, 50))
self.candymarket.setObjectName("candymarket")
self.pushButton_2 = QtWidgets.QPushButton(Form)
self.pushButton_2.setGeometry(QtCore.QRect(10, 10, 41, 41))
self.pushButton_2.setStyleSheet("QPushButton {border: None;}")
self.pushButton_2.setText("")
icon1 = QtGui.QIcon()
icon1.addPixmap(QtGui.QPixmap("candycash_logo.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.pushButton_2.setIcon(icon1)
self.pushButton_2.setIconSize(QtCore.QSize(40, 40))
self.pushButton_2.setObjectName("pushButton_2")
self.button_candy = QtWidgets.QPushButton(Form)
self.button_candy.setGeometry(QtCore.QRect(280, 490, 51, 51))
self.button_candy.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
self.button_candy.setStyleSheet("QPushButton {border: None;}")
self.button_candy.setText("")
icon2 = QtGui.QIcon()
icon2.addPixmap(QtGui.QPixmap("logo_inter2.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.button_candy.setIcon(icon2)
self.button_candy.setIconSize(QtCore.QSize(50, 50))
self.button_candy.setObjectName("button_candy")
self.label = QtWidgets.QLabel(Form)
self.label.setGeometry(QtCore.QRect(60, 20, 101, 21))
self.label.setObjectName("label")
self.label_2 = QtWidgets.QLabel(Form)
self.label_2.setGeometry(QtCore.QRect(250, 20, 91, 21))
self.label_2.setObjectName("label_2")
self.pushButton_5 = QtWidgets.QPushButton(Form)
self.pushButton_5.setGeometry(QtCore.QRect(180, 10, 61, 51))
self.pushButton_5.setStyleSheet("QPushButton {border: None;}")
self.pushButton_5.setText("")
icon3 = QtGui.QIcon()
icon3.addPixmap(QtGui.QPixmap("logo_lvl.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.pushButton_5.setIcon(icon3)
self.pushButton_5.setIconSize(QtCore.QSize(50, 50))
self.pushButton_5.setObjectName("pushButton_5")
self.lineEdit = QtWidgets.QLineEdit(Form)
self.lineEdit.setGeometry(QtCore.QRect(70, 440, 171, 31))
self.lineEdit.setStyleSheet("QLineEdit {border: None}")
self.lineEdit.setObjectName("lineEdit")
self.pushButton = QtWidgets.QPushButton(Form)
self.pushButton.setGeometry(QtCore.QRect(250, 430, 41, 51))
self.pushButton.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor))
self.pushButton.setStyleSheet("QPushButton {border: None}")
self.pushButton.setText("")
icon4 = QtGui.QIcon()
icon4.addPixmap(QtGui.QPixmap("logo_go_mes.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
self.pushButton.setIcon(icon4)
self.pushButton.setIconSize(QtCore.QSize(300, 300))
self.pushButton.setObjectName("pushButton")
self.line = QtWidgets.QFrame(Form)
self.line.setGeometry(QtCore.QRect(60, 480, 240, 3))
self.line.setFrameShape(QtWidgets.QFrame.HLine)
self.line.setFrameShadow(QtWidgets.QFrame.Sunken)
self.line.setObjectName("line")
self.line_3 = QtWidgets.QFrame(Form)
self.line_3.setGeometry(QtCore.QRect(60, 430, 240, 3))
self.line_3.setFrameShape(QtWidgets.QFrame.HLine)
self.line_3.setFrameShadow(QtWidgets.QFrame.Sunken)
self.line_3.setObjectName("line_3")
self.line_2 = QtWidgets.QFrame(Form)
self.line_2.setGeometry(QtCore.QRect(60, 430, 3, 50))
self.line_2.setFrameShape(QtWidgets.QFrame.VLine)
self.line_2.setFrameShadow(QtWidgets.QFrame.Sunken)
self.line_2.setObjectName("line_2")
self.line_4 = QtWidgets.QFrame(Form)
self.line_4.setGeometry(QtCore.QRect(300, 430, 3, 50))
self.line_4.setFrameShape(QtWidgets.QFrame.VLine)
self.line_4.setFrameShadow(QtWidgets.QFrame.Sunken)
self.line_4.setObjectName("line_4")
self.line_5 = QtWidgets.QFrame(Form)
self.line_5.setGeometry(QtCore.QRect(240, 430, 3, 50))
self.line_5.setFrameShape(QtWidgets.QFrame.VLine)
self.line_5.setFrameShadow(QtWidgets.QFrame.Sunken)
self.line_5.setObjectName("line_5")
self.textEdit = QtWidgets.QTextEdit(Form)
self.textEdit.setGeometry(QtCore.QRect(20, 70, 311, 341))
self.textEdit.setObjectName("textEdit")
self.retranslateUi(Form)
QtCore.QMetaObject.connectSlotsByName(Form)
def retranslateUi(self, Form):
global level
global candycash
_translate = QtCore.QCoreApplication.translate
Form.setWindowTitle(_translate("Form", "CandyAssistent"))
self.textEdit.setReadOnly(True)
self.label.setText(_translate("Form", str(candycash)))
self.label_2.setText(_translate("Form", str(level)))
def open_CandyMarket(self):
global message_user
message_user = "открой candy market"
Program_operation.answere_candy(self, message_user)
def go_open_interface(self):
self.close()
self.interface2_open = Interface2()
self.interface2_open.show()
def go_text(self):
global message_user
self.button_candy.setEnabled(False)
self.candymarket.setEnabled(False)
self.pushButton.setEnabled(False)
message_user = self.lineEdit.text()
message_user = message_user.lower()
self.lineEdit.setText('')
self.interface_operation()
def goText(self):
global message_user
message_user = self.lineEdit.text()
message_user = message_user.lower()
self.lineEdit.setText('')
def interface_operation(self):
global count_temp
global candycash
global message_user
global message_candy
self.user_message()
Program_operation.answere_candy(self, message_user)
self.candy_message()
self.button_candy.setEnabled(True)
self.candymarket.setEnabled(True)
self.pushButton.setEnabled(True)
if "вв" and 'код разработчика' in message_user:
self.creatorCode_win()
def creatorCode_win(self):
global candycash
global message_user
global creator
global level
text, ok = QInputDialog.getText(self, 'CreatorCode', 'Введите код разработчика: ')
if ok:
if text == 'Q5du7cc4opEQ1189':
candycash = 999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999
level = 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999
say('Код верный!')
creator = True
self.candycash_print()
self.level_print()
else:
say('Код неверный!')
def candycash_print(self):
global candycash
self.label.setText(str(candycash))
def level_print(self):
global level
self.label_2.setText(str(level))
def candy_message(self):
global message_candy
text = 'Candy: ' + message_candy
self.textEdit.append(text)
def user_message(self):
global message_user
txt = message_user[0].upper() + message_user[1:]
text = 'You: ' + txt
self.textEdit.append(text)
def closeEvent(self, e):
self.saveSettings()
e.accept()
def loadSettings(self):
if self.settings.contains('geometry'):
self.setGeometry(self.settings.value('geometry'))
def saveSettings(self):
global candycash
global level
global interface
con = sqlite3.connect('CandyBase.db')
cur = con.cursor()
sql = "DELETE FROM database"
cur.execute(sql)
info_database = [str(candycash), str(level), str(interface)]
cur.execute('INSERT INTO database VALUES(?, ?, ?)', info_database)
con.commit()
class Interface1(QtWidgets.QMainWindow):
def __init__(self, parent=None):
global candycash
super().__init__()
self.setupUi(self)
self.candycash_print()
self.level_print()
self.pushButton.clicked.connect(self.interface_operation)
self.settings = QSettings('CandyAssistent', 'CandyCompany', self)
self.loadSettings()
def setupUi(self, Form):
Form.setObjectName("Form")
Form.resize(331, 551)
Form.setStyleSheet("QWidget {background-color: white;}")
self.label_2 = QtWidgets.QLabel(Form)
self.label_2.setGeometry(QtCore.QRect(10, 0, 331, 51))
self.label_2.setObjectName("label_2")
self.pushButton = QtWidgets.QPushButton(Form)
self.pushButton.setGeometry(QtCore.QRect(60, 420, 221, 91))
self.pushButton.setStyleSheet("QPushButton {background-color: #FFFFFF;\n"
" border: 1px solid #CCCCCC;\n"
" box-shadow: 0 1px 1px rgba(0, 0, 0, 0.075) inset;\n"
" transition: border 0.2s linear 0s, box-shadow 0.2s linear 0s;\n"
" border-radius: 4px;\n"
" color: #555555;\n"
" display:block;\n"
" width:120px;\n"
" margin: 20px auto;\n"
" font-size: 14px;\n"
" text-align:center;\n"
" line-height: 20px;\n"
" margin-bottom: 10px;\n"
" padding: 4px 6px;\n"
" vertical-align: middle;\n"
" text-decoration:none;\n"
"}")
self.pushButton.setObjectName("pushButton")
self.line = QtWidgets.QFrame(Form)
self.line.setGeometry(QtCore.QRect(-13, 510, 391, 20))
self.line.setStyleSheet("")
self.line.setFrameShape(QtWidgets.QFrame.HLine)
self.line.setFrameShadow(QtWidgets.QFrame.Sunken)
self.line.setObjectName("line")
self.line_2 = QtWidgets.QFrame(Form)
self.line_2.setGeometry(QtCore.QRect(0, 40, 351, 16))
self.line_2.setFrameShape(QtWidgets.QFrame.HLine)
self.line_2.setFrameShadow(QtWidgets.QFrame.Sunken)
self.line_2.setObjectName("line_2")
self.label_3 = QtWidgets.QLabel(Form)
self.label_3.setGeometry(QtCore.QRect(150, 80, 51, 51))
self.label_3.setStyleSheet("QLabel {font-size: 20px;}")
self.label_3.setObjectName("label_3")
self.label_4 = QtWidgets.QLabel(Form)
self.label_4.setGeometry(QtCore.QRect(130, 360, 71, 31))
self.label_4.setStyleSheet("QLabel {font-size: 20px;}")
self.label_4.setObjectName("label_4")
self.line_3 = QtWidgets.QFrame(Form)
self.line_3.setGeometry(QtCore.QRect(30, 410, 271, 20))
self.line_3.setFrameShape(QtWidgets.QFrame.HLine)
self.line_3.setFrameShadow(QtWidgets.QFrame.Sunken)
self.line_3.setObjectName("line_3")
self.label_5 = QtWidgets.QLabel(Form)
self.label_5.setGeometry(QtCore.QRect(170, 230, 151, 111))
self.label_5.setText("")
self.label_5.setPixmap(QtGui.QPixmap("img_message2.png"))
self.label_5.setObjectName("label_5")
self.label_6 = QtWidgets.QLabel(Form)
self.label_6.setGeometry(QtCore.QRect(20, 140, 141, 121))
self.label_6.setText("")
self.label_6.setPixmap(QtGui.QPixmap("img_message.png"))
self.label_6.setObjectName("label_6")
self.textBrowser = QtWidgets.QTextBrowser(Form)
self.textBrowser.setGeometry(QtCore.QRect(180, 240, 121, 61))
self.textBrowser.setStyleSheet("QTextBrowser{border: none;}")
self.textBrowser.setObjectName("textBrowser")
self.textBrowser_2 = QtWidgets.QTextBrowser(Form)
self.textBrowser_2.setGeometry(QtCore.QRect(30, 180, 121, 61))
self.textBrowser_2.setStyleSheet("QTextBrowser {border: none;}")
self.textBrowser_2.setObjectName("textBrowser_2")
self.label_7 = QtWidgets.QLabel(Form)
self.label_7.setGeometry(QtCore.QRect(10, 525, 331, 21))
self.label_7.setObjectName("label_7")
self.retranslateUi(Form)
QtCore.QMetaObject.connectSlotsByName(Form)
def retranslateUi(self, Form):
_translate = QtCore.QCoreApplication.translate
Form.setWindowTitle(_translate("Form", "CandyAssistent"))
self.label_2.setText(_translate("Form", "Candycash:"))
self.pushButton.setText(_translate("Form", "CANDY"))
self.label_3.setText(_translate("Form", "YOU"))
self.label_4.setText(_translate("Form", "CANDY"))
self.label_7.setText(_translate("Form", "Level: "))
def interface_operation(self):
global count_temp
global candycash
global message_user
global message_candy
self.pushButton.setEnabled(False)
Program_operation()
self.user_message()
Program_operation.answere_candy(self, message_user)
self.candy_message()
self.pushButton.setEnabled(True)
if "вв" and 'код разработчика' in message_user:
self.creatorCode_win()
elif 'давайте поиграем' in message_user or 'давай поиграем' in message_user and ('камень ножницы бумага' in message_user or 'камень-ножницы бумага' in message_user or 'камень ножницы-бумага' in message_user or 'камень-ножницы-бумага' in message_user):
self.pushButton.setEnabled(False)
message_user = 'да'
message_candy = 'Объясню вам правила: Вы выбираете либо камень, либо ножницы, либо бумагу. После этого делает выбор Candy. Ножницы сильнее бумаги, камень сильнее ножниц, а бумага сильнее камня.'
self.candy_message()
say(message_candy)
while ('да' in message_user or 'конечно' in message_user or 'естественно' in message_user) and 'нет' not in message_user:
message_candy = 'Делайте выбор.'
self.candy_message()
say(message_candy)
Program_operation()
self.user_message()
choice_candy = choice(['ножницы', 'камень', 'бумага'])
say("А у меня " + choice_candy + ".")
message_candy = "А у меня " + choice_candy + "."
self.candy_message()
Program_operation.game_knb_for_lvl(self, choice_candy)
self.candy_message()
self.level_print()
message_candy = 'Играем дальше?'
self.candy_message()
say(message_candy)
Program_operation()
if 'не' in message_user:
message_candy = "Было приятно с вами играть."
self.candy_message()
say(message_candy)
self.pushButton.setEnabled(True)
elif ('поиграем' in message_user or "игр" in message_user or "сыграть" in message_user or "сыграем" in message_user) and (("ор" in message_user and "реш" in message_user) or ("реш" in message_user and "ор" in message_user)):
self.pushButton.setEnabled(False)
message_candy = "Вас приветствует игра орёл и решка. Вам доступно несколько режимов:"
self.candy_message()
say(message_candy)
message_candy = "Первый: Режим новичка. За выигрыш вы получите 10 CandyCash."
self.candy_message()
say(message_candy)
message_candy = "Второй: Режим любителя. За выигрыш вы получте 100 CandyCash, а за проигрыш вы потеряете 50 CandyCash."
self.candy_message()
say(message_candy)
message_candy = "Третий: Режим опытного игрока. За выигрыш вы получите 300 CandyCash, а за проигрыш вы потеряете 150 CandyCash."
self.candy_message()
say(message_candy)
message_candy = "Четвёртый: Режим эксперта. За выигрыш вы получите 500 CandyCash, а за проигрыш вы потеряете 250 CandyCash."
self.candy_message()
say(message_candy)
say("Выбирайте.")
Program_operation()
self.user_message()
while count_temp == 0:
if "1" in message_user or "первый" in message_user or "один" in message_user or "режим новичка" in message_user or "нович" in message_user:
candycashPlus = 10
self.user_message()
count_temp = 1
elif "2" in message_user or "второй" in message_user or "два" in message_user or "режим любителя" in message_user or "любит" in message_user:
self.user_message()
candycashPlus = 100
count_temp = 1
elif "3" in message_user or "третий" in message_user or "три" in message_user or "режим опытного" in message_user or "опыт" in message_user:
candycashPlus = 300
count_temp = 1
self.user_message()
elif "4" in message_user or "четвёртый" in message_user or "четыре" in message_user or "режим эксперта" in message_user or "экс" in message_user:
candycashPlus = 500
count_temp = 1
self.user_message()
else:
message_candy = "Такого режима ещё нет, если вы передумали играть то скажите прекратить игру. Для продолжения называйте режим."
say(message_candy)
self.candy_message()
Program_operation()
self.user_message()
if 'прекр' in message_user and "иг" in message_user:
count_temp = 2
self.pushButton.setEnabled(True)
Interface1()
if count_temp != 2:
message_candy = "Объясню вам правила: У вас есть выбор между орлом и решкой. После этого Candy бросает монетку. Если ваш ответ совпал со стороной монетки то вы получите CandyCash, иначе вы его потеряете."
self.candy_message()
say(message_candy)
if candycash >= (candycashPlus / 2) or candycashPlus == 10:
message_user = 'да'
while ('да' in message_user or 'конечно' in message_user or 'естественно' in message_user) and 'нет' not in message_user:
message_candy = 'Орёл или решка?'
self.candy_message()
say(message_candy)
Program_operation()
self.user_message()
if "ор" in message_user or "реш" in message_user:
self.user_message()
choice_candy = choice(['орёл', 'решка'])
if choice_candy == "орёл":
message_candy = "Выпал орёл."
else:
message_candy = "Выпала решка."
self.candy_message()
say(message_candy)
Program_operation.game_orel_and_reshka_for_cc(self, candycashPlus, choice_candy)
self.candy_message()
self.candycash_print()
message_candy = 'Играем дальше?'
self.candy_message()
say(message_candy)
Program_operation()
self.user_message()
if ('да' in message_user or 'конечно' in message_user or 'естественно' in message_user) and 'нет' not in message_user:
message_user = "да"
else:
message_candy = "Было приятно с вами играть."
self.candy_message()
say(message_candy)
self.pushButton.setEnabled(True)
else:
message_user = "да"
else:
message_candy = "Что бы начать игру вам не хватает CandyCash. Вы можете купить его у разработчика (2 CandyCash = 1 рубль) в директе () или во Вконтакте (). Ну или просто сыграть в режим новичка."
self.candy_message()
say(message_candy)
self.pushButton.setEnabled(True)
def creatorCode_win(self):
global candycash
global message_user
global creator
global level
text, ok = QInputDialog.getText(self, 'CreatorCode', 'Введите код разработчика: ')
if ok:
if text == 'Q5du7cc4opEQ1189':
candycash = 999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999
level = 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999
say('Код верный!')
creator = True
self.candycash_print()
self.level_print()
else:
say('Код неверный!')
def candycash_print(self):
global candycash
self.label_2.setText("CandyCash: " + str(candycash))
def level_print(self):
global level
self.label_7.setText("CandyLevel: " + str(level))
def candy_message(self):
global message_candy
self.textBrowser.setText(message_candy)
def user_message(self):
global message_user
txt = message_user[0].upper() + message_user[1:]
self.textBrowser_2.setText(txt)
def closeEvent(self, e):
self.saveSettings()
e.accept()
def loadSettings(self):
if self.settings.contains('geometry'):
self.setGeometry(self.settings.value('geometry'))
def saveSettings(self):
global candycash
global level
global interface
con = sqlite3.connect('CandyBase.db')
cur = con.cursor()
sql = "DELETE FROM database"
cur.execute(sql)
info_database = [str(candycash), str(level), str(interface)]
cur.execute('INSERT INTO database VALUES(?, ?, ?)', info_database)
con.commit()
class Program_operation(Interface1):
def __init__(self):
super().__init__()
self.commands_user()
def game_orel_and_reshka_for_cc(self, candycashPlus, choice_candy):
global candycash
global message_user
global message_candy
if ('ор' in message_user and choice_candy == 'орёл' and "решк" not in message_user) or ('решк' in message_user and choice_candy == 'решка' and "ор" not in message_user):
message_candy = 'Вы выиграли и получили' + str(candycashPlus) + 'CandyCash.'
candycash += int(candycashPlus)
elif ('ор' in message_user and choice_candy != 'орёл' and 'решк' not in message_user) or ('решк' in message_user and choice_candy != 'решка' and "ор" not in message_user):
if candycashPlus == 10:
message_candy = "Вы проиграли."
else:
message_candy = "Вы проиграли и потеряли " + str(int((candycashPlus / 2))) + " CandyCash."
candycash -= int((candycashPlus / 2))
say(message_candy)
def game_knb_for_lvl(self, choice_candy):
global level
global message_user
global message_candy
if ('ножницы' in message_user and choice_candy == 'камень') or ('камень' in message_user and choice_candy == 'бумага') or ('бумага' in message_user and choice_candy == 'ножницы'):
message_candy = 'Вы проиграли и ваш уровень уменьшен на 1.'
if level != 1:
level -= 1
elif ('ножницы' in message_user and choice_candy == 'бумага') or ('камень' in message_user and choice_candy == 'ножницы') or ('бумага' in message_user and choice_candy == 'камень'):
message_candy = 'Вы выиграли и ваш уровень увеличен на 1.'
level += 1
elif ('ножницы' in message_candy and choice_candy == 'ножницы') or ('камень' in message_user and choice_candy == 'камень') or ('бумага' in message_user and choice_candy == 'бумага'):
message_candy = 'Ничья.'
say(message_candy)
def answere_candy(self, message):
global message_user
global game
global isaccount
global message_candy
if 'привет' in message_user or 'здравствйте' in message_user or 'прив' in message_user or 'салам' in message_user:
if "ор" not in message_user and "реш" not in message_user:
message_candy = 'Привет!'
say(message_candy)
elif 'как дел' in message_user:
message_candy = "У меня замечательно, ведь я общаюсь с вами. А как у вас?"
say(message_candy)
elif 'да' in message_user:
message_candy = 'Я с вами полностью согласна!'
say(message_candy)
elif 'любимый цвет' in message_user:
message_candy = 'Мой любимый цвет красный. А какой у вас?'
say(message_candy)
elif 'нет' in message_user:
message_candy = 'Как так-то?'
say(message_candy)
elif 'погод' in message_user and ('какая' in message_user or "что по" in message_user):
message_candy = 'Вы можете подойти к окну и посмотреть.'
say(message_candy)
elif "врем" in message_user:
now = datetime.datetime.now()
message_candy = "Сейчас " + str(now.hour) + " часов " + str(now.minute) + " минут. "
say(message_candy)
elif "кого ты слушаешь" in message_user or "твой любымый исполнитель" in message_user:
message_candy = choice(['ДЭМ', 'FACE', 'MORGENSHTERN', 'Gone.Fludd', 'Big Babe Tape', 'YukiHaze', 'Молодой Шерра', 'Iroh', '2Pac', 'Maryana Ro', 'Yanix', 'Lil Pump', 'Алёна Швец', 'Lizer', 'ЛСП', "Джарахов", "Oxxxymiron", "Монеточка", "Imagine Dragons", "Johnyboy", 'Cakeboy', 'Flipper Floyd', 'Markul'])
say(message_candy)
elif "анекд" in message_user or "шутк" in message_user or "шуток" in message_user or "шутеек" in message_user:
message_candy = "На экзамене: \n – Профессор, не подскажете, который час? \n – Учить надо было! \n Ха-Ха-Ха"
say(message_candy)
elif "спой" in message_user or "спеть" in message_user:
message_candy = "Как сердце бьется он её заметит \n И похрюкивали чтобы ненасытные утробы \n Сниму очки: мне солнце светит. \n Бабочка хотела на вершину небоскрёба."
say(message_candy)
elif "откр" in message_user and ("ютуб" in message_user or "youtube" in message_user):
message_candy = "Открываю."
say(message_candy)
url = "https://www.youtube.com/"
webbrowser.open(url)
elif "откр" in message_user and ("вк" in message_user or "vk" in message_user or "вконтакте" in message_user):
message_candy = "Открываю."
say(message_candy)
url = "https://www.vk.com"
webbrowser.open(url)
elif "откр" in message_user and ("фейсбук" in message_user or "facebook" in message_user):
message_candy = "Открываю."
say(message_candy)
url = "https://www.facebook.com/"
webbrowser.open(url)
elif "откр" in message_user and ("инстаграм" in message_user or "instagram" in message_user):
message_candy = "Открываю."
say(message_candy)
url = "https://www.instagram.com/"
webbrowser.open(url)
elif "откр" in message_user and ("твиттер" in message_user or "twitter" in message_user):
message_candy = "Открываю."
say(message_candy)
url = "https://twitter.com/"
webbrowser.open(url)
elif "откр" in message_user and ("твитч" in message_user or "twitch" in message_user):
message_candy = "Открываю."
say(message_candy)
url = "https://www.twitch.tv/"
webbrowser.open(url)
elif "откр" in message_user and ("ок" in message_user or "одноклассники" in message_user):
message_candy = "Открываю."
say(message_candy)
url = "https://www.ok.ru"
webbrowser.open(url)
elif "откр" in message_user and ("я музыку" in message_user or "яндекс музыку" in message_user):
message_candy = "Открываю."
say(message_candy)
url = "https://music.yandex.ru/"
webbrowser.open(url)
elif "дата" in message_user or "сегодня день" in message_user or "сегодня число" in message_user:
now = datetime.datetime.now()
if now.month != (10, 11, 12):
month = str(0) + str(now.month)
message_candy = "Сегодня " + str(now.day) + " " + str(month) + "."
say(message_candy)
elif 'меня зовут' in message_user or "моё имя" in message_user:
message_candy = "Я - Candy. Очень приятно."
say(message_candy)
elif 'хорошо' == message_user:
message_candy = 'И это хорошо'
say(message_candy)
elif 'плохо' == message_user:
message_candy = 'Очень жаль.'
say(message_candy)
elif ('откр' in message_user and 'candy market' in message_user) or 'открыть candy market' in message_user or 'открыть кэнди market' in message_user or 'открыть кенди market' in message_user or 'открыть кэнди маркет' in message_user or 'открыть кенди маркет' in message_user or 'открой candy маркет' in message_user or 'открой candy market' in message_user or 'открой кэнди market' in message_user or 'открой кенди market' in message_user or 'открой кэнди маркет' in message_user or 'открой кенди маркет' in message_user or 'открой candy маркет' in message_user:
message_candy = 'Уже открываю'
say(message_candy)
self.close()
self.candymarket_win = CandyMarket()
self.candymarket_win.show()
elif 'код разработчика' in message_user or 'разработчика код' in message_user and 'ввести' in message_user:
message_candy = 'Вводите:'
say(message_candy)
elif "ввести" in message_user and "промкод" in message_user:
message_candy = "Вводите:"
say(message_candy)
elif 'candycash' in message_user or 'кенди кэш' in message_user or 'кэнди кэш' in message_user or 'кенди кеш' in message_user \
or 'кэнди кеш' in message_user:
message_candy = str(candycash)
elif 'пока' in message_user:
message_candy = 'Пока'
say(message_candy)
sys.exit()
else:
message_candy = "Разработчик этого приложения не научил меня этому. Но вы можете сделать меня лучше и написать ему в директе (creator_candy_company) или во ВКонтакте (id: 310067042)"
say(message_candy)
def commands_user(self):
global message_user
r = sr.Recognizer()
with sr.Microphone() as source:
r.pause_threshold = 1
say('Я вас слушаю...')
r.adjust_for_ambient_noise(source, duration=2)
audio = r.listen(source)
try:
message_user = r.recognize_google(audio, language="ru-RU").lower()
except sr.UnknownValueError:
say("Я вас не поняла")
self.commands_user()
def ProgramOperation():
data_base()
global candycash
global level
global interface
info_database = [0, 1, 1]
con = sqlite3.connect('CandyBase.db')
cur = con.cursor()
cur.execute('SELECT [CandyCash], [CandyLevel], [Interface] FROM [database] LIMIT 500')
temp = cur.fetchall()
for i in temp:
candycash = int(i[0])
level = int(i[1])
interface = int(i[2])
con.commit()
if interface == 1:
app = QtWidgets.QApplication([])
application = Interface1()
application.show()
sys.exit(app.exec())
elif interface == 2:
app = QtWidgets.QApplication([])
application = Interface2()
application.show()
sys.exit(app.exec())
else:
con = sqlite3.connect('CandyBase.db')
cur = con.cursor()
cur.execute('INSERT INTO database VALUES(?, ?, ?)', info_database)
con.commit()
PO = ProgramOperation()