わかさぎのブログ

プログラミング、Atcoderの勉強とか

ファイルの一覧を格納したリストの取得

    def filename_get():
    #フォルダ内のファイル名の一覧取得
        #path=os.getcwd()+"\libra"
        global path_loc
        path_loc=Path.asking_location()
        files = os.listdir(path_loc)
        files_file = [f for f in files if os.path.isfile(os.path.join(path_loc, f))]

 

os.getcwd()

今いるディレクトリの取得

Current Working Directoryの略