{:10_266:}{:10_266:}{:10_266:}
看到这里的人好少啊。可是我偏偏木有鱼币{:10_247:}{:10_247:}
提出错误:text.tag_config()打成了text.tag_congif(){:10_244:}
bgstipple fgstipple 不太明白怎么用 能各个案例嘛{:5_91:}@小甲鱼
小甲鱼辛苦了!
from tkinter import *
root = Tk()
text = Text(root,width=30,height=5)
text.pack()
text.tag_config("tag1",background="yellow",foreground="red")
text.insert(INSERT,"I love ")
text.insert(END,"FishC.com!","tag1")
text.insert(INSERT,"\nYou are good!")
text.mark_set("here",2.8)
text.insert("here","very ")
#text.insert(END,"o")
#将任何格式的索引号统一为元祖(行,列)的格式输出
def getIndex(text,index):
return tuple(map(int,str.split(text.index(index),".")))
start = END
while True:
pos = text.search("o",start,stopindex=1.0,backwards=True)
if not pos:
break
print("找到啦,位置是:",getIndex(text,pos))
#print(pos,type(pos))
start = pos + "-1c" #start指向下一个字符
#print(text.index(start))
mainloop()
找到啦,位置是: (2, 15)
找到啦,位置是: (2, 1)
找到啦,位置是: (1, 14)
找到啦,位置是: (1, 3)
为什么反向搜索找不到(2,14)
花了大半天的时间全部看完了,真的是小乌见大乌啊
看小甲鱼整理的资料总是能事半功倍。支持小甲鱼!
内容丰富,甲鱼兄辛苦了!!
想直接写个代码编辑器233
请问一下怎么设置text的模式,让用户无法修改内容呀(改成只读)
先看看
学的很开心
先看视频吐血了,然后过来逛逛那些没用过的指令,发现知识真的好缺乏。
强大
超级6的干货满满的帖子{:10_279:}
没有课后作业好不习惯,没有题练练手
还是要多用才会记住{:10_266:}
text中如何获取鼠标选定的文本?有人知道吗 ?求助