Skip to content

Instantly share code, notes, and snippets.

@TutorialDoctor
TutorialDoctor / organize_files.py
Last active November 23, 2024 21:36
Automatically organize files and folders on your computer using python.
# Drop this folder in a directory and run it. It will organize all of your files into folder by first letter
# This was inspired by my mom (maybe you can relate?)
# This took much longer than I thought it would to figure this out, but I learned which modules are good for file handling.
# It took about an hour to come up with the base of the program, which organizes files by first letter or number
# I would like it to eventually recursively go into folders getting files and organizing them into folders.
# This was made using a straight ahead approach.
# For beginners, a directory is a folder.
# By the Tutorial Doctor
# Sun Dec 20 23:40:49 EST 2015
#------------------------------------------------------------------------------
@tzermias
tzermias / pipelines.py
Last active March 14, 2024 23:35
Scrapy MySQL pipeline. Just a mirror to the asynchronous MySQL pipeline. Copy-paste it directly to pipelines.py. Database credentials are stored in settings.py. Based on http://snipplr.com/view/66986/
import MySQLdb.cursors
from twisted.enterprise import adbapi
from scrapy.xlib.pydispatch import dispatcher
from scrapy import signals
from scrapy.utils.project import get_project_settings
from scrapy import log
SETTINGS = get_project_settings()