[Baypiggies] importing variables into python namespace using argparse module
eric at ericwalstad.com
Thu Sep 8 00:08:11 CEST 2011
In the future please include the full error traceback. It includes
information that helps in debugging.
It looks like your sam_file_1 variable contains a list when a string
is expected. You could try printing the value of that variable before
passing it to your read_file function to see what it contains. You've
changed your code and didn't include all the changes.
On Wed, Sep 7, 2011 at 2:56 PM, Abhishek Pratap <abhishek.vit at gmail.com> wrote:
> I think I am stuck again while trying to open a file. It looks like a
> type casting error but not sure.
> TypeError: coercing to Unicode: need string or buffer, list found
> def read_file(file):
> """Read the first same and create a dictionary
> fh1 = open(file,'r')
> for line in fh1:
> print line
> sam_file_1 = args.sam_file_1
> sam_file_2 = args.sam_file_2
More information about the Baypiggies