(May-03-2020, 10:08 PM)Sutsro Wrote: Hello Everyone,
I am trying to get the lines that contain test string or if its not found i want to print not found message. However this doesnt seem to work i dont get any messages at all.
I can read text file, i can even make it count with "for line in input:" however none of the if conditions work inside for indentation. Am i missing something ?
def verial(): isimsatırlistesi=list() satırsayısı=0 input = text1.get("1.0",'end-1c') for line in input: satırsayısı=satırsayısı+1 if "test" in line: isimsatırlistesi.append(int(satırsayısı)) print(isimsatırlistesi[0,"end"]) if len.isimsatırlistesi<0: print("test not found")
I have already forked Python to have proper { } blocks and get rid of this fancy indentation rules. If there is anybody interested I can make my git become public or share the diff file. To be clear, the forked version can still continue to work on indented-style files, you can just decide every time you open a statement if you want to use the indent-style or { }.
Yoriz write Jun-16-2021, 06:01 AM:
Posting the same thing in old threads about some forked version of python
https://python-forum.io/thread-31669-pos...#pid143419
https://python-forum.io/thread-25521-pos...#pid143418
https://python-forum.io/thread-26494-pos...#pid143420
Posting the same thing in old threads about some forked version of python
https://python-forum.io/thread-31669-pos...#pid143419
https://python-forum.io/thread-25521-pos...#pid143418
https://python-forum.io/thread-26494-pos...#pid143420