This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Kiran Kotari
Recipients Kiran Kotari
Date 2015-12-30.02:26:36
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1451442396.75.0.577772474599.issue25979@psf.upfronthosting.co.za>
In-reply-to
Content
In this python code I am collecting list of folders present in the given location path with parent folder and print the folder names (output went wrong due to escape sequence values with lstrip.)
Note :
"\a \b \f \r \v \0 \1" are working fine. 
"\c \e \n \ne \t \te" went wrong.

Python Code :
import glob as g

class Folders:
    def __init__(self, path, parent_folder_name):
        self.path = path + parent_folder_name + '\\'
        self.parent_folder_name = parent_folder_name

    def showFolders(self):
        folders = [lst.lstrip(self.path) for lst in  g.glob(self.path + '*')]
        print('Path: '+self.path+ ', List: ',folders)
    pass

if __name__ == "__main__":
	obj = Folders(path='.\\', parent_folder_name='parent')
	obj.showFolders()

Folder Structure : 
parent ->
      cat
      eat
      east
      next
      nest
      test

Wrong Output :
Path: .\parent\, List:  ['cat', 'st', '', 'st', 'xt', 'st']
History
Date User Action Args
2015-12-30 02:26:36Kiran Kotarisetrecipients: + Kiran Kotari
2015-12-30 02:26:36Kiran Kotarisetmessageid: <1451442396.75.0.577772474599.issue25979@psf.upfronthosting.co.za>
2015-12-30 02:26:36Kiran Kotarilinkissue25979 messages
2015-12-30 02:26:36Kiran Kotaricreate