#!/usr/local/bin/python # textunpack_py.txt renamed to textunpack.py ######################################################### # Usage: $> cd Desktop/IX # # $> textunpack IX_package_py_py.txt # # NB In terminal, the above should unpack the package # ######################################################### import sys # from textpack import marker # use common seperator key marker = '#' + ':'*10 + 'textpak=>' # IX Marker is different mlen = len(marker) # file names after markers for line in sys.stdin.readlines( ): # for all input lines if line[:mlen] != marker: print line, # write real lines else: sys.stdout = open(line[mlen:-1], 'w') # or make new output file #if end #for end #end textunpack_py.txt