Popular Python recipes tagged "os"http://code.activestate.com/recipes/langs/python/tags/os/2014-02-08T22:12:24-08:00ActiveState Code RecipesIndexing text files with Python (Python)
2014-02-08T22:12:24-08:00Vasudev Ramhttp://code.activestate.com/recipes/users/4173351/http://code.activestate.com/recipes/578828-indexing-text-files-with-python/
<p style="color: grey">
Python
recipe 578828
by <a href="/recipes/users/4173351/">Vasudev Ram</a>
(<a href="/recipes/tags/os/">os</a>).
</p>
<p>This recipe shows how to process a text file in order to create an index of the words in it. The index created is a separate text file, and consists of one entry (which is one line) per unique word in the file. The first item in the line is the word itself, and the subsequent items are the line numbers on which that word occurs in the text file being processed. The words and line numbers are separated by spaces.</p>
Recursive Multimedia (audio, video) M3U Playlist Generator (Python)
2014-02-08T01:03:36-08:00Mano Bastardohttp://code.activestate.com/recipes/users/4182040/http://code.activestate.com/recipes/578771-recursive-multimedia-audio-video-m3u-playlist-gene/
<p style="color: grey">
Python
recipe 578771
by <a href="/recipes/users/4182040/">Mano Bastardo</a>
(<a href="/recipes/tags/audio/">audio</a>, <a href="/recipes/tags/ffmpeg/">ffmpeg</a>, <a href="/recipes/tags/generate/">generate</a>, <a href="/recipes/tags/m3u/">m3u</a>, <a href="/recipes/tags/mulitmedia/">mulitmedia</a>, <a href="/recipes/tags/os/">os</a>, <a href="/recipes/tags/playlist/">playlist</a>, <a href="/recipes/tags/python/">python</a>, <a href="/recipes/tags/system/">system</a>, <a href="/recipes/tags/video/">video</a>).
Revision 9.
</p>
<p>Generate an m3u playlist searching recursively
for multimedia files (video or audio) in the given
directory.
Information from ID3 tags will be extracted for audio
files with <a href="http://en.wikipedia.org/wiki/FFmpeg">FFmpeg</a> available.</p>
Run some command every x seconds (Python)
2013-09-24T13:26:19-07:00Rutger Saalminkhttp://code.activestate.com/recipes/users/4187940/http://code.activestate.com/recipes/578673-run-some-command-every-x-seconds/
<p style="color: grey">
Python
recipe 578673
by <a href="/recipes/users/4187940/">Rutger Saalmink</a>
(<a href="/recipes/tags/command/">command</a>, <a href="/recipes/tags/iterative/">iterative</a>, <a href="/recipes/tags/os/">os</a>, <a href="/recipes/tags/run/">run</a>).
</p>
<p>Sometimes it comes in handy to run some command every minute or hour. For example, have some process check your ip address every minute with 'ifconfig' or run some purgescript at midnight through 'sqlplus.exe @purge_aux_table'.</p>