Most viewed recipes tagged "utility"http://code.activestate.com/recipes/tags/utility/views/2017-01-08T17:48:57-08:00ActiveState Code RecipesHamming Error Correction Code (Python)
2016-07-23T07:58:14-07:00FB36http://code.activestate.com/recipes/users/4172570/http://code.activestate.com/recipes/580691-hamming-error-correction-code/
<p style="color: grey">
Python
recipe 580691
by <a href="/recipes/users/4172570/">FB36</a>
(<a href="/recipes/tags/encoding/">encoding</a>, <a href="/recipes/tags/engineering/">engineering</a>, <a href="/recipes/tags/math/">math</a>, <a href="/recipes/tags/mathematics/">mathematics</a>, <a href="/recipes/tags/utility/">utility</a>).
</p>
<p>Hamming(7,4) Error Correction Code (ECC).</p>
A command-line musical alarm clock (Python)
2016-12-30T19:06:32-08:00Vasudev Ramhttp://code.activestate.com/recipes/users/4173351/http://code.activestate.com/recipes/580739-a-command-line-musical-alarm-clock/
<p style="color: grey">
Python
recipe 580739
by <a href="/recipes/users/4173351/">Vasudev Ram</a>
(<a href="/recipes/tags/alarm/">alarm</a>, <a href="/recipes/tags/audio/">audio</a>, <a href="/recipes/tags/clock/">clock</a>, <a href="/recipes/tags/multimedia/">multimedia</a>, <a href="/recipes/tags/music/">music</a>, <a href="/recipes/tags/playsound/">playsound</a>, <a href="/recipes/tags/python/">python</a>, <a href="/recipes/tags/time/">time</a>, <a href="/recipes/tags/utilities/">utilities</a>, <a href="/recipes/tags/utility/">utility</a>).
</p>
<p>This is a simple musical alarm clock in Python. You pass a command-line argument specifying the time in minutes after which the alarm should go off. When that time arrives, it plays a musical sound.</p>
Quick-and-dirty Windows drive detector (Python)
2016-09-20T17:46:37-07:00Vasudev Ramhttp://code.activestate.com/recipes/users/4173351/http://code.activestate.com/recipes/580699-quick-and-dirty-windows-drive-detector/
<p style="color: grey">
Python
recipe 580699
by <a href="/recipes/users/4173351/">Vasudev Ram</a>
(<a href="/recipes/tags/drives/">drives</a>, <a href="/recipes/tags/sysadmin/">sysadmin</a>, <a href="/recipes/tags/system_programming/">system_programming</a>, <a href="/recipes/tags/utility/">utility</a>, <a href="/recipes/tags/windows/">windows</a>).
</p>
<p>This is a quick-and-dirty Python script to detect the currently available drives on your Windows PC.</p>
Find Duplicate Files (Python)
2014-10-12T21:14:05-07:00FB36http://code.activestate.com/recipes/users/4172570/http://code.activestate.com/recipes/578950-find-duplicate-files/
<p style="color: grey">
Python
recipe 578950
by <a href="/recipes/users/4172570/">FB36</a>
(<a href="/recipes/tags/dictionary/">dictionary</a>, <a href="/recipes/tags/directories/">directories</a>, <a href="/recipes/tags/directory/">directory</a>, <a href="/recipes/tags/disk/">disk</a>, <a href="/recipes/tags/file/">file</a>, <a href="/recipes/tags/files/">files</a>, <a href="/recipes/tags/utility/">utility</a>).
</p>
<p>Finds duplicate files which have same size and same content in the same directory or two different directories.</p>
A binary file split utility in Python (Python)
2016-04-07T18:19:35-07:00Vasudev Ramhttp://code.activestate.com/recipes/users/4173351/http://code.activestate.com/recipes/580637-a-binary-file-split-utility-in-python/
<p style="color: grey">
Python
recipe 580637
by <a href="/recipes/users/4173351/">Vasudev Ram</a>
(<a href="/recipes/tags/binary/">binary</a>, <a href="/recipes/tags/commandline/">commandline</a>, <a href="/recipes/tags/linux/">linux</a>, <a href="/recipes/tags/python/">python</a>, <a href="/recipes/tags/unix/">unix</a>, <a href="/recipes/tags/utility/">utility</a>, <a href="/recipes/tags/windows/">windows</a>).
</p>
<p>This recipe shows how to create a simple binary file split utility in Python.</p>
<p>It takes two command line arguments: 1) the name of the input file to split , 2) the number of bytes per file into which to split the input.</p>
Image Resizer (Python)
2016-05-22T16:45:52-07:00FB36http://code.activestate.com/recipes/users/4172570/http://code.activestate.com/recipes/580663-image-resizer/
<p style="color: grey">
Python
recipe 580663
by <a href="/recipes/users/4172570/">FB36</a>
(<a href="/recipes/tags/image/">image</a>, <a href="/recipes/tags/images/">images</a>, <a href="/recipes/tags/utilities/">utilities</a>, <a href="/recipes/tags/utility/">utility</a>).
Revision 2.
</p>
<p>Image resizer/converter command-line utility.</p>
Countdown Timer (Python)
2012-12-06T03:24:35-08:00Stephen Chappellhttp://code.activestate.com/recipes/users/2608421/http://code.activestate.com/recipes/578363-countdown-timer/
<p style="color: grey">
Python
recipe 578363
by <a href="/recipes/users/2608421/">Stephen Chappell</a>
(<a href="/recipes/tags/demonstration/">demonstration</a>, <a href="/recipes/tags/sound/">sound</a>, <a href="/recipes/tags/timer/">timer</a>, <a href="/recipes/tags/utility/">utility</a>).
</p>
<p>Ever wanted to set a timer that went off after a specified number of hours / minutes / seconds? This Windows recipe runs on the command line and does that with the arguments it accepts. Simple but effective, the program works well for remembering food in the oven among other things.</p>
CSV to Flat File Converter (Python)
2015-08-02T17:31:59-07:00FB36http://code.activestate.com/recipes/users/4172570/http://code.activestate.com/recipes/579091-csv-to-flat-file-converter/
<p style="color: grey">
Python
recipe 579091
by <a href="/recipes/users/4172570/">FB36</a>
(<a href="/recipes/tags/csv/">csv</a>, <a href="/recipes/tags/files/">files</a>, <a href="/recipes/tags/utility/">utility</a>).
</p>
<p>Converts a CSV file to a flat file (table).</p>
Trap KeyboardInterrupt and EOFError for graceful program termination (Python)
2016-11-13T20:17:03-08:00Vasudev Ramhttp://code.activestate.com/recipes/users/4173351/http://code.activestate.com/recipes/580718-trap-keyboardinterrupt-and-eoferror-for-graceful-p/
<p style="color: grey">
Python
recipe 580718
by <a href="/recipes/users/4173351/">Vasudev Ram</a>
(<a href="/recipes/tags/ascii/">ascii</a>, <a href="/recipes/tags/error/">error</a>, <a href="/recipes/tags/exception/">exception</a>, <a href="/recipes/tags/handler/">handler</a>, <a href="/recipes/tags/shutdown/">shutdown</a>, <a href="/recipes/tags/terminate/">terminate</a>, <a href="/recipes/tags/utilities/">utilities</a>, <a href="/recipes/tags/utility/">utility</a>).
</p>
<p>This recipe shows how to trap the KeyboardInterrupt and EOFError Python exceptions so that they do not crash your program. As a vehicle to show this, it uses a small Python utility that shows the ASCII code for any ASCII character you type.</p>
Process Delimiter-Separated Values data with Python (Python)
2016-11-24T23:57:35-08:00Vasudev Ramhttp://code.activestate.com/recipes/users/4173351/http://code.activestate.com/recipes/580722-process-delimiter-separated-values-data-with-pytho/
<p style="color: grey">
Python
recipe 580722
by <a href="/recipes/users/4173351/">Vasudev Ram</a>
(<a href="/recipes/tags/command/">command</a>, <a href="/recipes/tags/commandline/">commandline</a>, <a href="/recipes/tags/data/">data</a>, <a href="/recipes/tags/dsv/">dsv</a>, <a href="/recipes/tags/file/">file</a>, <a href="/recipes/tags/python/">python</a>, <a href="/recipes/tags/utilities/">utilities</a>, <a href="/recipes/tags/utility/">utility</a>).
</p>
<p>This recipe shows how to read and process delimiter-separated values (DSV) data with a Python command-line program. It provides two ways of specifying the delimiter character, by an ASCII character or an ASCII code, which makes it more flexible than allowing only a character. It allows the DSV data to be specified as one or more filenames on the command line, or given via the standard input of the program.</p>
Generate a PDF cheat sheet for converting 0 to 255 between bin / oct / dec / hex (Python)
2016-10-10T20:40:48-07:00Vasudev Ramhttp://code.activestate.com/recipes/users/4173351/http://code.activestate.com/recipes/580706-generate-a-pdf-cheat-sheet-for-converting-0-to-255/
<p style="color: grey">
Python
recipe 580706
by <a href="/recipes/users/4173351/">Vasudev Ram</a>
(<a href="/recipes/tags/binary/">binary</a>, <a href="/recipes/tags/conversion/">conversion</a>, <a href="/recipes/tags/decimal/">decimal</a>, <a href="/recipes/tags/hexadecimal/">hexadecimal</a>, <a href="/recipes/tags/octal/">octal</a>, <a href="/recipes/tags/pdfwriter/">pdfwriter</a>, <a href="/recipes/tags/pdf_generation/">pdf_generation</a>, <a href="/recipes/tags/python/">python</a>, <a href="/recipes/tags/utility/">utility</a>, <a href="/recipes/tags/xtopdf/">xtopdf</a>).
</p>
<p>This recipe shows how to generate a PDF cheat sheet, that contains a table for conversion of the numbers 0 to 255 (the numbers that can fit in one byte) between binary, octal, decimal and hexadecimal representations. The table has four columns, one for each of those bases, and 256 rows, for the numbers 0 to 255.</p>
<p>TO use the table, you can look for a number, say in decimal, in the Dec(imal) column (or use the search function of your PDF viewer), then when you find it in some row, just look at the other 3 columns in that row, to find the value of that number in binary, octal and hexadecimal. And use the same procedure if starting with a number in any of the other three bases.</p>
data_dump.py, like the Unix od (octal dump) command (Python)
2015-11-01T12:43:38-08:00Vasudev Ramhttp://code.activestate.com/recipes/users/4173351/http://code.activestate.com/recipes/579120-data_dumppy-like-the-unix-od-octal-dump-command/
<p style="color: grey">
Python
recipe 579120
by <a href="/recipes/users/4173351/">Vasudev Ram</a>
(<a href="/recipes/tags/data/">data</a>, <a href="/recipes/tags/dump/">dump</a>, <a href="/recipes/tags/hexadecimal/">hexadecimal</a>, <a href="/recipes/tags/linux/">linux</a>, <a href="/recipes/tags/octal/">octal</a>, <a href="/recipes/tags/od/">od</a>, <a href="/recipes/tags/representation/">representation</a>, <a href="/recipes/tags/unix/">unix</a>, <a href="/recipes/tags/utility/">utility</a>, <a href="/recipes/tags/windows/">windows</a>).
</p>
<p>This recipe implements a simple data dump tool, roughly like the od command of Unix, which stands for octal dump (though od can also dump data in hex and other formats). This tool dumps data in character and hex formats, in this version. This is data_dump.py version 1.</p>
Shortcut Utility (Python)
2015-03-29T20:45:57-07:00FB36http://code.activestate.com/recipes/users/4172570/http://code.activestate.com/recipes/579041-shortcut-utility/
<p style="color: grey">
Python
recipe 579041
by <a href="/recipes/users/4172570/">FB36</a>
(<a href="/recipes/tags/desktop/">desktop</a>, <a href="/recipes/tags/directories/">directories</a>, <a href="/recipes/tags/directory/">directory</a>, <a href="/recipes/tags/file/">file</a>, <a href="/recipes/tags/files/">files</a>, <a href="/recipes/tags/tkinter/">tkinter</a>, <a href="/recipes/tags/ui/">ui</a>, <a href="/recipes/tags/utilities/">utilities</a>, <a href="/recipes/tags/utility/">utility</a>).
</p>
<p>I dislike filling my desktop with shortcut icons in Windows.
This code enables creating shortcuts in a CSV file.</p>
Directory Pruner 2 (Python)
2011-04-05T01:37:14-07:00Stephen Chappellhttp://code.activestate.com/recipes/users/2608421/http://code.activestate.com/recipes/577633-directory-pruner-2/
<p style="color: grey">
Python
recipe 577633
by <a href="/recipes/users/2608421/">Stephen Chappell</a>
(<a href="/recipes/tags/delete/">delete</a>, <a href="/recipes/tags/directory/">directory</a>, <a href="/recipes/tags/file/">file</a>, <a href="/recipes/tags/gui/">gui</a>, <a href="/recipes/tags/utility/">utility</a>).
</p>
<p>This program builds on work done in <a href="http://code.activestate.com/recipes/577632/">recipe 577632</a>, adds new options to the context menu, and experiments with threading the GUI. Directory Pruner 2 appear to work better on Windows 7 while Directory Pruner 1 (the non-threaded version) performs better on Windows XP. Those are the primary platforms on which the two programs have been tested. Please use these applications at your own risk.</p>
<p>If you do not like something about this recipe and want to vote it down, please let everyone what you find fault with, how you would improve it, and an example of the code you would improve.</p>
A utility like Unix seq (command-line), in Python (Python)
2017-01-08T17:48:57-08:00Vasudev Ramhttp://code.activestate.com/recipes/users/4173351/http://code.activestate.com/recipes/580744-a-utility-like-unix-seq-command-line-in-python/
<p style="color: grey">
Python
recipe 580744
by <a href="/recipes/users/4173351/">Vasudev Ram</a>
(<a href="/recipes/tags/bash/">bash</a>, <a href="/recipes/tags/command/">command</a>, <a href="/recipes/tags/commandline/">commandline</a>, <a href="/recipes/tags/linux/">linux</a>, <a href="/recipes/tags/script/">script</a>, <a href="/recipes/tags/seq/">seq</a>, <a href="/recipes/tags/sequence/">sequence</a>, <a href="/recipes/tags/shell/">shell</a>, <a href="/recipes/tags/unix/">unix</a>, <a href="/recipes/tags/utilities/">utilities</a>, <a href="/recipes/tags/utility/">utility</a>).
</p>
<p>This recipe shows how to create a utility like Unix seq (command-line), in Python.
seq is described here: </p>
<p><a href="https://en.wikipedia.org/wiki/Seq_%28Unix%29" rel="nofollow">https://en.wikipedia.org/wiki/Seq_(Unix)</a></p>
<p>but briefly, it is a command-line utility that takes 1 to 3 arguments (some being optional), the start, stop and step, and prints numbers from the start value to the stop value, on standard output. So seq has many uses in bigger commands or scripts; a common category of use is to quickly generate multiple filenames or other strings that contain numbers in them, for exhaustive testing, load testing or other purposes. A similar command called jot is found on some Unix systems.</p>
<p>This recipe does not try to be exactly the same in functionality as seq. It has some differences. However the core functionality of generating integer sequences is the same (but without steps other than 1 for the range).</p>
<p>More details and sample output are here:</p>
<p><a href="https://jugad2.blogspot.in/2017/01/an-unix-seq-like-utility-in-python.html" rel="nofollow">https://jugad2.blogspot.in/2017/01/an-unix-seq-like-utility-in-python.html</a></p>
<p>The code is below.</p>
Unix-like split command in Python (simple version) (Python)
2016-03-14T22:35:05-07:00Vasudev Ramhttp://code.activestate.com/recipes/users/4173351/http://code.activestate.com/recipes/580620-unix-like-split-command-in-python-simple-version/
<p style="color: grey">
Python
recipe 580620
by <a href="/recipes/users/4173351/">Vasudev Ram</a>
(<a href="/recipes/tags/commandline/">commandline</a>, <a href="/recipes/tags/linux/">linux</a>, <a href="/recipes/tags/python/">python</a>, <a href="/recipes/tags/shell/">shell</a>, <a href="/recipes/tags/split/">split</a>, <a href="/recipes/tags/splitting/">splitting</a>, <a href="/recipes/tags/unix/">unix</a>, <a href="/recipes/tags/utilities/">utilities</a>, <a href="/recipes/tags/utility/">utility</a>, <a href="/recipes/tags/windows/">windows</a>).
</p>
<p>This recipe shows how to create a simple version of the Unix split command in Python. The split command splits an input file into multiple smaller files, the size of each of which is specified by a command-line argument giving the number of lines per file. This is useful for multiple purposes, such as editing large files in pieces, backing up files to small capacity storage devices, sending files across the network, etc.</p>
Directory & File Counter (Python)
2012-07-07T22:07:51-07:00Stephen Chappellhttp://code.activestate.com/recipes/users/2608421/http://code.activestate.com/recipes/578197-directory-file-counter/
<p style="color: grey">
Python
recipe 578197
by <a href="/recipes/users/2608421/">Stephen Chappell</a>
(<a href="/recipes/tags/archive/">archive</a>, <a href="/recipes/tags/old/">old</a>, <a href="/recipes/tags/utility/">utility</a>).
</p>
<p>This recipe manually counts the number of sub-directories and files can be found in a directory. It was an experimental program from long ago used to learn more about Python. This is committed for archival to be run under Python 2.5 or later versions.</p>
Directory Pruner 1 (Python)
2011-04-05T00:56:25-07:00Stephen Chappellhttp://code.activestate.com/recipes/users/2608421/http://code.activestate.com/recipes/577632-directory-pruner-1/
<p style="color: grey">
Python
recipe 577632
by <a href="/recipes/users/2608421/">Stephen Chappell</a>
(<a href="/recipes/tags/delete/">delete</a>, <a href="/recipes/tags/directory/">directory</a>, <a href="/recipes/tags/file/">file</a>, <a href="/recipes/tags/gui/">gui</a>, <a href="/recipes/tags/utility/">utility</a>).
</p>
<p>This program is an extension of <a href="http://code.activestate.com/recipes/577567/">recipe 577567</a> in that it not only allows one to find a directory's size but also remove files based on a context menu. The directory pruner has been used by my roommate to free up room on his hard drive and also by several friends that wished to remove games and other unnecessary program that were taking up their space. Right-click on found directories to review your options.</p>
<p>If you wish to vote this recipe down, please post a comment at the bottom telling me how you would improve the utility.</p>
One-click Copy of CD/DVD for Windows (Python)
2010-03-16T11:35:23-07:00Jack Trainorhttp://code.activestate.com/recipes/users/4076953/http://code.activestate.com/recipes/577118-one-click-copy-of-cddvd-for-windows/
<p style="color: grey">
Python
recipe 577118
by <a href="/recipes/users/4076953/">Jack Trainor</a>
(<a href="/recipes/tags/file/">file</a>, <a href="/recipes/tags/shortcut/">shortcut</a>, <a href="/recipes/tags/utility/">utility</a>, <a href="/recipes/tags/windows/">windows</a>).
</p>
<p>CdCopy: Windows utility for copying contents of a CD/DVD to local hard disk with
most free space to a directory named for full name of CD/DVD.</p>
Windows TREE Emulator (Python)
2010-03-08T12:57:10-08:00Stephen Chappellhttp://code.activestate.com/recipes/users/2608421/http://code.activestate.com/recipes/577091-windows-tree-emulator/
<p style="color: grey">
Python
recipe 577091
by <a href="/recipes/users/2608421/">Stephen Chappell</a>
(<a href="/recipes/tags/directory/">directory</a>, <a href="/recipes/tags/listing/">listing</a>, <a href="/recipes/tags/tree/">tree</a>, <a href="/recipes/tags/utility/">utility</a>).
Revision 2.
</p>
<p>Windows has a nice command line program capable of printing out a tree of the the folders, sub-folders, and possibly the files of a directory. The tool below mimics a behavioral subset of TREE, Microsoft's inspiring utility. This version is designed to output a similar tree and should be compatible on Windows, Linux, and Macintosh. In case it is not used correctly, a simple usage message will be printed (without notes on the optional "/F" switch). ASCII characters are used.</p>