def tableExists(connection, tablename): try: if not tableIsEmpty(connection, tablename): return True except pymysql.ProgrammingError as e: return False