最美情侣中文字幕电影,在线麻豆精品传媒,在线网站高清黄,久久黄色视频

歡迎光臨散文網(wǎng) 會(huì)員登陸 & 注冊(cè)

wxpython多窗口調(diào)用import模式

2020-03-27 15:10 作者:一心想當(dāng)網(wǎng)紅的李老師  | 我要投稿

打擾了一下辦公室大神。需要學(xué)習(xí)import模式調(diào)用。

子窗口程序:(和上次變化不大,還沒(méi)有擴(kuò)展)

import wx

import os

import CV2

class inputframe(wx.Frame):

? ? def __init__(self, parent):

? ? ? ? wx.Frame.__init__(self,parent,title='輸入信息',size=(480,320))

? ? ? ? ? ?

if __name__=='__main__':

? ? app = wx.App()

? ? SiteFrame = inputframe(parent=None)

? ? SiteFrame.Show()

? ? app.MainLoop()


主窗口程序:采用import

import wx

import os

import CV2

import wininput ? ####先開(kāi)頭引用


class mainframe(wx.Frame):

? ? def __init__(self, parent):

? ? ? ? wx.Frame.__init__(self,parent,title='主界面',size=(480,320))

? ? ? ? self.BeginBtn = wx.Button(self,label='開(kāi)始',pos=(5,5),size=(80,25))

? ? ? ? self.BeginBtn.Bind(wx.EVT_BUTTON,self.openfile)

? ? ? ? self.inputBtn= wx.Button(self,label='輸入',pos=(105,5),size=(80,25))

? ? ? ? self.inputBtn.Bind(wx.EVT_BUTTON,self.inputmsg)

? ? ? ??

? ? ? ??

? ? def openfile(self,event):

? ? ? ? wildcard = 'All files(*.*)|*.*'

? ? ? ? dialog = wx.FileDialog(None,'select',os.getcwd(),'',wildcard,wx.FD_OPEN) ?#####這個(gè)部分新舊版本有變化

? ? ? ? if dialog.ShowModal() == wx.ID_OK:

? ? ? ? ? ? self.FileName.SetValue(dialog.GetPath())

? ? ? ? ? ??

? ? def inputmsg(self,event):

? ? ? ? dlg=wininput.inputframe(self)

? ? ? ? dlg.Show()

? ? ? ? ####這邊可以調(diào)用子窗口內(nèi)部函數(shù)。成功,沒(méi)有黑框框。

? ? ? ??

if __name__=='__main__':

? ? app = wx.App()

? ? SiteFrame = mainframe(parent=None)

? ? SiteFrame.Show()

? ? app.MainLoop()


wxpython多窗口調(diào)用import模式的評(píng)論 (共 條)

分享到微博請(qǐng)遵守國(guó)家法律
阳山县| 林芝县| 廊坊市| 平南县| 肃宁县| 新化县| 芦溪县| 九台市| 光泽县| 泗阳县| 马边| 洪雅县| 荃湾区| 东丰县| 平顶山市| 石阡县| 安西县| 离岛区| 武功县| 玛纳斯县| 青浦区| 三穗县| 谢通门县| 蒲城县| 洛浦县| 吕梁市| 斗六市| 东乡族自治县| 镇平县| 上蔡县| 桐城市| 大城县| 台湾省| 元谋县| 广东省| 龙岩市| 赣州市| 青阳县| 新龙县| 新建县| 德清县|