Sep-09-2018, 11:44 AM
Well the idle3 editor is set to put 4 spaces for a tab.
The bit of my little program that does the work was very difficult to indent. In the end, I tried this, which works every time in the idle3 python shell.
The bit of my little program that does the work was very difficult to indent. In the end, I tried this, which works every time in the idle3 python shell.
for sheet in sheets: activeDirectory = pathToPhotos + sheet + '/' print('the active photo directory is ' + activeDirectory) for filename in os.listdir(activeDirectory): if not (filename.endswith('.jpg')): continue for rowNum in range(beginRow, wb[sheet].max_row + 1): getName = filename.split('.') if (getName[0] == wb[sheet].cell(row=rowNum, column=col).value): print('found the name! Name is: %s ' % (getName[0])) print('Putting pic in row ' + str(rowNum)) img = Image(activeDirectory + filename) wb[sheet].add_image(img, 'A' + str(rowNum))Seems like the indents are all over the place, but it works each time in the python shell. However, in a bash terminal, it never gets that far, because of the above mentioned problem with the colon.