"Newbie" questions - "unique" sorting ?

Cousin Stanley CousinStanley at hotmail.com
Fri Jun 20 21:38:53 EDT 2003


John ...

On the version you have,
without changing anything in the program
try ...

    delete word_dups.txt
    delete word_target.txt

    rename your_Input_File.txt word_source.txt

    python word_list.py

    This single run should produce 2 output files ...

      word_dups.txt ...... contains ALL    words including dups
      word_target.txt .... contains Unique words excluding dups

The newer version I uploaded does the same,
only you specify the name of the source input
and target output files on the command line
and don't have to rename your source input file...

    python word_list.py xSource.txt xTarget.txt

I've only used the names xSource.txt and xTarget.txt
as an attempt to try and include a bit of implicit
documentation ...

For example, with the newer version where file names
are specified on the command line we could use a bit
of Pythonic alchemy to produce a finished Gold product
with no dups from the original Lead input ...

    python word_list.py Lead.txt Gold.txt

-- 
Cousin Stanley
Human Being
Phoenix, Arizona






More information about the Python-list mailing list