"Newbie" questions - "unique" sorting ?
Cousin Stanley
CousinStanley at hotmail.com
Fri Jun 20 07:23:24 EDT 2003
| Perhaps I did something wrong ? Does anyone here know how
| to make things work ? This is what I got in a DOS window in '98 :
| C:\Python>python word_list.py word_source.txt >word_target.txt
|
John ...
The version you have should run without any command-line arguments
but requires that the input file be named word_source.txt ...
python word_list.py
The file names are hard-coded in the program
and would require editing these lines to change
the file names ...
path_in = 'word_source.txt'
path_dups = 'word_dups.txt'
path_out = 'word_target.txt'
I've up-loaded a second version that does require arguments
for path_in and path_out but leaves the temporary dups file
named as word_dups.txt ...
python word_list.py somefile_In.txt somefile_Out.txt
You can use any file names and
you don't need the ">" redirection character ...
The only changes in the program are in the lines posted above
which now read ...
path_in = sys.argv[ 1 ]
path_dups = 'word_dups.txt'
path_out = sys.argv[ 2 ]
If you change these two lines,
there is no reason to download again ...
--
Cousin Stanley
Human Being
Phoenix, Arizona
More information about the Python-list
mailing list