All Questions
Tagged with file-system python-2.x
21 questions
1
vote
1
answer
82
views
Checks for removing files after X amount of days
I am trying to remove files in my directory if they are over 30 days. However, I don't know what other checks I need to do. The examples I found online weren't very thorough besides just subtracting ...
3
votes
0
answers
81
views
Python script that getting list of all files with specific ext starting from the current folder. Using timer for reporting about the process
I am using a function that returns a list of all files (full path for each of them) with the given extension in the given folder and all subfolders.
As the process is quite long and user can get ...
5
votes
2
answers
311
views
Program to delete directories that do not contain a file
I'm an intern and have an ETL project I'm doing in python.
Part of it is to make sure after I move files I delete empty directories.
I wrote this code to clean up directories that are empty and in ...
5
votes
1
answer
104
views
Combining CSV files of simulation results
This script is a subset of a larger script where I have the output of many test simulations in the form of CSVs. Each file starts with the model name and includes the number of elements in my file. ...
1
vote
1
answer
2k
views
List directories, subdirectories and files, while ignoring some dirs
In my application, the user may or may not want to ignore some directories. I can do that, but it seems like I am repeating myself. Does anyone have an idea to refactor that?
...
1
vote
1
answer
60
views
Create directories for outputs based on setting
I have a dict with a series of bools to specify if a particular aspect of my program will be run (e.g. settings['A'] and ...
4
votes
3
answers
3k
views
os.walk listing directory
I use this script to get a list of all my photos in a folder and its subfolders. However, the program seems to be really slow.
There are 50,000 .jpg pictures in this folder and subfolders. I can ...
8
votes
1
answer
849
views
Track changes inside a directory
I have built a Python 2.7 script to track all file and subdir changes inside a nominated directory. It is used with directories that have multiple levels of subdirectories, hundreds of thousands of ...
5
votes
1
answer
1k
views
Random MP3 Selector and Player
So, I am either a glutton for punishment, or I have no life, but I wrote a script to answer a question over on Ask Ubuntu as a solution for selecting a random MP3 file in a given directory, and ...
2
votes
1
answer
4k
views
Recursively list files within a directory
I have the following code to recursively list files within a directory:
...
2
votes
2
answers
617
views
Decompress files files in a directory recursively
Currently I'm trying to redo this code to avoid the breaking line because of the 80 characters rule:
...
3
votes
1
answer
147
views
ArcPy script to analyze land use in counties
We have written a Python script using arcpy modules. It is was written by Python beginners and many parts of the code are written in 'unpythonic way'. The goal is ...
1
vote
1
answer
1k
views
Foldify - A Python Folder Tree Manager Tool
The goal was to create a tool to help manage folders structures, and allow me to create templates of this folders and store them as a JSON template.
The following functionalities have been implemented:...
2
votes
1
answer
1k
views
Simple program that copies just new files from one directory to another
I'm doing a Python course for beginners, and the last assignment was to create a program using shutil and wxpython that can copy new files (created in the last 24 hours) from one folder into another, ...
7
votes
3
answers
4k
views
Accessing files in a child directory in Python 2.7.x
I have written the below script for use in Python 2.7.x. In essence, I want the script to access a folder contained within the directory the script is and then add all files contained within to a list....