【发布时间】:2020-12-24 13:17:39
【问题描述】:
好的,这就是我有一个非常简单的程序
import tkinter as tk
from tkinter import ttk
from tkinter import *
import os
import webbrowser
# this is the function called when the button is clicked
def Jazz():
browserExe = "chrome"
os.system("pkill "+browserExe)
webbrowser.open("http://us4.internet-radio.com:8266/listen.pls&title=Smooth%20Jazz%20Florida&website=http://www.SmoothJazzFlorida.com")
def Oldies():
browserExe = "chrome"
os.system("pkill "+browserExe )
webbrowser.open("https://www.internet-radio.com/player/?mount=http://uk3.internet-radio.com:8405/live.m3u&title=Majestic%20Jukebox%20Radio%20#HIGH%20QUALITY%20SOUND&website=https://www.majesticjukeboxradio.com/")
def ClassicRock():
browserExe = "chrome"
os.system("pkill "+browserExe )
webbrowser.open("https://www.internet-radio.com/player/?mount=http://us4.internet-radio.com:8258/listen.pls&title=Classic%20Rock%20Florida%20HD&website=http://www.classicrockflorida.com")
def Top40():
browserExe = "chrome"
os.system("pkill "+browserExe )
webbrowser.open("https://www.internet-radio.com/player/?mount=http://uk7.internet-radio.com:8226/listen.pls&title=Box%20UK%20Radio%20danceradiouk&website=https://www.danceradiouk.com")
root = Tk()
# This is the section of code which creates the main window
root.geometry('690x530')
root.configure(background='#F0F8F0')
root.title('Radio')
# This is the section of code which creates a button
Button(root, text='Jazz', bg='#F0F8FF', font=('arial', 22, 'normal'), command=Jazz).place(x=8, y=32)
Button(root, text='Oldies', bg='#F0F8FF', font=('arial', 22, 'normal'), command=Oldies).place(x=8, y=96)
Button(root, text='Classic_Rock', bg='#F0F8FF', font=('arial', 22, 'normal'), command=ClassicRock).place(x=8, y=160)
Button(root, text='Top40', bg='#F0F8FF', font=('arial', 22, 'normal'), command=Top40).place(x=8, y=224)
root.mainloop()
我想要做的是将谷歌放在这个表单/窗口上,也使用 python...
【问题讨论】:
-
您是否在问如何将 chrome 嵌入到您的 tkinter 应用程序中?
-
是的,我不确定 embed 是否适合使用
标签: python google-chrome