
Why is this happening?
f = open('c:\ndfa.txt')
shows an error while
f = open ('c:\log.txt')
executes both the files are in the same drive ?




Posted 24 January 2012 - 05:39 PM

f = open('c:\ndfa.txt')
shows an error while
f = open ('c:\log.txt')
executes both the files are in the same drive ?
Posted 24 January 2012 - 06:52 PM
Posted 24 January 2012 - 08:07 PM
f = open('C:\\myfile.txt')
f = open(r'C:\myfile.txt')
This post has been edited by Simown: 24 January 2012 - 08:10 PM
Posted 24 January 2012 - 08:23 PM
This post has been edited by Simown: 24 January 2012 - 08:24 PM
Posted 24 January 2012 - 08:26 PM
f = open(r'C:\ndfa.txt')Thanks Simown it did work; and what was the thing you said about escaping the backslash ?
Posted 24 January 2012 - 08:46 PM
'A\B\C\D....\Z\'
'A\\B\\C\\D....\\Z\\'
r'A\B\C\D....\Z\'
This post has been edited by Simown: 24 January 2012 - 08:49 PM
Posted 24 January 2012 - 09:30 PM
