glob glob('csv'find all csv files ['data csv''data csv''data csv'glob glob('datatxt'select all txt file which starts with 'data['data_ txt''data_ txt''data txt''data_ txt''data txt''data txt'select txt files which have one character between 'dataand txtglob glob('datatxt'['data txt''data txt''data txt'glob glob('data[ - ]csv'select csv file with numbers , , after 'data['data csv''data csv'notethe 'globmodule returns the 'listthe list is in unordered form price calculation on files using 'globnowwe will use the glob module to perform 'price calculationon files using 'globmodule first open the python shell without using '-ioperation python since we did not use the '-ioperation to open the shelltherefore we need to import the function 'ring_costin the shellas shown belowimport glob from price import ring_cost files glob glob('pricsv'for file in filesprint(filering_cost(file)price csv price csv warningnote that we need to restart python shell every timewe made some changes in the code this is required as the 'importstatement loads all the data at the first timeand when we re-import the modules then it is fetched from the cache note thatthe 'globreturns listtherefore we can extend the list using various listing operation this can be useful when we have files names with different namesbut required same operations we want to perform price calculation on another set of items which has same columns as price csv file list can be modified as belowfiles glob glob('pricsv'files glob glob('pricsv'files extend(files extend list files ['price csv''price csv''price csv''price csv'files append('price csv'append data files ['price csv''price csv''price csv''price csv''price csv' glob module