Example:
file_list_without_extension = ['foo', 'bar', 'baz'] for filename in file_list_without_extension: with open(filename + '.csv', 'w') as csv_file: # code passOr you can prepare the list before:
file_list_without_extension = ['foo', 'bar', 'baz'] file_list_with_extension = [name + '.csv' for name in file_list_without_extension]If you have a bunch of csv-files and want to access them with a wild card, you can use glob.
glob.glob('*.csv') # returns a list of .csv files of the current working directory
Almost dead, but too lazy to die: https://sourceserver.info
All humans together. We don't need politicians!
All humans together. We don't need politicians!