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
  Using zipfile module - finding folders not files darter1010 2 241 Apr-06-2024, 07:22 AM
Last Post: Pedroski55
  Create new folders and copy files cocobolli 3 1,433 Mar-22-2023, 10:23 AM
Last Post: Gribouillis
  Copy only hidden files and folders with rsync Cannondale 2 992 Mar-04-2023, 02:48 PM
Last Post: Cannondale
  Moving specific files then unzipping/decompressing christophereccles 2 2,352 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 1,851 Dec-06-2020, 04:14 PM
Last Post: Divya577
  Moving Files From Subdirectories To Another Directory Harshil 5 3,980 Oct-06-2020, 10:52 AM
Last Post: ndc85430
  Calling Variables from Other Files in Different Folders illmattic 14 5,504 Aug-01-2020, 07:02 PM
Last Post: deanhystad
  sub-folders in folders from text line jenost 1 1,561 Mar-31-2020, 07:16 AM
Last Post: ndc85430
  Moving Files Evil_Patrick 4 2,487 Oct-02-2019, 02:56 AM
Last Post: Evil_Patrick
  Accessing files in various directories and folders ccuny 2 2,158 May-08-2019, 12:11 PM
Last Post: ccuny

Forum Jump:

User Panel Messages

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