作者john12 (放荡过日子的大学生)
看板Python
标题[问题] 外部程式问题?
时间Tue Aug 12 17:43:03 2008
以下是我写的程式
# -*- coding: utf-8 -*-
from Tkinter import *
import win32api
import win32con
win = Tk()
win.title(string = "视窗")#视窗
path = "./"
frame=Frame(win, relief=RAISED, borderwidth=2, width=800, height=600)#设定视窗
长宽
frame.pack(side=TOP, fill=BOTH, ipadx=5, ipady=5, expand=1)
Label(win, foreground="#ff0000", font=("", 20, "bold"), text="hello").pack()
def internet():#外部呼叫
win32api.WinExec('C:\Program Files\Internet Explorer\IEXPLORE.EXE',
win32con.SW_SHOWMAXIMIZED)
button1 = Button(frame,font=("", 20, "bold"), text="上网", command =
internet)#按钮
button1.place(x=300, y=300, anchor=W, width=200, height=150)
win.mainloop()
问题是我看按钮设定是在frame(为视窗所设定的名称),
那麽我呼叫的程式是否可以跟按钮一样可以开出後就设定在frame里?
我在都卡在这个问题里,
去找win32api.WinExec指令都没有可以设定在视窗中的,
希望有人可以帮帮忙,
谢谢!
--
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 163.26.229.167
1F:→ doghib:如果是要包IE在视窗里面,wxpython有个例子,名字叫 08/12 23:58
2F:→ doghib:ActiveX_IEHtmlWindow 08/12 23:59