Next / Previous / Contents / Shipman's homepage

9.1. softlinks.py: Code prologue

The script starts with the usual “pound bang line”, a comment pointing to this documentation, and constants defining the script name and external version number.

softlinks.py
#!/usr/bin/env python
#================================================================
# softlinks.py:  Script to find all soft links a directory tree.
#   For documentation in "literate programming" style, see:
#     http://www.nmt.edu/~shipman/soft/pathinfo/
#----------------------------------------------------------------

SCRIPT_NAME  =  "softlinks.py"
EXTERNAL_VERSION  =  "1.0"

Next we import the usual modules for the system and operating system interfaces, and of course the PathInfo class.

softlinks.py
#================================================================
# Imports
#----------------------------------------------------------------
import sys, os
import pathinfo