How to add a leading slash when joining with os.path.join?
my_list = ['', 'drive', 'test', filename] path = os.path.join(*my_list) Result for path is drive/test/filename The desired result for path would be /drive/test/filename (with the leading slash, because i do have a ”, at the start of my_list I ended up using os.path.sep.join(my_list), which produces /drive/test/filename with the leading slash as desired, but i was wondering … Read more