I was wondering if it could be possible to get access to all the files in a directory from a python script.
The script is the following:
import pandas as pd
import numpy as np
#[4] main_folder=r'C:/Users/MainUser/Desktop/sediment_processing/raw_data/cohesive/'
#[6] section_name = 'UHS_TIG01_PAC07032019'
#[7] file_extension = '.xlsm'
file = main_folder + section_name + file_extension
excel = pd.read_excel(file,sheet_name='ASCII Data',header=3)
df = excel.iloc[1:,21:53]
#And more lines for calculations
What I would like to know is if it's possible to, inside this code, write something instead of lines [4], [6] and [7] that could let apply all the calculations in this code to all the excel files in my directory:
C:/Users/MainUser/Desktop/sediment_processing/raw_data/cohesive/.