[問題] 外部程式問題?
以下是我寫的程式
# -*- 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
→
08/12 23:58, , 1F
08/12 23:58, 1F
→
08/12 23:59, , 2F
08/12 23:59, 2F
討論串 (同標題文章)
Python 近期熱門文章
PTT數位生活區 即時熱門文章