def main(): constants.init() # ui.draw_start_screen() # ui.draw_char_select_screen() game_loop() pygame.quit() quit()
def main(): import time start_time = time.clock() constants.init() plates = Plates() plates.show_map() print time.clock() - start_time, "seconds" plates.populate_temperature() #plates.normalize_temperatures() #might not be needed now plates.populate_wind() plates.show_tempature_map() print time.clock() - start_time, "seconds"
def load_config(flask_app): try: # Read config file config_file = open(constants.CONFIG_FILENAME) config_file_contents = config_file.read() # Initialize config via file config = json.loads(config_file_contents) constants.init(config) flask_app.secret_key = config["secret_key"] except: return
def set_sampling_freq(frequency): global SAMPLING_FREQ SAMPLING_FREQ = frequency constants.init()
def set_ADCGain(gain): global ADCGain ADCGain = gain constants.init()
from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC import constants import time chromedriver_path = 'C:\\Users\\Utkarsh\\Downloads\\chromedriver_win32' webdriver = webdriver.Chrome() constants.init() webdriver.get('https://www.linkedin.com/') signin = webdriver.find_element_by_xpath('/html/body/nav/a[3]') signin.click() username = WebDriverWait(webdriver, 3).until( EC.presence_of_element_located((By.ID, 'username'))) password = WebDriverWait(webdriver, 3).until( EC.presence_of_element_located((By.ID, 'password'))) username.send_keys(constants.USERNAME) password.send_keys(constants.PASSWORD) signin = WebDriverWait(webdriver, 3).until( EC.presence_of_element_located( (By.XPATH, '//*[@id="app__container"]/main/div/form/div[3]/button'))) signin.click()
for number in score_on_screen: number_image = number_image_list[number] number_rect = number_image.get_rect() number_width = number_rect[0] number_height = number_rect[1] gameDisplay.blit( number_image, [left_x, 0.1 * c.screen_height, number_width, number_height]) left_x += 24 # Draw bird gameDisplay.blit(rotated_bird, [c.bird_x, c.bird_y, c.bird_width, c.bird_height]) else: c.init() c.choose_pipe_colour() if c.pipe_colour_green: c.top_pipe_path = os.path.join("data", "sprites", "pipes", "top_pipe.png") c.bottom_pipe_path = os.path.join("data", "sprites", "pipes", "bottom_pipe.png") else: c.top_pipe_path = os.path.join("data", "sprites", "pipes", "top_pipe_red.png") c.bottom_pipe_path = os.path.join("data", "sprites", "pipes", "bottom_pipe_red.png") top_pipe_image = pygame.image.load(c.top_pipe_path).convert_alpha() bottom_pipe_image = pygame.image.load(
def main(): # calling menu function constants.init() schedule.init() menu.createMenu(constants.API, constants.ICON_NAME, constants.SCHEDULE_SCRIPT)
def init(webdriver): constants.init() Conta.login(webdriver)
const.scenarios['scenarios'][const.chosen_scenario]['berufsgattung'] ['Detailhandelsberufe']['number'] } assignment.append(record) # Cast dictionary to dataframe, no matter if the result is infeasible or optimal # Sorted on Lehrgang first, Gemeinde second print('') print('Writing CSV file') assignment_df = pd.DataFrame.from_records(assignment) assignment_df.set_index(['scenario'], inplace=True) output_name = 'output_{}_{}'.format('scenario', const.chosen_scenario) helper.write_to_csv(assignment_df, output_name) if __name__ == '__main__': # Initialize the current time time_0 = time.time() # Set the constants based on the defined config file (passed argument) and retrieve the argument dictionaries scenario_passed_as_argument = sys.argv[1] configfile_path = const.init(scenario_passed_as_argument) # Run the main function main() # Show the time needed to run the function print('') print('Whole process finished.') print('The process took {0:.2f} seconds.'.format(time.time() - time_0))
def set_temporal_scale(scale): global TSCALE TSCALE = scale constants.init()
def init(webdriver): constants.init() login(webdriver)
def set_amplitude_scale(scale): global ASCALE ASCALE = scale constants.init()
def get_mydb(): if DBManipulador.DBNAME == '': constants.init() db = DBManipulador() mydb = db.connect() return mydb