A-python string

str = "Line1-abcdef \nLine2-abc \nLine4-abcd";

str2 = str.split();

print (str.split( ));

print (str.split(' ', 1 ));

print(str2);

for a in str2:

b = a.split('-');

for c in b:

print(c);

-----------RESULT-------------------

['Line1-abcdef', 'Line2-abc', 'Line4-abcd'] ['Line1-abcdef', '\nLine2-abc \nLine4-abcd'] ['Line1-abcdef', 'Line2-abc', 'Line4-abcd'] Line1 abcdef Line2 abc Line4 abcd

-------------------------------------

file = open("/var/www/html/newfile.txt","r") abc = list(file.read()) print( file.read()) for x in range(len(abc)): print abc[x],