def __start__(): try: import autopy except ImportError: print print red+"[-] Not found 'autopy' library" print green+" pip install autopy"+end print exit() print print green+"[+] Please enter time(secound) take screenshot" print " e.x: 5"+end print try: rtime = int(raw_input(brown+"screenshot > time >>> "+end)) except ValueError: print print red+"[-] Please enter integer"+end print exit() time.sleep(rtime) timer = time.today() image = autopy.bitmap.capture_screen() name = "screenshot_",timer image.save(name) print print green+"[+] Saved to: ",name,end print
def run(self): write_log("Chat running") while not self.isstopped(): c = self.window_manager.getch() if c == ord('q'): self.window_manager.stop() if c == 10: write_log("send to log: " + str(("Joe",time.today(),self.chat_msg))) self.window_manager.send_to_log(("Joe",time.today(),self.chat_msg)) else: try: self.msg += chr(c) except: pass self.draw() write_log("Chat done")
def store_edge_values_in_database(max_temp, min_temp, max_hum, min_hum, max_wind): yesterday = time.today() - timedelta(days=1) day = yesterday.strftime("%d%m%y") query_string = f"INSERT INTO EdgeRegister(Max_Wind, Max_Wind_Time, Max_Temp, Max_Temp_Time, Min_Temp, " \ f"Min_Temp_Time, Max_Hum, Max_Hum_Time, Min_Hum, Min_Hum_Time, Day) VALUES({max_wind.value}, " \ f"{max_wind.timestamp}, {max_temp.value}, {max_temp.timestamp}, {min_temp.value}, " \ f"{min_temp.timestamp}, {max_hum.value}, {max_hum.timestamp}, {min_hum.value}, {min_hum.timestamp}, {day})" execute_query(query_string)
def make_config_dict(self): config_dict = {} config_dict["date"] = time.today() config_dict["seed"] = self.seed config_dict["sim_times"] = self.sim_times config_dict["anti_time"] = self.anti_time config_dict["anti_type"] = self.anti_type config_dict["neigh_limit"] = self.neigh_limit config_dict["nt_cutoff"] = self.nt_cutoff return config_dict
def requete(): #requete pour sur l'api d'ATMO v = time.today() today = date(v.year, v.month, v.day) # recuperation de la date du jour format Y-M-D # dictionnaire contenant les parametres de la requete payload = { "where": "code_zone = '59350' AND date_ech >= TIMESTAMP '{}'".format(today), "outFields": "date_ech,valeur,qualif,couleur", "outSR": "4326", "f": "json" } param = urllib.parse.urlencode(payload, safe='=' + ',', quote_via=urllib.parse.quote ) # encodage du dictionnaire des parametres r = requests.get( 'https://services8.arcgis.com/rxZzohbySMKHTNcy/arcgis/rest/services/ind_hdf_agglo/FeatureServer/0/query', params=param) # requete data1 = r.json() return releve(r) # appel de la fonction releve