本文整理汇总了Python中ScrolledText.place方法的典型用法代码示例。如果您正苦于以下问题:Python ScrolledText.place方法的具体用法?Python ScrolledText.place怎么用?Python ScrolledText.place使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ScrolledText
的用法示例。
在下文中一共展示了ScrolledText.place方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: ScrolledText
# 需要导入模块: import ScrolledText [as 别名]
# 或者: from ScrolledText import place [as 别名]
root = tk.Tk()
# 実行処理はここから
root.title(sys.argv[1])
root.geometry("850x550")
font = tkFont.Font(size=14)
# t0: 元テキスト
# t1: json
# b1: 範囲確定用ボタン
# b2: 結果反映用ボタン
t0 = ScrolledText(width=100,height=12,font=font,background="#fffff0")
t1 = ScrolledText(width=100,height=12,font=font,background="#fffff0")
b1 = tk.Button(text="confirm range")
b2 = tk.Button(text="finish")
t0.place(x=10,y=10)
t1.place(x=10,y=230)
b1.place(x=380,y=450)
b2.place(x=406,y=475)
b1.bind("<ButtonRelease>",confirm)
b2.bind("<ButtonRelease>",stringize)
# ファイルの内容を反映
for element in txt:
t0.insert(tk.END, element)
for element in jsn:
t1.insert(tk.END, element)
# 実行処理はここまで
root.mainloop()
示例2: Tk
# 需要导入模块: import ScrolledText [as 别名]
# 或者: from ScrolledText import place [as 别名]
Largeur = 900
Hauteur = 700
Mafenetre = Tk()
Mafenetre.title("Jarvis")
Intro = Label(Mafenetre, text=Titre, font="Arial 10 italic underline", fg='green', bg='black', justify=CENTER, borderwidth=0)
Intro.place(x=450, y=30, anchor=CENTER)
background_image = PhotoImage(file="Jarvis.png")
background_label = Label(Mafenetre, image=background_image)
background_label.config(borderwidth=0)
background_label.place(x=0, y=0)
Output = ScrolledText(Mafenetre, width=120, height=30, background="black", foreground="green", borderwidth=0, wrap='word')
Output.place(x=0, y=200)
def GMail():
Output.insert(END,gmail.main())
def Meteo():
Output.insert(END,weather.main())
Bouton=Label(Mafenetre)
Bouton.place(x=800, y=0)
GmailB = Button(Bouton, text="Gmail", command=GMail)
GmailB.pack()
MeteoB = Button(Bouton, text="Météo", command=Meteo)
MeteoB.pack()
menubar = Menu(Mafenetre)
示例3: Application
# 需要导入模块: import ScrolledText [as 别名]
# 或者: from ScrolledText import place [as 别名]
class Application(Frame):
def openkey(self):
os.system("sh keyboard.sh &")
def opencamera(self):
os.system("sh camera.sh &")
def closecamera(self):
os.system("sh clos.sh &")
def startchat(self):
#if(self.chat_state == "OFF"):
ser.write(",")
ser.write(":")
now=datetime.now()
self.chatLog.insert(END,(str(now)+"Astronaut:\n"))
#self.chat_state.set(1)
def stopchat(self):
#self.chat_state.set(0)
#if(self.chat_state == "ON"):
self.chatLog.insert(END,".\n")
ser.write(",")
# Measure data from the sensor
def measure(self):
self.temp_data.set = "Temperature"
self.preasure_data.set= "Preasure"
self.heart_rate_data.set = "Heart rate"
# Request data and read the answer
#ser.write("m")
data = ser.readline()
# If the answer is not empty, process & display data
if (data[0] == ","):
if (data[1] == "T"):
now = datetime.now()
t_processed_data = data[2:-4]
self.tempLog.insert(END,str(now)+' '+str(t_processed_data)+'\n')
#self.temp_data.set("Temperature: " + str(t_processed_data))
file.write(str(t_processed_data)+",")
elif (data[1] == "P"):
now = datetime.now()
p_processed_data = data[2:-4]
self.preasureLog.insert(END,str(now)+' '+str(p_processed_data)+'\n')
#self.preasure_data.set("Preasure: " + str(p_processed_data))
file.write(str(p_processed_data)+",")
elif (data[1] == "H"):
now = datetime.now()
h_processed_data = data[2:-4]
self.heartLog.insert(END,str(now)+' '+str(h_processed_data)+'\n')
#self.heart_rate_data.set("Heart rate: " + str(h_processed_data))
file.write(str(h_processed_data)+","+str(now)+"\n")
elif (data[1] == ":"):
now = datetime.now()
print "hello amr"
self.chatLog.insert(END,(str(now)+" Spacecraft:\n"+str(data[2:-4])))
#if(self.chat_state == "ON"):
#ser.write(event.char)
#self.chatLog.insert(END,str(event.char))
#if(event.char == "\n"):
#self.chatLog.insert(END,"\n")
#ser.write(",")
#ser.write(",")
#ser.write(":")
file.flush()
self.after(1,self.measure)
# Create display elements
def createWidgets(self):
allframe = Frame(root, width=800, height =480)
allframe.grid(row=0, column=0, padx=0, pady=0, sticky=N+S)
backgroundFile = "rpi.jpg"
bckImage = Image.open(backgroundFile)
bckImage = bckImage.resize((self.width, self.height), resample=3)
background = ImageTk.PhotoImage(bckImage)
bckPanel = Label(allframe, image=background)
bckPanel.grid(row=0, column=0, padx=0, pady=0, sticky=W)
bckPanel.image = background
openkeyBtn = Button(root, text="KeyBoard", command=self.openkey, bg="white") #create a button inside the btnFrame with the given features
openkeyBtn.place(x=5,y=320)
CameraBtn = Button(root, text="Camera", command=self.opencamera, bg="white")
CameraBtn.place(x=280,y=320)
startchatBtn = Button(root, text="Start chat", command=self.startchat, bg="white") #create a button inside the btnFrame with the given features
startchatBtn.place(x=95,y=320)
stopcameraBtn = Button(root, text="stop camera", command=self.closecamera, bg="white") #create a button inside the btnFrame with the given features
stopcameraBtn.place(x=365,y=320)
stopchatBtn = Button(root, text="Stop chat", command=self.stopchat, bg="white") #create a button inside the btnFrame with the given features
#.........这里部分代码省略.........