Small program ideas

Dave Angel davea at davea.name
Wed Feb 27 04:27:11 CET 2013


On 02/26/2013 05:47 PM, eli m wrote:
> On Monday, February 25, 2013 10:15:24 PM UTC-8, Dave Angel wrote:
>> On 02/25/2013 10:48 PM, eli m wrote:
>>
>>> On Friday, February 15, 2013 7:22:41 PM UTC-8, eli m wrote:
>>
>>>> Any small program ideas? I would prefer to stick to command line ones. Thanks.
>>
>>>
>>
>>> Thank you guys for the suggestions. Any more?
>>
>>>
>>
>>
>>
>> There are all kinds of things you could do.  First, consider something
>>
>> that might be useful.
>>
>>
>>
>> 1) checksum all the files in a directory tree, using various checksum
>>
>> algorithms.
>>
>>
>>
>> 2) Convert one kind of file to another.
>>
>>   <snip>
>>
>
> How hard would it be to change one file to another and would it be a small-medium sized program?
>

Depends on the kinds of the two files.  To convert an Excel spreadsheet 
file to a csv file might be a lot of work, thousands of lines, not to 
mention having to dig up the docs.  But to convert a DOS text file (with 
lines ending cr/lf) into a Unix text file (with lines ending lf)  would 
be a dozen lines, shrinkable to 3 with lots of experience.  (And I'd 
probably prefer the dozen line version)

Other conversions might be somewhere in between.  You could do data 
compression, like bzip, using the modules in the standard library.

Note that utility commands may exist, but it can be instructive to do it 
"by hand" anyway, to learn how.

Look at the following libraries, and see how you could write the glue to 
make them into useful file conversion utilities.  Then test them against 
the standard equivalents, to make sure your code really work.
alib, gzip, bz2, zipfile, tarfile, csv, ConfigParser, robotparser, ...



-- 
DaveA



More information about the Python-list mailing list