How to use glob.glob function with pre-define path?
问题 I want to use my pre-define path in glob function like code: import glob import os list_of_files = glob.glob('/Jaymin/MAC Report/*.txt') latest_file= max(list_of_files, key=os.path.getctime) but instead of this I have path stored in my variable like: My_path=/Jaymin/MAC Report so how can I replace my_path variable to the path ? like: list_of_files = glob.glob(MY_PATH'/*.txt') 来源: https://stackoverflow.com/questions/49644352/how-to-use-glob-glob-function-with-pre-define-path