Best Python code snippet using autotest_python
main.py
Source: main.py
...186 if not game.pause:187 if game.menu:188 if menu.b1_1_rect.collidepoint(event.pos):189 game.player1 = Perso1(game,0,game.is_bot_1)190 game.player1.finish_init(game.player2)191 game.player2.finish_init(game.player1)192 elif menu.b2_1_rect.collidepoint(event.pos):193 game.player1 = Perso2(game,0,game.is_bot_1)194 game.player1.finish_init(game.player2)195 game.player2.finish_init(game.player1)196 elif menu.b3_1_rect.collidepoint(event.pos):197 game.player1 = Perso3(game,0,game.is_bot_1)198 game.player1.finish_init(game.player2)199 game.player2.finish_init(game.player1)200 elif menu.b4_1_rect.collidepoint(event.pos):201 game.player1 = Perso4(game,0,game.is_bot_1)202 game.player1.finish_init(game.player2)203 game.player2.finish_init(game.player1)204 elif menu.b1_2_rect.collidepoint(event.pos):205 game.player2 = Perso1(game,1,game.is_bot_2)206 game.player1.finish_init(game.player2)207 game.player2.finish_init(game.player1)208 elif menu.b2_2_rect.collidepoint(event.pos):209 game.player2 = Perso2(game,1,game.is_bot_2)210 game.player1.finish_init(game.player2)211 game.player2.finish_init(game.player1)212 elif menu.b3_2_rect.collidepoint(event.pos):213 game.player2 = Perso3(game,1,game.is_bot_2)214 game.player1.finish_init(game.player2)215 game.player2.finish_init(game.player1)216 elif menu.b4_2_rect.collidepoint(event.pos):217 game.player2 = Perso4(game,1,game.is_bot_2)218 game.player1.finish_init(game.player2)219 game.player2.finish_init(game.player1)220 elif menu.b_choix_rect.collidepoint(event.pos):221 game.is_bot_1 = True222 game.player1.bot = True223 elif menu.b_choix_2_rect.collidepoint(event.pos):224 game.is_bot_2 = True225 game.player2.bot = True226 elif menu.j_choix_rect.collidepoint(event.pos):227 game.is_bot_1 = False228 game.player1.bot = False229 elif menu.j_choix_2_rect.collidepoint(event.pos):230 game.is_bot_2 = False231 game.player2.bot = False232 if menu.attack_button_1.collidepoint(event.pos):233 if menu.choice_attack_1:...
logfile_loader.py
Source: logfile_loader.py
...69 self.load_projector_file(f)70 # 设置åå§åå®ææ å¿71 self.finish_init = 172 @property73 def finish_init(self):74 return self._finish_init75 # 设置æ å¿76 @finish_init.setter77 def finish_init(self, is_finish):78 self.r.set("{}_{}_{}_is_finish".format(self.uid, self.runname,79 self.filename.name), 1)80 print(self.name + " is finish")81 self._finish_init = is_finish82 def set_redis_key(self, type, tag, file_path):83 _key = self.uid + '_' + self.runname + '_' + type + '_' + tag84 if _key in self.redis_tag:85 pass86 else:87 self.r.set(_key, str(file_path))88 self.redis_tag.append(_key)89 def set_cache(self, file_name, data):90 if not file_name.parent.exists():91 file_name.parent.mkdir(parents=True, exist_ok=True)...
InitWindow.py
Source: InitWindow.py
1from .ui.Ui_init_widget import Ui_init_widget2from PyQt5.QtWidgets import QWidget3from PyQt5.QtCore import pyqtSignal4class InitWindow(QWidget, Ui_init_widget):5 finish_init = pyqtSignal(tuple, name='finish_init')6 def __init__(self, *args, **kwargs):7 super().__init__(*args, **kwargs)8 self.init_ui()9 self.init_signals()10 def init_ui(self):11 self.setupUi(self)12 def init_signals(self):13 self.start_button.clicked.connect(self.on_start_click)14 self.client_name.textChanged.connect(self.check_input)15 self.server_button.toggled.connect(self.check_server)16 self.server_ip.textChanged.connect(self.check_input)17 def on_start_click(self):18 connection_type = self.server_button.isChecked()19 ip = self.server_ip.text()20 self.finish_init.emit((ip, connection_type))21 def check_input(self):22 if self.client_name.text() and self.server_ip.text():23 self.start_button.setEnabled(True)24 else:25 self.start_button.setDisabled(True)26 def check_server(self):27 if self.server_button.isChecked():28 self.server_ip.setText('127.0.0.1')29 self.server_ip.setDisabled(True)30 if self.client_name.text():31 self.start_button.setEnabled(True)32 else:33 self.server_ip.setText('')34 self.server_ip.setEnabled(True)...
Check out the latest blogs from LambdaTest on this topic:
Before we discuss Scala testing, let us understand the fundamentals of Scala and how this programming language is a preferred choice for your development requirements.The popularity and usage of Scala are rapidly rising, evident by the ever-increasing open positions for Scala developers.
So, now that the first installment of this two fold article has been published (hence you might have an idea of what Agile Testing is not in my opinion), I’ve started feeling the pressure to explain what Agile Testing actually means to me.
Did you know that according to Statista, the number of smartphone users will reach 18.22 billion by 2025? Let’s face it, digital transformation is skyrocketing and will continue to do so. This swamps the mobile app development market with various options and gives rise to the need for the best mobile app testing tools
As a developer, checking the cross browser compatibility of your CSS properties is of utmost importance when building your website. I have often found myself excited to use a CSS feature only to discover that it’s still not supported on all browsers. Even if it is supported, the feature might be experimental and not work consistently across all browsers. Ask any front-end developer about using a CSS feature whose support is still in the experimental phase in most prominent web browsers. ????
The count of mobile users is on a steep rise. According to the research, by 2025, it is expected to reach 7.49 billion users worldwide. 70% of all US digital media time comes from mobile apps, and to your surprise, the average smartphone owner uses ten apps per day and 30 apps each month.
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!