On Sat, Oct 8, 2016 at 4:34 AM, h2m2 <h...@mailworks.org> wrote: > os.path.dirname('G:\Programmierung\Python\Portugal > Training\Python-for-Algorithms--Data-Structures--and--Life\Algorithm > Analysis and Big O\testFile.ipynb') > > result and bug is: > 'G:\\Programmierung\\Python\\Portugal > Training\\Python-for-Algorithms--Data-Structures--and--Life' > > if I am not mistaken: correct result would be > 'G:\\Programmierung\\Python\\Portugal > Training\\Python-for-Algorithms--Data-Structures--and--Life\\Algorithm > Analysis and Big O'
Not a bug. You have something that you perhaps don't understand: backslash escapes. When you have "Big O\testfile", that string does *not* have a backslash in it. Use raw string literals, forward slashes, or doubled backslashes, to avoid this. ChrisA -- https://mail.python.org/mailman/listinfo/python-list