I've been trying to pass a tuple to a function that I created earlier, however, I m still not able to make it work. My objective is to pass a tuple containing a list of path+file form which I want to discover the size and print it out.
Here's my code
EXl = ('C:\\vd36e404.vdb','C:\\vd368c03.vdb')
def fileF(EXl):
import os
filesize = os.path.getsize(EXl)
print (filesize);
fileF(EXl)
These are the errors:
Traceback (most recent call last):
File "C:\Documents and Settings\Administrator\workspace\test1py\testcallMyF.py", line 13, in <module>
fileF(EXl)
File "C:\Documents and Settings\Administrator\workspace\test1py\testcallMyF.py", line 9, in fileF
filesize= os.path.getsize(EXl)
File "C:\Python27\lib\genericpath.py", line 49, in getsize
return os.stat(filename).st_size
TypeError: coercing to Unicode: need string or buffer, tuple found
Could anyone explain to me why?(I'm using Python 2.7.2)