我需要使用Python和Django使用.sh脚本回显消息。我在下面解释我的代码。如何使用.sh脚本使用Python和Django回显消息
def plantsave(request):
""" This function to save the reactor data . """
if request.method == 'POST':
rname = request.POST.get('react')#Reactor1 ,Reactor2,Reactor3
if 'strt' in request.POST:
status = 1#Running
if 'shutbt' in request.POST:
status = 0#Stop
if 'susbtn' in request.POST:
status = 2#Suspend
在这里,我要呼应消息像Reactor1 is running if the status=1 and Reactor2 is stop if status=0
这样使用.sh script
。
评论在python是通过'#'完成签署不''//我 –
不明白的.sh你正在谈论的脚本。这是一个Python文件,而不是一个shell脚本。 –