Next / Previous / Contents / Shipman's homepage

7.1. bigfiles.py: Code prologue

The actual code for the bigfiles.py script starts with the Linux “pound bang line” that makes the script self-executing.

bigfiles.py
#!/usr/bin/env python
#================================================================
# bigfiles.py:  Script to show files in descending order by size.
#
# Do not edit this file directly.  It is mechanically extracted
# from the documentation:
#     http://www.nmt.edu/~shipman/soft/pathinfo/
#----------------------------------------------------------------

SCRIPT_NAME       =  "bigfiles.py"
EXTERNAL_VERSION  =  "1.1"

Next we need to import a few Python modules: sys for command line arguments and standard streams; os for numerous file- and directory-related functions; and of course pathinfo.py.

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