Best Python code snippet using toolium_python
config.py
Source:config.py
...31bg_start = 'rgb(252,233,79)'32def load():33 if not config.has_section(section):34 config.add_section(section)35 if not config.has_option(section, 'language_surface'):36 config.set(section, 'language_surface', '< System >')37 if not config.has_option(section, 'language_scrabble'):38 loc, enc = locale.getdefaultlocale()39 ln = loc[0:2]40 config.set(section, 'language_scrabble', DICT_LANGUAGES_NAME[ln])41 if not config.has_option(section, 'saved'):42 config.set(section, 'saved', 0)43 if not config.has_option(section, 'points_player'):44 config.set(section, 'points_player', 0)45 if not config.has_option(section, 'points_computer'):46 config.set(section, 'points_computer', 0)47 if not config.has_option(section, 'grade'):48 config.set(section, 'grade', 2)49 if not config.has_option(section, 'count_pieces'):50 config.set(section, 'count_pieces', 0)51 if not config.has_option(section, 'point_words'):52 config.set(section, 'point_words', 0)53 if not config.has_option(section, 'autohide_letters'):54 config.set(section, 'autohide_letters', 0)55 if not config.has_option(section, 'autohide_info'):56 config.set(section, 'autohide_info', 0)57 #-----------------------------------------------------58 if not config.has_option(section, 'font_pieces'):59 config.set(section, 'font_pieces', 'Sans 11')60 if not config.has_option(section, 'font_special'):61 config.set(section, 'font_special', 'Sans 15')62 if not config.has_option(section, 'font_msg'):63 config.set(section, 'font_msg', 'Sans 25')64 if not config.has_option(section, 'font_win'):65 config.set(section, 'font_win', 'Sans 15')66 #-----------------------------------------------------67 if not config.has_option(section, 'bg_hX2'):68 config.set(section, 'bg_hX2', bg_hX2)69 if not config.has_option(section, 'bg_hX3'):70 config.set(section, 'bg_hX3', bg_hX3)71 if not config.has_option(section, 'bg_kX2'):72 config.set(section, 'bg_kX2', bg_kX2)73 if not config.has_option(section, 'bg_kX3'):74 config.set(section, 'bg_kX3', bg_kX3)75 if not config.has_option(section, 'bg_start'):76 config.set(section, 'bg_start', bg_start)77 if not config.has_option(section, 'fg_pieces'):78 config.set(section, 'fg_pieces', fg_pieces)79 if not config.has_option(section, 'fg_nbr'):80 config.set(section, 'fg_nbr', fg_nbr)81 if not config.has_option(section, 'fg_cell'):82 config.set(section, 'fg_cell', fg_cell)83 if not config.has_option(section, 'bg_pieces'):84 config.set(section, 'bg_pieces', bg_pieces)85 if not config.has_option(section, 'bg_no_install'):86 config.set(section, 'bg_no_install', bg_no_install)87 if not config.has_option(section, 'bg_last_word'):88 config.set(section, 'bg_last_word', bg_last_word)89 if not config.has_option(section, 'br_pieces'):90 config.set(section, 'br_pieces', br_pieces)91 if not config.has_option(section, 'bg_area'):92 config.set(section, 'bg_area', bg_area)93 if not config.has_option(section, 'bg_grid'):94 config.set(section, 'bg_grid', bg_grid)95 if not config.has_option(section, 'br_grid'):96 config.set(section, 'br_grid', br_grid)97 if not config.has_option(section, 'bg_lines'):98 config.set(section, 'bg_lines', bg_lines)99 if not config.has_option(section, 'fg_msg'):100 config.set(section, 'fg_msg', fg_msg)101 if not config.has_option(section, 'br_thick'):102 config.set(section, 'br_thick', 1)103 #-----------------------------------------------------104 if not config.has_option(section, 'sound'):105 config.set(section, 'sound', 1)106 if not config.has_option(section, 'pipe_drop'):107 config.set(section, 'pipe_drop', 9000)108 if not config.has_option(section, 'pipe_ok'):109 config.set(section, 'pipe_ok', 5000)110 if not config.has_option(section, 'pipe_undo'):111 config.set(section, 'pipe_undo', 1300)112 if not config.has_option(section, 'pipe_add'):113 config.set(section, 'pipe_add', 9000) 114 if not config.has_option(section, 'pipe_drop_ms'):115 config.set(section, 'pipe_drop_ms', 20)116 if not config.has_option(section, 'pipe_ok_ms'):117 config.set(section, 'pipe_ok_ms', 20)118 if not config.has_option(section, 'pipe_undo_ms'):119 config.set(section, 'pipe_undo_ms', 20)120 if not config.has_option(section, 'pipe_add_ms'):121 config.set(section, 'pipe_add_ms', 20)122 with open(myfile, 'w') as configfile:123 config.write(configfile)124def setv(option, value):125 config.set(section, option, value)126 with open(myfile, 'w') as configfile:127 config.write(configfile)128 129def getv(option):130 value = config.get(section, option)131 return value132def getn(option):133 value = config.getint(section, option)134 return value...
app.py
Source:app.py
...18 return19 20 url = url + f'postcode={postcode}&radius={radius}&make={make}&model={model}&'21 22 if config.has_option('DETAILS', 'trim') : url += f"trim={config.get('DETAILS', 'aggregatedTrim')}&"23 if config.has_option('DETAILS', 'min-price') : url += f"price-from={config.get('DETAILS', 'min-price')}&"24 if config.has_option('DETAILS', 'max-price') : url += f"price-to={config.get('DETAILS', 'max-price')}&"25 if config.has_option('DETAILS', 'min-year') : url += f"year-from={config.get('DETAILS', 'min-year')}&"26 if config.has_option('DETAILS', 'max-year') : url += f"year-to={config.get('DETAILS', 'max-year')}&"27 if config.has_option('DETAILS', 'max-milaege') : url += f"max-mileage={config.get('DETAILS', 'max-mileage')}&"28 if config.has_option('DETAILS', 'transmission') : url += "transmission={config.get('DETAILS', 'transmission')}&"29 if config.has_option('DETAILS', 'fuel-type') : url += f"fuel-type={config.get('DETAILS', 'fuel-type')}&"30 if config.has_option('DETAILS', 'minimum-engine-size') : url += f"minimum-badge-engine-size={config.get('DETAILS', 'minimum-engine-size')}&"31 if config.has_option('DETAILS', 'maximum-engine-size') : url += f"maximum-badge-engine-size={config.get('DETAILS', 'maximum-engine-size')}&"32 if config.has_option('DETAILS', 'min-engine-power') : url += f"min-engine-power={config.get('DETAILS', 'min-engine-power')}&"33 if config.has_option('DETAILS', 'max-engine-power') : url += f"max-engine-power={config.get('DETAILS', 'max-engine-power')}&"34 if config.has_option('DETAILS', 'seller-type') : url += f"seller-type={config.get('DETAILS', 'seller-type')}&"35 if config.has_option('DETAILS', 'colour') : url += f"colour={config.get('DETAILS', 'colour')}&"36 if config.has_option('DETAILS', 'exclude-writeoff-categories') : url+= f"exclude-writeoff-categories={config.get('DETAILS', 'exclude-writeoff-categories')}&"37 if url.endswith('&') : url = url[:-1]38 39 print(url)40 41if os.path.isfile(f'{os.getcwd()}/config.ini') != True:42 print('[i] Please follow the readme.')43else:...
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!!