Look what happens when a string with a backslash character is evaluated:
- >>> print 'abcdef\thrt'
-
abcdef hrt
-
>>> print r'abcdef\thrt'
-
abcdef\thrt
-
>>>
Characters "\t" are evaluated as a tab character. Escape the backslash characters for a path as in:
'D:\\SD\\plugins\\Embed\\Defaults\\EmbedPL.txt'
or use the forward slash as in:
'D:/SD/plugins/Embed/Defaults/EmbedPL.txt'
or use a raw string as in:
r'D:\SD\plugins\Embed\Defaults\EmbedPL.txt'
If the file is in your current working directory (os.getcwd()), you can omit the full path as in:
'EmbedPL.txt'
To read a file in the directory just above the CWD:
open("..\\EmbedPL.txt").read()
To read a file in a directory just below the CWD:
open("subdir_name\\EmbedPL.txt").read()