Javascript 使用wx.html2时,在使用按钮标记时有一些奇怪的地方 导入wx.html2 进口稀土 导入操作系统 导入cx_Oracle 主类(wx.Frame): 定义初始化(自): wx.Frame.\uuuuu init\uuuuu(self,None,style=wx.DEFAULT\u Frame\u style) self.maintml2webview=wx.html2.WebView.New(self,size=(0,0),backend=wx.html2.WebViewBackendIE) self.MainFirstPage() def Main首页(自我): self.FirstPage=“” html,正文{{高度:100%;}} div.up{{margin:50px auto;}} .按钮{ 宽度:400px; 背景颜色:橙色; 边界:无; 颜色:#fff; 填充:100px; 文本对齐:居中; 文字装饰:无; 字体大小:粗体; 字体大小:100px; 利润率:300px自动; 光标:指针; }} 标题 """ self.Department() self.maintml2webview.SetPage(self.FirstPage.format(nextpage=re.sub(r'\s+',“”,self.DepartmentChoie)),“”) 国防部(自我): self.DepartmentChoie=“” html,正文{{高度:100%;}} .obgy{{ 宽度:500px; 背景颜色:橙色; 边界:无; 颜色:白色; 填充:100px; 文本对齐:居中; 文字装饰:无; 字体大小:粗体; 字体大小:50px; 保证金:50px自动; 光标:指针; 位置:相对位置; }} .pd{ 宽度:500px; 背景颜色:粉红色; 边界:无; 颜色:白色; 填充:100px; 文本对齐:居中; 文字装饰:无; 字体大小:粗体; 字体大小:50px; 保证金:50px自动; 光标:指针; 位置:相对位置; }} .fm{ 宽度:500px; 背景颜色:蓝色; 边界:无; 颜色:白色; 填充:100px; 文本对齐:居中; 文字装饰:无; 字体大小:粗体; 字体大小:50px; 保证金:50px自动; 光标:指针; 位置:相对位置; }} 标题2 """ self.obgy() self.maintml2webview.SetPage(self.DepartmentChoie.format(obgypage=re.sub(r'\s+',“”,self.obgychoice)),“”) def obgy(自我): self.obgychoice=“” html,正文{{高度:100%;}} .ob{ 宽度:500px; 背景颜色:橙色; 边界:无; 颜色:白色; 填充:100px; 文本对齐:居中; 文字装饰:无; 字体大小:粗体; 字体大小:50px; 保证金:50px自动; 光标:指针; 位置:相对位置; }} .gy{{ 宽度:500px; 背景颜色:粉红色; 边界:无; 颜色:白色; 填充:100px; 文本对齐:居中; 文字装饰:无; 字体大小:粗体; 字体大小:50px; 保证金:50px自动; 光标:指针; 位置:相对位置; }} 标题2 """ 如果uuuu name uuuuuu='\uuuuuuu main\uuuuuuu': app=wx.app() fream=Main() 弗雷姆秀(真实) app.MainLoop()

Javascript 使用wx.html2时,在使用按钮标记时有一些奇怪的地方 导入wx.html2 进口稀土 导入操作系统 导入cx_Oracle 主类(wx.Frame): 定义初始化(自): wx.Frame.\uuuuu init\uuuuu(self,None,style=wx.DEFAULT\u Frame\u style) self.maintml2webview=wx.html2.WebView.New(self,size=(0,0),backend=wx.html2.WebViewBackendIE) self.MainFirstPage() def Main首页(自我): self.FirstPage=“” html,正文{{高度:100%;}} div.up{{margin:50px auto;}} .按钮{ 宽度:400px; 背景颜色:橙色; 边界:无; 颜色:#fff; 填充:100px; 文本对齐:居中; 文字装饰:无; 字体大小:粗体; 字体大小:100px; 利润率:300px自动; 光标:指针; }} 标题 """ self.Department() self.maintml2webview.SetPage(self.FirstPage.format(nextpage=re.sub(r'\s+',“”,self.DepartmentChoie)),“”) 国防部(自我): self.DepartmentChoie=“” html,正文{{高度:100%;}} .obgy{{ 宽度:500px; 背景颜色:橙色; 边界:无; 颜色:白色; 填充:100px; 文本对齐:居中; 文字装饰:无; 字体大小:粗体; 字体大小:50px; 保证金:50px自动; 光标:指针; 位置:相对位置; }} .pd{ 宽度:500px; 背景颜色:粉红色; 边界:无; 颜色:白色; 填充:100px; 文本对齐:居中; 文字装饰:无; 字体大小:粗体; 字体大小:50px; 保证金:50px自动; 光标:指针; 位置:相对位置; }} .fm{ 宽度:500px; 背景颜色:蓝色; 边界:无; 颜色:白色; 填充:100px; 文本对齐:居中; 文字装饰:无; 字体大小:粗体; 字体大小:50px; 保证金:50px自动; 光标:指针; 位置:相对位置; }} 标题2 """ self.obgy() self.maintml2webview.SetPage(self.DepartmentChoie.format(obgypage=re.sub(r'\s+',“”,self.obgychoice)),“”) def obgy(自我): self.obgychoice=“” html,正文{{高度:100%;}} .ob{ 宽度:500px; 背景颜色:橙色; 边界:无; 颜色:白色; 填充:100px; 文本对齐:居中; 文字装饰:无; 字体大小:粗体; 字体大小:50px; 保证金:50px自动; 光标:指针; 位置:相对位置; }} .gy{{ 宽度:500px; 背景颜色:粉红色; 边界:无; 颜色:白色; 填充:100px; 文本对齐:居中; 文字装饰:无; 字体大小:粗体; 字体大小:50px; 保证金:50px自动; 光标:指针; 位置:相对位置; }} 标题2 """ 如果uuuu name uuuuuu='\uuuuuuu main\uuuuuuu': app=wx.app() fream=Main() 弗雷姆秀(真实) app.MainLoop(),javascript,python,html,wxpython,Javascript,Python,Html,Wxpython,我的代码是上面使用wx.html2编写的简单html。我正在使用输入按钮标签打开下一页 真的吗?我发现了一些奇怪的东西 第一 import wx.html2 import re import os import cx_Oracle class Main(wx.Frame): def __init__(self): wx.Frame.__init__(self, None, style=wx.DEFAULT_FRAME_STYLE) self.MainH

我的代码是上面使用
wx.html2
编写的简单html。我正在使用
输入按钮标签
打开下一页

真的吗?我发现了一些奇怪的东西

第一
import wx.html2
import re
import os
import cx_Oracle


class Main(wx.Frame):
    def __init__(self):
        wx.Frame.__init__(self, None, style=wx.DEFAULT_FRAME_STYLE)
        self.MainHtml2WebView = wx.html2.WebView.New(self, size=(0, 0), backend=wx.html2.WebViewBackendIE)

        self.MainFirstPage()

    def MainFirstPage(self):
        self.FirstPage = """
        <!DOCTYPE html>
            <html lang=ko>
            <style text=text/css>   
                html, body{{height:100%;}}      
                div.up{{margin:50px auto;}}                         
                .button{{               
                    width:400px;
                    background-color:orange;
                    border:none;
                    color:#fff;
                    padding:100px;
                    text-align:center;
                    text-decoration:none;   
                    font-weight:bold;            
                    font-size:100px;
                    margin:300px auto;
                    cursor:pointer;     
                }}
            </style>
                <head>
                    <meta charset=UTF-8>    
                    <title>TITLE</title>    
                </head>                     
                <body scroll="no">
                    <div class=up>
                        <center><img src=9.png></center>                    
                    </div>                  
                    <div class=down>
                        <center><input type=button class=button value=clcik onclick="location.href='{nextpage}'"></input></center>
                    </div>  
                </body>         
            </html>         
        """
        self.Department()
        self.MainHtml2WebView.SetPage(self.FirstPage.format(nextpage=re.sub(r'\s+', " ", self.DepartmentChoie)), "")

    def Department(self):
        self.DepartmentChoie = """
        <!DOCTYPE html>
            <html lang=ko>
            <style text=text/css>   
                html, body{{height:100%;}}                                                  
                .obgy{{         
                    width:500px;
                    background-color:orange;
                    border:none;
                    color:white;
                    padding:100px;
                    text-align:center;
                    text-decoration:none;   
                    font-weight:bold;            
                    font-size:50px;
                    margin:50px auto;
                    cursor:pointer;     
                    position:relative;
                }}
                .pd{{       
                    width:500px;
                    background-color:pink;
                    border:none;
                    color:white;
                    padding:100px;
                    text-align:center;
                    text-decoration:none;   
                    font-weight:bold;            
                    font-size:50px;
                    margin:50px auto;
                    cursor:pointer;     
                    position:relative;      
                }}  
                .fm{{               
                    width:500px;
                    background-color:blue;
                    border:none;
                    color:white;
                    padding:100px;
                    text-align:center;
                    text-decoration:none;   
                    font-weight:bold;            
                    font-size:50px;
                    margin:50px auto;
                    cursor:pointer;     
                    position:relative;      
                }}          
            </style>
                <head>
                <meta charset=UTF-8 />  
                    <title>TITLE2</title>   
                </head>                     
                    <body scroll=no>
                        <div>                   
                            <center>
                                <input type=button class=obgy value=TEST1 onclick="location.href='{obgypage}'">
                                <input type=button class=pd value=TEST2>            
                                <input type=button class=fm value=TEST3>
                            </center>                   
                        </div>                                      
                    </body>         
            </html> 
            """
        self.obgy()
        self.MainHtml2WebView.SetPage(self.DepartmentChoie.format(obgypage=re.sub(r'\s+', " ", self.obgychoice)), "")

    def obgy(self):
        self.obgychoice = """
        <!DOCTYPE html>
            <html lang=ko>
            <style text=text/css>   
                html, body{{height:100%;}}                                                  
                .ob{{           
                    width:500px;
                    background-color:orange;
                    border:none;
                    color:white;
                    padding:100px;
                    text-align:center;
                    text-decoration:none;   
                    font-weight:bold;            
                    font-size:50px;
                    margin:50px auto;
                    cursor:pointer;     
                    position:relative;
                }}
                .gy{{       
                    width:500px;
                    background-color:pink;
                    border:none;
                    color:white;
                    padding:100px;
                    text-align:center;
                    text-decoration:none;   
                    font-weight:bold;            
                    font-size:50px;
                    margin:50px auto;
                    cursor:pointer;     
                    position:relative;      
                }}                
            </style>
                <head>
                <meta charset=UTF-8 />  
                    <title>TITLE2</title>   
                </head>                     
                    <body scroll=no>
                        <div>
                            <center>
                                <input type=button class=ob value=TEST1></input>                    
                                <input type=button class=gy value=TEST2></input>                           
                            </center>
                        </div>                                      
                    </body>         
            </html> 
            """

if __name__ == '__main__':
    app = wx.App()
    fream = Main()
    fream.Show(True)
    app.MainLoop()