我需要使用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腳本。 –