Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Moving files to Folders
#11
sorry at this time no luck with that option when I click on the New Reply option appears on the top and when scrolled down to the bottom of the page only Powered By MyBB, © 2020 Designed byrain. Forum Stats Contact Us Lite (Archive) Mode RSS Syndication. shows up.
Reply
#12
If statement does not separate between Albums from List. When ran it all prints Yes and when I used not equal all printed no. Why is it not able to see if the Album is NT and print Yes and all others print No? Thanks



nt = 0
ft = 0
    
for alb in range(len(albm)):
                    
        while nt < len(newtracks):
            while ft < len(filezto):

                if albm[alb]  == 'NT' and newtracks[nt] == filezto[ft] :
                   
                        print('Yes', newtracks[nt] ,' ft', filezto[ft])

                else:
                        print('No', newtracks[nt], 'ft',filezto[ft])
                nt = nt +1
                ft = ft +1
Reply
#13
What is albm? Does it have more than one element? Does it have any elements that aren't NT?

Do you have your code somewhere we can see it/run it/test it, like github?
Reply
#14
(Mar-03-2021, 10:11 PM)nilamo Wrote: What is albm? Does it have more than one element? Does it have any elements that aren't NT?

Do you have your code somewhere we can see it/run it/test it, like github?

Thank you for your assistance in inquiring and wanting to help. With some assistance I was able to solve this riddle with below:

for album, track, path in ziplst:

        if album == 'NT' and track in newtracks:
           
            print('%s %s' % ('Yes', track))
            
            #shutil.copy('C:\\Users\\j\\Desktop\\SJ\\NASB - Copy\\' + track,  path +'\\'+track)
        else:
            print('%s %s' % ('No', track))
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Moving specific files then unzipping/decompressing christophereccles 2 888 Apr-24-2021, 04:25 AM
Last Post: ndc85430
  code to read files in folders and transfer the file name, type, date created to excel Divya577 0 783 Dec-06-2020, 04:14 PM
Last Post: Divya577
  Moving Files From Subdirectories To Another Directory Harshil 5 1,538 Oct-06-2020, 10:52 AM
Last Post: ndc85430
  Calling Variables from Other Files in Different Folders illmattic 14 2,476 Aug-01-2020, 07:02 PM
Last Post: deanhystad
  Folders in folders jenost 5 1,460 Apr-26-2020, 05:35 PM
Last Post: jenost
  sub-folders in folders from text line jenost 1 727 Mar-31-2020, 07:16 AM
Last Post: ndc85430
  Moving Files Evil_Patrick 4 1,266 Oct-02-2019, 02:56 AM
Last Post: Evil_Patrick
  Accessing files in various directories and folders ccuny 2 1,075 May-08-2019, 12:11 PM
Last Post: ccuny
  Rename folders as files inside Ral1s 2 1,657 Dec-07-2018, 08:19 PM
Last Post: jeanMichelBain
  Some help with moving files ACSpeck 1 1,784 Apr-11-2018, 01:01 AM
Last Post: Larz60+

Forum Jump:

User Panel Messages

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