html语言确认框,如何在单击botton、Python/html脚本时添加确认框

当我在下面的python/html脚本中单击注销或重新启动按钮时,需要添加一个确认框。这个脚本只是一个大的总结和它的工作很好我。任何人建议一下?在

提前谢谢。在#!/usr/bin/python

import cherrypy

import os.path

import struct

from auth import AuthController, require, member_of, name_is

import subprocess

import commands

class Server(object):

led_logout=0

led_restart=0

_cp_config = {

'tools.sessions.on': True,

'tools.auth.on': True

}

auth = AuthController()

@cherrypy.expose

@require()

def index(self,logout='', restart=''):

html = """

{htmlText}

Logout.pngRestart.png

"""

myText = ''

myText = "Hello"

if logout:

self.led_logout = int(logout)

if self.led_logout:

print "Logout !!!!!"

AuthController().logout('/?logout=0')

if restart:

self.led_restart = int(restart)

#subprocess.call(['sudo shutdown -r now'], shell=True)

myText = "The system is restarting"

return html.format(htmlText=myText)

index.exposed = True

#configuration

conf = {

'global' : {

'server.socket_host': '0.0.0.0', #0.0.0.0 or specific IP

'server.socket_port': 8085 #server port

},

'/images': { #images served as static files

'tools.staticdir.on': True,

'tools.staticdir.dir': os.path.abspath('/home/ubuntu/webserver/images')

}

}

cherrypy.quickstart(Server(), config=conf)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值