Each database can be restored via the MySQL command line tool by calling gzipped archive.
The tables of each database being backed up are locked, preserving data integrity.
While this does temporarily prevent writes to the tables, the impact is reduced by backing up each database separately.
This script backups all tables accessible to the MySQL user that it is configured to use.
That means this...
This recipe provides a couple of cross-platform utility functions, 'open' and 'mailto', for opening files and URLs in the registered default application and for sending e-mails using the user's preferred composer.
The python standard library...
A simple function to change the background/foreground color of characters written to a Windows console (command line). Requires ctypes, which is included with Python version 2.5 or later.
Here is a convenient way to create, parse, alter, and write .pc files. Just pass PkgConfig() a file-like object, or None to start fresh. Print the object to create a new .pc file.
Some people might want even more functionality, but I...
This module provides easy control of cd drives on Win32 machines. Using the Python Win32 Extensions, the module automatically detects all cd drives and defaults to the first drive found or to a programmer specified drive. Methods include eject()...
RegObj is an ActiveX server for registry manipulation that can be driven using Python. Its object model provides significant advantages over the use of the
This recipe provides a quick way to search and retrieve information about installed Python packages and modules in your Python installation. It classifies
the retrieved module information into types (built-in, source files, c-extensions etc)...
Generate a Windows command file that executes a Python program. Typing
'my_prog arg1 is easier than typing 'python C:\PyLib\my_prog.py arg1'.
Needed because Windows does not support '#!/bin/env python' as the first
line of the...
One common aspect of programming is calling executables and processing results. It is not as easy or elegant to do this in Python as it is in a shell scripting language, such as bash. This script implements a shell-like module in Python which...
This code eliminates the need to convert line endings when moving .py modules between OSes. Put in your sitecustomize.py, anywhere on sys.path, and you'll be able to import Python modules with any of Unix, Mac, or Windows line endings, on any OS.
atexit handlers are not called when a process is killed, this recipe show how to fix that.
Webdav is useful to get information on something in exchange. Often you need to know what you can ask for. Here is a simple recipe to get a list of the attributes available for a specific item.
DateTimeSyncer synchronizes computer's current date and time with Daylight Savings adjustment
directly without depending on operating system or Python's time.localtime().
This allows programmers to update Daylight Savings Time...
This class implement the features of retrieve dsn and tables list on win32. win32all not include this features.
This recipe creates a class to allow access to variables stored in pkg-config files ( or '.pc' files ). This is usefull in conjunction with distutils to get correct information for compiling external C/C++ modules. Variable substitution is...
Distutil's bdist_wininst installers offer uninstallation support for Python extensions, many developers however only distribute sources in zip or tar.gz format. The typical steps to install such a distribution are:
- download the file
Most of the time I just want to either read or write one value to the registry. Here are two functions: ReadRegistryValue and WriteRegistryValue plus a few helpers.
From PEP 42...
I wonder if it would be a good idea to have a new kind of
temporary file that stored data in memory unless:
- The data exceeds some size, or
- Somebody asks for a fileno.
This script asks for a base directory and then changes all xrefs in all drawings in all subdirectories so that they use relative paths. To use it just copy it somewhere in your target directory structure and run.
This is a way to tell if your timezone is currently in daylight savings time. (Hint: time.daylight doesn't do this)