"Earl Eiland" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > os.path.getsize(Inputdirectory + '\\' + Filename) works, but > os.path.getsize(Inputdirectory + '\\' + Filename.split('.') + '.ext') > Fails reporting "no such file or directory > InputDirectory\\Filename.ext". > os.path.getsize(Inputdirectory + r'\' + Filename.split('.') + '.ext') > generates a syntax error. > > Earl Eiland
Use the language provided os.sep rather than trying to code your own which will be incorrect when the code is run on a different platform. $ python Python 2.1 (#15, May 4 2004, 21:22:34) [MSC 32 bit (Intel)] on win32 Type "copyright", "credits" or "license" for more information. >>> import os >>> dir(os) ... >>> os.sep '\\' >>> os.pathsep ';' >>> os.linesep '\r\n' -- http://mail.python.org/mailman/listinfo/python-list