Python Forum
[Tkinter] finding lines from a text entry
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Tkinter] finding lines from a text entry
#1
Hey everyone i made a code to find lines that starts with adres however it doesnt work, any ideas would be appreciated.
def verial():
    #aşama 1 adres satırını alıyoruz.
    adressatırlistesi=[]
    satırsayısı=0
    input = text1.get("1.0",'end-1c')
    for line in input:
        satırsayısı=satırsayısı+1
        if line.startswith("Adres"):
            büroEntry.insert(0,"öyleyse dans")
           
Reply
#2
Any errors? Can you post complete code?
Reply
#3
Looks like i found the problem when importing from a text file, you have to .rsplit like this:

inputraw = text1.get("1.0",'end-1c')
input=inputraw.rsplit(" ")
after doing that if and search functions works verywell it took a day for me to figure this out. I was considering saving the get as txt file than reopening it :).
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Get selected text inside an Entry Jerdup 0 572 Aug-20-2020, 12:42 PM
Last Post: Jerdup
  [Tkinter] Get the last entry in my text widget Pedroski55 3 1,305 Jul-13-2020, 10:34 PM
Last Post: Pedroski55
  [Tkinter] Get text entry in frame1, echo it in frame2 Pedroski55 8 917 Jul-10-2020, 11:51 PM
Last Post: Pedroski55
  Transfer Toplevel window entry to root window entry with TKinter HBH 0 1,990 Jan-23-2020, 09:00 PM
Last Post: HBH
  [Tkinter] getting Entry text Stauricus 4 1,317 May-10-2019, 08:24 PM
Last Post: swanysto
  [Tkinter] how to get the entry information using Entry.get() ? SamyPyth 2 1,683 Mar-18-2019, 05:36 PM
Last Post: woooee
  [WxPython] bind label and entry text with return key metulburr 1 1,616 Aug-14-2018, 10:02 PM
Last Post: metulburr
  [Tkinter] Hide text in entry box when i click on it. MeeranRizvi 1 8,244 Jan-25-2017, 10:38 AM
Last Post: MeeranRizvi
  [Tkinter] Entry widget : unable to get the text entered dlemper 2 13,845 Oct-11-2016, 12:32 AM
Last Post: dlemper

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020