def __init__(self, web_root=None): self.src_tmp = '/tmp/temp_web_server' self.python_path = 'python3' if web_root: self.web_root = web_root else: self.web_root = self.src_tmp + '/html' self.html_file = Files.path_combine(self.web_root, 'index.html') self.port = Misc.random_number(10000, 60000) self.server_proc = None
def make_random_points(size=None, max=None): if size is None: size = 20 if max is None: max = 100 return [Misc.random_number(0, max) for _ in range(0, size)]