Popular recipes tagged "meta:requires=getopt"http://code.activestate.com/recipes/tags/meta:requires=getopt/2014-06-15T03:17:19-07:00ActiveState Code RecipesConvert Wordpress Export File to multiple html files (Python) 2014-06-15T03:17:19-07:00rrebotohttp://code.activestate.com/recipes/users/4190203/http://code.activestate.com/recipes/578892-convert-wordpress-export-file-to-multiple-html-fil/ <p style="color: grey"> Python recipe 578892 by <a href="/recipes/users/4190203/">rreboto</a> (<a href="/recipes/tags/xml/">xml</a>). </p> <p>Converts Wordpress Export Files (XML) to multiple html files and optionally uses tags and authors to create a directory structure.</p> Extract data from feedjit (Python) 2011-05-03T19:50:27-07:00jrovegnohttp://code.activestate.com/recipes/users/4170207/http://code.activestate.com/recipes/577683-extract-data-from-feedjit/ <p style="color: grey"> Python recipe 577683 by <a href="/recipes/users/4170207/">jrovegno</a> (<a href="/recipes/tags/data/">data</a>, <a href="/recipes/tags/feedjit/">feedjit</a>). Revision 2. </p> <p>Script to extract data from my live traffic feed from feedjit</p> Script para descargar videos desde http://www.chilevision.cl/ (Python) 2010-08-23T20:20:15-07:00jrovegnohttp://code.activestate.com/recipes/users/4170207/http://code.activestate.com/recipes/577367-script-para-descargar-videos-desde-httpwwwchilevis/ <p style="color: grey"> Python recipe 577367 by <a href="/recipes/users/4170207/">jrovegno</a> (<a href="/recipes/tags/chv/">chv</a>, <a href="/recipes/tags/download/">download</a>, <a href="/recipes/tags/tv/">tv</a>, <a href="/recipes/tags/video/">video</a>). </p> <p>Requiere: - aria2c - wget Extras: Ofrece Descargar el resto de los videos Uso: # Comillas requeridas, problema parser cvh_video.py "http://www.chilevision.cl/home/index.php?option=com_content&amp;task=view&amp;id=YYYYY&amp;Itemid=XXX"</p> Create book index. (Python) 2010-04-07T22:20:21-07:00Joseph Reaglehttp://code.activestate.com/recipes/users/4171494/http://code.activestate.com/recipes/577179-create-book-index/ <p style="color: grey"> Python recipe 577179 by <a href="/recipes/users/4171494/">Joseph Reagle</a> (<a href="/recipes/tags/book/">book</a>, <a href="/recipes/tags/index/">index</a>, <a href="/recipes/tags/python/">python</a>). Revision 3. </p> <p>Reads a simple enumeration of "topic (page#|see) subtopic" to create a formatted book index. </p> Script para transformar videos compatibles con reproductor MP4 (Python) 2010-04-30T18:23:39-07:00jrovegnohttp://code.activestate.com/recipes/users/4170207/http://code.activestate.com/recipes/577210-script-para-transformar-videos-compatibles-con-rep/ <p style="color: grey"> Python recipe 577210 by <a href="/recipes/users/4170207/">jrovegno</a> (<a href="/recipes/tags/ffmpge/">ffmpge</a>, <a href="/recipes/tags/mencoder/">mencoder</a>, <a href="/recipes/tags/split/">split</a>, <a href="/recipes/tags/video/">video</a>). Revision 3. </p> <p>Script para transformar videos compatibles con reproductor MP4: MP4 2GB FUJITEL 80MP4TV2 MP4-TV (AVIConverter_320X240_20FPS_EN Setup.exe) Requiere: - ffmpeg - mencoder Extras: Divide video en partes de 10 min Agrega subtítulos si existe el archivo file_name.srt Uso: avi2mp4 file_name.avi</p> Pyliner - Script to run arbitrary Python code on the command line (Python) 2011-07-29T13:22:54-07:00Drew Gulinohttp://code.activestate.com/recipes/users/4119417/http://code.activestate.com/recipes/577075-pyliner-script-to-run-arbitrary-python-code-on-the/ <p style="color: grey"> Python recipe 577075 by <a href="/recipes/users/4119417/">Drew Gulino</a> (<a href="/recipes/tags/awk/">awk</a>, <a href="/recipes/tags/oneliner/">oneliner</a>, <a href="/recipes/tags/perl/">perl</a>, <a href="/recipes/tags/pipe/">pipe</a>, <a href="/recipes/tags/python/">python</a>, <a href="/recipes/tags/sed/">sed</a>, <a href="/recipes/tags/sysadmin/">sysadmin</a>). </p> <p>A Python script that runs arbitrary Python scripts in an input loop. This allows one-liner Python scripts similarly to how Perl runs them (-l,-a,-n,-F, BEGIN, END)</p> <p>It provides additional syntax that allows multiline Python scripts to be run on a single line</p> tgraph - Simple ASCII graphing utility (Python) 2011-07-28T21:13:23-07:00Drew Gulinohttp://code.activestate.com/recipes/users/4119417/http://code.activestate.com/recipes/577077-tgraph-simple-ascii-graphing-utility/ <p style="color: grey"> Python recipe 577077 by <a href="/recipes/users/4119417/">Drew Gulino</a> (<a href="/recipes/tags/ascii/">ascii</a>, <a href="/recipes/tags/graph/">graph</a>, <a href="/recipes/tags/log/">log</a>, <a href="/recipes/tags/sysadmin/">sysadmin</a>, <a href="/recipes/tags/tail/">tail</a>, <a href="/recipes/tags/unix/">unix</a>). </p> <p>Takes a stream of numbers and outputs simple ASCII graphs of those numbers</p> Crop PDF File with pyPdf (Python) 2011-11-03T17:42:10-07:00ccpizzahttp://code.activestate.com/recipes/users/4170754/http://code.activestate.com/recipes/576837-crop-pdf-file-with-pypdf/ <p style="color: grey"> Python recipe 576837 by <a href="/recipes/users/4170754/">ccpizza</a> (<a href="/recipes/tags/pdf/">pdf</a>, <a href="/recipes/tags/pypdf/">pypdf</a>). Revision 3. </p> <p>This recipe was originally posted by <code>sjvr767</code> on <a href="http://www.mobileread.com/forums/showthread.php?t=25565" rel="nofollow">http://www.mobileread.com/forums/showthread.php?t=25565</a> and I decided to also make it available here.</p> <p>It uses pypdf (<a href="http://pybrary.net/pyPdf/%29" rel="nofollow">http://pybrary.net/pyPdf/)</a></p> <p>The script is supposed to be run like this:</p> <p><code>pdf_crop.py" -m "120 50 120 180" -i mypdf.pdf</code></p> <p>where the margins are <code>left top right bottom</code></p> <p>To install pyPdf try <code>easy_install pypdf</code>.</p> Simple FTP Mirror (Python) 2009-05-26T01:54:46-07:00Thimo Kraemerhttp://code.activestate.com/recipes/users/4169283/http://code.activestate.com/recipes/576777-simple-ftp-mirror/ <p style="color: grey"> Python recipe 576777 by <a href="/recipes/users/4169283/">Thimo Kraemer</a> (<a href="/recipes/tags/ftp/">ftp</a>, <a href="/recipes/tags/mirror/">mirror</a>). </p> <p>A simple tool to create a local or remote mirror over ftp.</p> Deep rename (Python) 2008-10-13T07:01:53-07:00David Pokornyhttp://code.activestate.com/recipes/users/4166601/http://code.activestate.com/recipes/576537-deep-rename/ <p style="color: grey"> Python recipe 576537 by <a href="/recipes/users/4166601/">David Pokorny</a> (<a href="/recipes/tags/files/">files</a>, <a href="/recipes/tags/programs/">programs</a>). Revision 2. </p> <p>Rename an identifier in all source files in a directory tree.</p> A modification of the blogger exemple for adding category (Python) 2008-08-20T21:08:06-07:00bussiere bussierehttp://code.activestate.com/recipes/users/4050557/http://code.activestate.com/recipes/576441-a-modification-of-the-blogger-exemple-for-adding-c/ <p style="color: grey"> Python recipe 576441 by <a href="/recipes/users/4050557/">bussiere bussiere</a> (<a href="/recipes/tags/api/">api</a>, <a href="/recipes/tags/blog/">blog</a>, <a href="/recipes/tags/blogger/">blogger</a>, <a href="/recipes/tags/blogspot/">blogspot</a>, <a href="/recipes/tags/google/">google</a>, <a href="/recipes/tags/tag/">tag</a>, <a href="/recipes/tags/tags/">tags</a>). Revision 3. </p> <p>Just because the exemple from google didn't add the category thanks from : <a href="http://coolnamehere.wordpress.com/2008/01/02/adding-categories-to-the-python-blogger-client/" rel="nofollow">http://coolnamehere.wordpress.com/2008/01/02/adding-categories-to-the-python-blogger-client/</a></p> sshfs mount tool (Python) 2008-06-24T07:31:22-07:00Sven Bröcklinghttp://code.activestate.com/recipes/users/4158983/http://code.activestate.com/recipes/573473-sshfs-mount-tool/ <p style="color: grey"> Python recipe 573473 by <a href="/recipes/users/4158983/">Sven Bröckling</a> . </p> <p>This script uses sshfs ans fusermount to mount ssh ressources to local filesystems. It makes it quick to mount with its function to guess a mountname.</p> Convert Wordpress Export File to multiple html files (Python) 2008-03-24T04:57:36-07:00Luiss Reihttp://code.activestate.com/recipes/users/4136205/http://code.activestate.com/recipes/551792-convert-wordpress-export-file-to-multiple-html-fil/ <p style="color: grey"> Python recipe 551792 by <a href="/recipes/users/4136205/">Luiss Rei</a> (<a href="/recipes/tags/xml/">xml</a>). </p> <p>Converts Wordpress Export Files (XML) to multiple html files and optionally uses tags and authors to create a directory structure.</p> Accurately find duplicate files (Python) 2008-03-18T10:17:01-07:00Keith Gaughanhttp://code.activestate.com/recipes/users/4134656/http://code.activestate.com/recipes/551777-accurately-find-duplicate-files/ <p style="color: grey"> Python recipe 551777 by <a href="/recipes/users/4134656/">Keith Gaughan</a> (<a href="/recipes/tags/algorithms/">algorithms</a>). </p> <p>Lists all duplicate file. This also demonstrates the effective use of generators and the use of functional composition in Python to solve the problem.</p> Disk space usage displayed as a tree (Python) 2008-01-27T00:36:27-08:00Thiagarajan Hariharanhttp://code.activestate.com/recipes/users/4118957/http://code.activestate.com/recipes/543270-disk-space-usage-displayed-as-a-tree/ <p style="color: grey"> Python recipe 543270 by <a href="/recipes/users/4118957/">Thiagarajan Hariharan</a> (<a href="/recipes/tags/sysadmin/">sysadmin</a>). </p> <p>Displays the disk space used by all the files/directories under the given directories. The depth to which the directories are displayed can be specified. There are three different options to select which files/directories are displayed - top N, cumulative percent contribution, individual percent contribution. The user can also control whether files should be shown along with directories. For each entry, in addition to its disk space, the percentage of the disk space of the parent directory that the entry consumes is also shown.</p> Dependencies graph of a script or module (Python) 2007-11-24T01:27:39-08:00Oliver Schoenbornhttp://code.activestate.com/recipes/users/1458241/http://code.activestate.com/recipes/535136-dependencies-graph-of-a-script-or-module/ <p style="color: grey"> Python recipe 535136 by <a href="/recipes/users/1458241/">Oliver Schoenborn</a> . </p> <p>This is a recipe to generate a diagram of dependencies of a script. It uses Python's modulefinder to get the dependencies, the two scripts available from <a href="http://www.tarind.com/depgraph.html" rel="nofollow">http://www.tarind.com/depgraph.html</a> to generate a dot file, and graphviz to convert the dot file to PNG. It also filters out a lot of noise and facilitates configurability.</p> Hex-dump port-forwarding network proxy server (Python) 2007-04-09T17:22:07-07:00Andrew Ehttp://code.activestate.com/recipes/users/4034885/http://code.activestate.com/recipes/502293-hex-dump-port-forwarding-network-proxy-server/ <p style="color: grey"> Python recipe 502293 by <a href="/recipes/users/4034885/">Andrew E</a> (<a href="/recipes/tags/network/">network</a>). Revision 5. </p> <p>A lightweight and portable way to hex-dump network traffic between network applications.</p> aebovl - Automatic Exposure Bracket Image Overlay (Python) 2007-05-12T19:19:44-07:00Jim Egglestonhttp://code.activestate.com/recipes/users/2894856/http://code.activestate.com/recipes/519636-aebovl-automatic-exposure-bracket-image-overlay/ <p style="color: grey"> Python recipe 519636 by <a href="/recipes/users/2894856/">Jim Eggleston</a> (<a href="/recipes/tags/graphics/">graphics</a>). </p> <p>aebovl is a script that overlays images of the same scene taken at different exposures. This brightens under-exposed areas and darkens over-exposed areas of the image. This generates a kind of poor man's HDR image.</p> IMAP mail server attachment handler (Python) 2006-10-10T03:39:22-07:00Suresh Kumarhttp://code.activestate.com/recipes/users/4005268/http://code.activestate.com/recipes/498189-imap-mail-server-attachment-handler/ <p style="color: grey"> Python recipe 498189 by <a href="/recipes/users/4005268/">Suresh Kumar</a> (<a href="/recipes/tags/files/">files</a>). </p> <p>This python script monitors the IMAP mail server for the given account and moves the mails with attachments to "Downloadedmails" folder in server after downloading the attachments to the individual directories on localmachine with the timestamp.</p> Decorator for main method (Python) 2006-12-18T09:47:06-08:00Matt Wallacehttp://code.activestate.com/recipes/users/2913776/http://code.activestate.com/recipes/499333-decorator-for-main-method/ <p style="color: grey"> Python recipe 499333 by <a href="/recipes/users/2913776/">Matt Wallace</a> (<a href="/recipes/tags/shortcuts/">shortcuts</a>). </p> <p>I found an article by Guido a while ago describing a generic main method for most Python programs (<a href="http://www.artima.com/weblogs/viewpost.jsp?thread=4829" rel="nofollow">http://www.artima.com/weblogs/viewpost.jsp?thread=4829</a>). Since then I found myself copying the same code into most of my programs. This recipe shows how to do the same thing with a decorator that makes the code much cleaner.</p>