Skip to content

Instantly share code, notes, and snippets.

View AndrewPa's full-sized avatar

Andrew Papadopoli AndrewPa

View GitHub Profile
@AndrewPa
AndrewPa / file_hoover.py
Created June 25, 2013 03:18
A little test function called "File Hoover". It's a recursive function that pulls the names of single files out of arbitrarily-nested subdirectories. I'm sure it's already been made thousands of times, but it was good practice. It's also my first "real" Python code! I threw in some basic FTP functions; I'm going to use a similar function to retr…
#!/bin/python
## Filename retriever:
import os
def hoover():
for subdir in os.listdir('.'):
try:
os.chdir(str(subdir))