def __init__(self, parent=None): super(Window, self).__init__(parent) self.lis = rules.start() self.setupUi(self) self.workerthread = WorkerThread() self.workerthread.sig1.connect(self.play_move) self.workerthread.sig2.connect(self.find_move) self.pushButton.clicked.connect(self.but_pushed) self.pushButton_4.clicked.connect(self.but4_pushed)
def start_new_session(request): try: player = Player.objects.get(pk=request.user.id) except Player.DoesNotExist: player = None session = None if player is not None: session = start(player) return session
MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow")) self.pushButton.setText(_translate("MainWindow", "Done")) self.pushButton_3.setText(_translate("MainWindow", "Detectives")) self.pushButton_4.setText(_translate("MainWindow", "Start Game")) self.label.setText(_translate("MainWindow", "TextLabel")) self.menuFile.setTitle(_translate("MainWindow", "File")) self.menuHelp.setTitle(_translate("MainWindow", "Help")) self.menuGame_Mode.setTitle(_translate("MainWindow", "Game Mode")) self.actionNew_Game.setText(_translate("MainWindow", "New Game")) self.actionExit.setText(_translate("MainWindow", "Exit")) self.actionRules.setText(_translate("MainWindow", "Rules")) self.actionAbout.setText(_translate("MainWindow", "About")) self.actionPlayer_v_Player.setText(_translate("MainWindow", "Player v Player")) self.actionPlayer_v_Computer.setText(_translate("MainWindow", "Player v Computer")) lis = rules.start() lis1 = pickle.dumps(lis) def play_move(): pixmapItem2.setOffset(int(lis[1][1]), int(lis[1][2]) - 50) pixmapItem3.setOffset(int(lis[2][1]), int(lis[2][2]) - 50) pixmapItem4.setOffset(int(lis[3][1]), int(lis[3][2]) - 50) pixmapItem5.setOffset(int(lis[4][1]), int(lis[4][2]) - 50) pixmapItem6.setOffset(int(lis[5][1]), int(lis[5][2]) - 50) ui.comboBox.clear() def but_pushed(): ui.label.setText("Move is played") def det_moves(pos_trans, num):
import rules print(rules.conv(123)) print(rules.start())