level=logging.DEBUG, format='%(message)s', filemode='w') # Defines a main function, thas writes the file and sendd the email def main(): write_file() send_email() # Creates a event to stop the Timer stop = Event() # Creates a Timer that invokes the main() every 30 minutes timer = Timer.PerpetualTimer(func=main, time=30, time_unit="mins", stop_event=stop) # Starts the timer timer.start() def encode(string): ''' Encodes a strings using the Base64 algorithm Args: string STRING: string to be encoded Returns: A encoded string. Example: 'man' -> 'Tfuw' '''