提示
以下内容的目的,只是为了学习合法的知识
shsupervisor:要安装的软件的名称。 supervisord:装好supervisor软件后,supervisord用于启动supervisor服务。 supervisorctl:用于管理supervisor配置文件中program。
使用yum命令安装 切换为root用户
shyum install epel-release # 如果已安装EPEL源,请跳过
yum install -y supervisor
systemctl enable supervisord # 开机自启动
systemctl start supervisord # 启动supervisord服务
systemctl status supervisord # 查看supervisord服务状态
ps -ef|grep supervisord # 查看是否存在supervisord进程
相关信息
广度优先搜索学习
以下代码段摘录自算法图解中,可以很好的理解广度优先算法
python
def search(name):
search_queue = deque() # 创建队列用于 BFS
search_queue += graph[name] # 将起点的邻居加入队列
searched = [] # 用于记录已检查过的人
while search_queue: # 当队列不为空时循环
person = search_queue.popleft() # 从队列左侧取出下一个人
if person not in searched: # 只检查未检查过的人
if person_is_seller(person): # 如果这个人是芒果卖家
print(person + " is a mango seller!")
return True # 找到后返回 True
else:
search_queue += graph[person] # 将此人的邻居加入队列
searched.append(person) # 标记为已检查
return False # 队列为空仍未找到,返回 False