Re: [問題] 外部程式問題?
※ 引述《john12 (放蕩過日子的大學生)》之銘言:
: 以下是我寫的程式
: # -*- 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指令都沒有可以設定在視窗中的,
: 希望有人可以幫幫忙,
: 謝謝!
如果是每個外部程式都可以用,那麼wxpython是不是也有這個功能?
--
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 163.26.229.167
討論串 (同標題文章)
Python 近期熱門文章
PTT數位生活區 即時熱門文章