xdufacool/collect_local.py
def move_file():
    """Move files out of sub-directories in the current working directory."""
    # print("\n".join(os.listdir(filepath)))
    # folders = [os.path.join(filepath, fld) for fld in os.listdir(filepath)]
    # print(filepath + ":\n  " + "\n  ".join(folders))
    folders = filter(os.path.isdir, os.listdir(u"."))
    # print("Sub-folders: ", u"\n".join(folders))
    for folder in folders:
        files = [os.path.join(folder, fn) for fn in os.listdir(folder)]
        files = filter(os.path.isfile, files)
        for fn in files:
            _, filename = os.path.split(fn)
            shutil.move(fn, filename)
        assert 0 == len(os.listdir(folder))
Move files out of sub-directories in the current working directory.
Move files out of sub-directories in the current working directory.
Move files out of sub - directories in the current working directory .
def move_file():
    folders = filter(os.path.isdir, os.listdir(u"."))
    for folder in folders:
        files = [os.path.join(folder, fn) for fn in os.listdir(folder)]
        files = filter(os.path.isfile, files)
        for fn in files:
            _, filename = os.path.split(fn)
            shutil.move(fn, filename)
        assert 0 == len(os.listdir(folder))
def move_file ( ) : folders = filter ( os . path . isdir , os . listdir ( u"." ) ) for folder in folders : files = [ os . path . join ( folder , fn ) for fn in os . listdir ( folder ) ] files = filter ( os . path . isfile , files ) for fn in files : _ , filename = os . path . split ( fn ) shutil . move ( fn , filename ) assert 0 == len ( os . listdir ( folder ) )
Move files out of sub-directories in the current working directory.
Move files out of sub - directories in the current working directory .
"""Move files out of sub-directories in the current working directory.""" # print("\n".join(os.listdir(filepath))) # folders = [os.path.join(filepath, fld) for fld in os.listdir(filepath)] # print(filepath + ":\n  " + "\n  ".join(folders)) # print("Sub-folders: ", u"\n".join(folders))