The Issue/Question Details

I have a file (blah.txt) where its contents (a list) look like this:

Key1 = ['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z',' ']

Inside of a simple python file (called CAT.py) I execute the following commands:

```
infile = open('blah.txt', 'r')
Key1 = infile.readline()
infile.close()
Key1 = Key1.rstrip('\n')
print(Key1)

```

> 
> 
> > 
> > 
> > > 
> > > Key1 = ['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z',' ']
> > > 
> > > 
> > > 
> > 
> > 
> > 
> 
> 
> 

```
print(''.join(Key1))

```

> 
> 
> > 
> > 
> > > 
> > > Key1 = ['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z',' '] <---- THIS IS WHAT I DO NOT WANT
> > > 
> > > 
> > > 
> > 
> > 
> > 
> 
> 
> 

However….

If in a separate simple python file (called DOG.py) I execute the following commands on a list: 

Key1 = ['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z',' ']

print(Key1)

> 
> 
> > 
> > 
> > > 
> > > ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', ' ']
> > > 
> > > 
> > > 
> > 
> > 
> > 
> 
> 
> 

print(''.join(Key1))

> 
> 
> > 
> > 
> > > 
> > > ABCDEFGHIJKLMNOPQRSTUVWXYZ <---- THIS IS WHAT I WANT
> > > 
> > > 
> > > 
> > 
> > 
> > 
> 
> 
> 

The Issue/Question

I ultimately want the output that looks like “ABCDEFGHIJKLMNOPQRSTUVWXYZ”, but for the life of me I cannot figure out how to read in a list for a file and then convert that list to a single string of characters. Can someone tell me where I am going wrong and also show me some code that would fix my problem?