I need to create a two-dimensional array, but for some reason my code does not work. Elements are added to the array itself (in a loop), but if you try to output it through print after the loop, nothing happens.
def sub_open(path_rar, path_corp): if not os.path.exists(path_corp): os.makedirs(path_corp) for root,dirs,files in os.walk(path_rar): for folder in dirs: print(folder) file = file_corp(path_corp, folder) alligns = allign_times('.//Extracted_Data//', folder, file) print(alligns) - здесь тоже ничего не выводит(((( def allign_times(path_rar, folder, sub_corpus): alligns = [] for root,dirs,files in os.walk(path_rar + folder + '//'): for file in files: print(file) ############ sub_file = open(path_rar + folder + '//' + file, 'r').read() times = re.findall('\d\d:\d\d:\d\d,\d\d\d --> \d\d:\d\d:\d\d,\d\d\d', sub_file) data_times, data_reverse = transform(times) ## vals = [i for i in sorted(list(data_times.values()))] vals1 = [i for i in sorted(list(data_times.keys()))] allphrases = piece_to_file(data_times, sub_file, times, vals, data_reverse, vals1)## #print(allphrases) - тут находятся элементы и выводятся alligns.append(allphrases) - вроде как добавляем #print(alligns) - тут печатает #print(alligns) - выходим из цикла и после принта вообще ничего не выводит return alligns How to solve this problem? Where is the mistake? How to make so that a normal two-dimensional array is output when you call a function inside the sub_open function?
I would be grateful for the answer!
import sys; print("stderr", file=sys.stderr); print("stdout")import sys; print("stderr", file=sys.stderr); print("stdout")import sys; print("stderr", file=sys.stderr); print("stdout")- jfs