I have a problem reading characters from a file. I have a file called `fst.fasta` and I want to know the number of occurrences of the letters `A` and `T`.

This is the first code sample :

```
f = open("fst.fasta","r")
a = f.read().count("A")

t = f.read().count("T")

print "nbr de A : ", a
print "nbr de T : ", t

```

The result:

```
nbr of A :  255
nbr of T :  0

```

Even if there are `T`s i get always `0`

But after that, I tried this :

```
f = open("fst.fasta","r")
a = f.read().count("A")

f = open("fst.fasta","r")
t = f.read().count("T")

print "nbr de A : ", a
print "nbr de T : ", t

```

This worked! Is there any other way to avoid repeating `f = open("fst.fasta","r")` ?