Python Forum
MP3 Tags to Excel Not working
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
MP3 Tags to Excel Not working
#4
I am sorry, I was completely wrong. The problem lies somewhere else. The problem is the definition of gettags[]. This should be a two dimensional list. Each item of gettags[] should be a copy of gettags2[]. Can you change this:
                    for x in range(len(gettags2)):
                        gettags.append(gettags2[x]) #Loop until All Tags are Added to List
... to this:
                    #append slice of gettags2, containing the entire gettags2
                    gettags.append(gettags2[:])
(You must use the slice operator [:] to make a copy or else a reference will be made to gettags2.)
Then also change the following:
                for r in gettags:
                    #_ = ws1.cell(column=col, row=row, value= gettags2[1]) #"{0}".format(get_column_letter(col)))
                     
                    column_cell = 'A'
                    ws1['A1'] = 'Album'
                    ws1[column_cell + str(row + 1)] = gettags[0]
                    ...
Instead of gettags you should use r:
                for r in gettags:
                    #_ = ws1.cell(column=col, row=row, value= gettags2[1]) #"{0}".format(get_column_letter(col)))
                     
                    column_cell = 'A'
                    ws1['A1'] = 'Album'
                    ws1[column_cell + str(row + 1)] = r[0]
                    ...
... and then the same for all columns.

There is an inefficiency in your program. Why fill the header on row 1 each time again?

Let me know if it works.
Reply


Messages In This Thread
MP3 Tags to Excel Not working - by giddyhead - Jan-22-2021, 09:16 PM
RE: MP3 Tags to Excel Not working - by ibreeden - Jan-23-2021, 09:22 AM
RE: MP3 Tags to Excel Not working - by giddyhead - Jan-23-2021, 10:33 PM
RE: MP3 Tags to Excel Not working - by ibreeden - Jan-24-2021, 11:05 AM
RE: MP3 Tags to Excel Not working - by giddyhead - Jan-26-2021, 11:01 PM
RE: MP3 Tags to Excel Not working - by giddyhead - Jan-27-2021, 03:23 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Excel isnt working properly after python function is started IchNar 2 352 May-01-2024, 06:43 PM
Last Post: IchNar
  Working with Excel and Word, Several Questions Regarding Find and Replace Brandon_Pickert 4 1,633 Feb-11-2023, 03:59 PM
Last Post: Brandon_Pickert
  Too many if statements working as "tags" zeek 3 2,036 Sep-20-2021, 05:22 PM
Last Post: deanhystad
  Working with excel files arsouzaesilva 6 3,270 Sep-17-2021, 06:52 PM
Last Post: arsouzaesilva
  Need help working with two excel file with different formats mikey3580 1 1,650 Apr-22-2020, 07:11 AM
Last Post: DPaul
  Loop through tags inside tags in Selenium/Python xpack24 1 5,730 Oct-23-2019, 10:15 AM
Last Post: Larz60+
  working with more excel files Krszt 1 2,492 Mar-13-2019, 11:41 AM
Last Post: perfringo

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020