import
wx
import
sys
import
multiprocessing
from
you_get
import
common as you_get
def
process(url):
directory
=
r
'D:\1'
sys.argv
=
[
'you_get'
,
'-o'
, directory, url]
you_get.main()
class
Frame(wx.Frame):
def
__init__(
self
):
wx.Frame.__init__(
self
,
None
, title
=
'you-get-gui'
, size
=
(
400
,
300
),name
=
'frame'
,style
=
541072384
)
self
.启动窗口
=
wx.Panel(
self
)
self
.Centre()
self
.编辑框
1
=
wx.TextCtrl(
self
.启动窗口,size
=
(
300
,
230
),pos
=
(
5
,
25
),value
=
'
',name='
text',style
=
1073741856
)
self
.按钮
1
=
wx.Button(
self
.启动窗口,size
=
(
119
,
50
),pos
=
(
314
,
125
),label
=
'按钮'
,name
=
'button'
)
self
.按钮
1.Bind
(wx.EVT_BUTTON,
self
.按钮
1_
按钮被单击)
self
.标签
1
=
wx.StaticText(
self
.启动窗口, size
=
(
200
,
20
), pos
=
(
-
25
,
5
), label
=
'Urls:(多个用空格隔开)'
, name
=
'staticText'
, style
=
2321
)
def
按钮
1_
按钮被单击(
self
,event):
print
(
'按钮1,按钮被单击'
)
urls
=
self
.编辑框
1.Value
url
=
urls.split(
'\n'
)
for
i
in
range
(
len
(url)):
p
=
multiprocessing.Process(target
=
process, args
=
(url[i],))
p.start()
class
myApp(wx.App):
def
OnInit(
self
):
self
.iDmfbdvaNk
=
Frame()
self
.iDmfbdvaNk.Show(
True
)
return
True
if
__name__
=
=
'__main__'
:
multiprocessing.freeze_support()
app
=
myApp()
app.MainLoop()