Extracting information from files I have a file, the content is in the format of

41545
0
0
1
2
3
3
3
...


Following is the code

X=[]
Y=[]
total=0
count=0
for line in open(file,'r'):
    count+=1
    line=line.strip()
    if(line.strip()):
        if(count==1):
            total=int(line)
        else:
            X.append(count-1)
            Y.append(int(line))


the output for the above code is

total=41545 #first line
X=[1,2,3,4,5,6,7] #count of second line onwards
Y=[0,0,1,2,3,3,3] #second line onwards information


Is there a shorter and hopefully more efficient code that can achieve the same purpose?
Build a generator over the file to return just ints, then transpose the enumeration to get your X and Y, eg:

with open('testing.txt') as fin:
    lines = (int(line) for line in fin)
    total = next(lines)
    X, Y = zip(*enumerate(lines, 1))


Note X and Y will be tuples instead of lists, but you can convert them after if you wish.