Python Forum
I am trying to copy files into a bunch of folders.
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
I am trying to copy files into a bunch of folders.
#5
I made a very minor error. 
FileTypeList was actually coming from a file. Because it had \n at the end of the string the if statement returned false.
Now i did:
if FileType.rstrip() in item:
    Blah
This returns true.

I did not post that.  Wall My mistake. Sorry.
Reply


Messages In This Thread
RE: I am trying to copy files into a bunch of folders. - by tannishpage - Apr-22-2017, 09:36 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Using zipfile module - finding folders not files darter1010 2 320 Apr-06-2024, 07:22 AM
Last Post: Pedroski55
  Why is the copy method name in python list copy and not `__copy__`? YouHoGeon 2 311 Apr-04-2024, 01:18 AM
Last Post: YouHoGeon
  Copy Paste excel files based on the first letters of the file name Viento 2 492 Feb-07-2024, 12:24 PM
Last Post: Viento
  Create new folders and copy files cocobolli 3 1,532 Mar-22-2023, 10:23 AM
Last Post: Gribouillis
  Copy only hidden files and folders with rsync Cannondale 2 1,066 Mar-04-2023, 02:48 PM
Last Post: Cannondale
  a bunch of modules to import Skaperen 2 920 Nov-07-2022, 07:33 PM
Last Post: Gribouillis
  Compare filename with folder name and copy matching files into a particular folder shantanu97 2 4,569 Dec-18-2021, 09:32 PM
Last Post: Larz60+
  Moving files to Folders giddyhead 13 9,283 Mar-07-2021, 02:50 AM
Last Post: giddyhead
  How to use Bunch data structure moish 2 2,953 Dec-24-2020, 06:25 PM
Last Post: deanhystad
  code to read files in folders and transfer the file name, type, date created to excel Divya577 0 1,889 Dec-06-2020, 04:14 PM
Last Post: Divya577

Forum Jump:

User Panel Messages

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