Popular recipes tagged "script" but not "bash"http://code.activestate.com/recipes/tags/script-bash/2016-05-27T05:28:21-07:00ActiveState Code RecipesShutdown your computer via E-mail - Python (Python)
2016-05-27T05:28:21-07:00Burak Tandoganhttp://code.activestate.com/recipes/users/4191373/http://code.activestate.com/recipes/580668-shutdown-your-computer-via-e-mail-python/
<p style="color: grey">
Python
recipe 580668
by <a href="/recipes/users/4191373/">Burak Tandogan</a>
(<a href="/recipes/tags/computer/">computer</a>, <a href="/recipes/tags/email/">email</a>, <a href="/recipes/tags/mail/">mail</a>, <a href="/recipes/tags/python/">python</a>, <a href="/recipes/tags/script/">script</a>, <a href="/recipes/tags/shutdown/">shutdown</a>).
Revision 2.
</p>
<p>Shutdown your computer via E-mail.</p>
<p>Basically, send an e-mail to your e-mail address SHUTDOWN YOURSELF {YEAR-MONTH-DATE} format in Subject. Your mail's SUBJECT must be in SHUTDOWN YOURSELF {YEAR-MONTH-DATE} format.</p>
A script to automate installing MTS Mblaze UI in linux (Bash)
2015-07-29T18:26:59-07:00Emil george jameshttp://code.activestate.com/recipes/users/4191910/http://code.activestate.com/recipes/579039-a-script-to-automate-installing-mts-mblaze-ui-in-l/
<p style="color: grey">
Bash
recipe 579039
by <a href="/recipes/users/4191910/">Emil george james</a>
(<a href="/recipes/tags/internet/">internet</a>, <a href="/recipes/tags/linux/">linux</a>, <a href="/recipes/tags/script/">script</a>, <a href="/recipes/tags/shell/">shell</a>, <a href="/recipes/tags/web/">web</a>).
</p>
<p>An automate shell linux script to install mts mblaze ui application in all linux distros.this shell script automatically install the mts mblaze ui in your linux systems .installation script will setup everything need to choose some option interactively from setup.Script can work for all linux environments.</p>
Clear Only Project Modules (Python)
2014-12-17T19:03:15-08:00Cornelius Jatniel Prinsloohttp://code.activestate.com/recipes/users/4191358/http://code.activestate.com/recipes/578982-clear-only-project-modules/
<p style="color: grey">
Python
recipe 578982
by <a href="/recipes/users/4191358/">Cornelius Jatniel Prinsloo</a>
(<a href="/recipes/tags/clear/">clear</a>, <a href="/recipes/tags/modules/">modules</a>, <a href="/recipes/tags/project/">project</a>, <a href="/recipes/tags/reload/">reload</a>, <a href="/recipes/tags/script/">script</a>, <a href="/recipes/tags/startup/">startup</a>).
</p>
<p>Useful for python sessions that have a long startup time
because of external dependancies
[In my case that would be pygame and pymunk]
I've got a slow computer so it takes a while to startup
this is the solution I came up with</p>
<p>import this before any other of your project imports
example:
import reloading # The modules in your project folder get cleared
then load the rest of your project modules</p>
<p>make sure that the reloading script is in your project folder, or else it won't work</p>
<p>You might be able to extend this by changing line</p>
Gimp Paperwhite Scriptfu (Python)
2014-03-25T10:17:07-07:00Alfehttp://code.activestate.com/recipes/users/4182236/http://code.activestate.com/recipes/578857-gimp-paperwhite-scriptfu/
<p style="color: grey">
Python
recipe 578857
by <a href="/recipes/users/4182236/">Alfe</a>
(<a href="/recipes/tags/gimp/">gimp</a>, <a href="/recipes/tags/image_processing/">image_processing</a>, <a href="/recipes/tags/paperwhite/">paperwhite</a>, <a href="/recipes/tags/plugin/">plugin</a>, <a href="/recipes/tags/script/">script</a>, <a href="/recipes/tags/scriptfu/">scriptfu</a>).
</p>
<p>This Gimp-plugin (written in Python) changes a photograph of a paper document so that the paper background appears white again without overly lighting the text.</p>
Python script to create a header for Python scripts (Python)
2011-10-02T15:45:11-07:00userendhttp://code.activestate.com/recipes/users/4179007/http://code.activestate.com/recipes/577846-python-script-to-create-a-header-for-python-script/
<p style="color: grey">
Python
recipe 577846
by <a href="/recipes/users/4179007/">userend</a>
(<a href="/recipes/tags/2/">2</a>, <a href="/recipes/tags/auto/">auto</a>, <a href="/recipes/tags/create/">create</a>, <a href="/recipes/tags/emacs/">emacs</a>, <a href="/recipes/tags/header/">header</a>, <a href="/recipes/tags/linux/">linux</a>, <a href="/recipes/tags/python/">python</a>, <a href="/recipes/tags/script/">script</a>, <a href="/recipes/tags/vim/">vim</a>).
Revision 5.
</p>
<p>This will create a header for a Python script. It is a nice way keep a track of what your script does and when it was created, the author of the script, etc.. </p>
<p>Update: Now, it will automatically open with one of the two most popular editors, Vim or Emacs! This script has been updated from the second version to replace spaces with underscores in the title, to convert uppercase to lowercase. It also checks to see if there is a script with the same name in the current working directory so it will not overwrite another file. Please leave comments and suggestions.</p>
A Script that Adds a Directory to sys.path Permanently (Python)
2012-02-16T23:15:11-08:00Eric Snowhttp://code.activestate.com/recipes/users/4177816/http://code.activestate.com/recipes/578043-a-script-that-adds-a-directory-to-syspath-permanen/
<p style="color: grey">
Python
recipe 578043
by <a href="/recipes/users/4177816/">Eric Snow</a>
(<a href="/recipes/tags/script/">script</a>, <a href="/recipes/tags/sys_path/">sys_path</a>).
</p>
<p>This script takes advantage of PEP 370, "Per user site-packages directory". It manages .pth files, which are are non-volatile (unlike manually adding to sys.path). See <a href="http://docs.python.org/library/site.html." rel="nofollow">http://docs.python.org/library/site.html.</a></p>
Paster Run Script (Python)
2011-04-20T13:22:49-07:00Nick Holdenhttp://code.activestate.com/recipes/users/4177739/http://code.activestate.com/recipes/577669-paster-run-script/
<p style="color: grey">
Python
recipe 577669
by <a href="/recipes/users/4177739/">Nick Holden</a>
(<a href="/recipes/tags/script/">script</a>).
</p>
<p>If you are like me and your company has a custom piece of software for managing processes, you have your paster app installed in egg form in a virtualenv, then you might have a hard time running a paster server (turbogears 2) within those limits.</p>
<p>As I had so much trouble writing this I thought I would share. You can add this as a console script in your egg, then run it as --prod or --dev. When run as --prod it adds a signal handler so that if it is sigtermed by the "supervisor" program then it will kill off the rest of the paster processes (they usually don't get stopped if the main running process is killed).</p>
<p>The script is pretty rough and expects the production.ini to be in your package's main folder, with the development.ini being in the same directory as the setup.py (one directory above the production.ini). Make sure you change my_paster_package to be whatever your project is called, like "movies" from the turbogears example</p>
<p>Of course if someone has a better way of doing this that would be great too! (wsgi isn't an option for me, and it seems difficult to set it up when your project is installed as an egg)</p>
(gopytranslte) script google translator (Python)
2011-04-14T17:17:12-07:00namakukingkonghttp://code.activestate.com/recipes/users/4176734/http://code.activestate.com/recipes/577556-gopytranslte-script-google-translator/
<p style="color: grey">
Python
recipe 577556
by <a href="/recipes/users/4176734/">namakukingkong</a>
(<a href="/recipes/tags/api/">api</a>, <a href="/recipes/tags/google/">google</a>, <a href="/recipes/tags/python/">python</a>, <a href="/recipes/tags/python3/">python3</a>, <a href="/recipes/tags/script/">script</a>, <a href="/recipes/tags/translate/">translate</a>, <a href="/recipes/tags/translator/">translator</a>).
Revision 3.
</p>
<p>hehehehe..... Very little code for study.....</p>
Python script main line for graceful exception handling and logging (Python)
2010-09-11T05:46:59-07:00Trent Mickhttp://code.activestate.com/recipes/users/4173505/http://code.activestate.com/recipes/577258-python-script-main-line-for-graceful-exception-han/
<p style="color: grey">
Python
recipe 577258
by <a href="/recipes/users/4173505/">Trent Mick</a>
(<a href="/recipes/tags/error/">error</a>, <a href="/recipes/tags/logging/">logging</a>, <a href="/recipes/tags/main/">main</a>, <a href="/recipes/tags/mainline/">mainline</a>, <a href="/recipes/tags/script/">script</a>).
Revision 5.
</p>
<p>This is a recipe is often use for the mainline of my Python scripts. With this recipe your Python script will:</p>
<ul>
<li>gracefully handle <code>Ctrl+C</code> (i.e. <code>KeyboardInterrupt</code>)</li>
<li>log an error (using the <code>logging</code> module) for uncaught exceptions, importantly <strong>with the file and line number</strong> in your Python code where the exception was raised</li>
<li>gracefully ignore a closed output pipe (common when the user pipes your script through <code>less</code> and terminates that)</li>
<li>if your script logger is enabled for <code>DEBUG</code> level logging, a full traceback will be shown for an uncaught exception</li>
</ul>
<p>Presumptions:</p>
<ul>
<li><p>you have a global <code>log</code> variable a la:</p>
<pre class="prettyprint"><code>import logging
log = logging.setLevel("scriptname")
</code></pre></li>
<li><p>your script's entry point is a function <code>def main(argv): ...</code></p></li>
</ul>
ZipScript: Build a directly executable zipped Python script set (Python)
2010-02-11T15:32:38-08:00Glennhttp://code.activestate.com/recipes/users/4171639/http://code.activestate.com/recipes/577042-zipscript-build-a-directly-executable-zipped-pytho/
<p style="color: grey">
Python
recipe 577042
by <a href="/recipes/users/4171639/">Glenn</a>
(<a href="/recipes/tags/package/">package</a>, <a href="/recipes/tags/script/">script</a>, <a href="/recipes/tags/zip/">zip</a>).
Revision 2.
</p>
<p>This function will package a python script and additional python modules, in either source or compiled form. Either are directly executable by Python 2.7/3.1 or newer.</p>
<p>Uses make-like logic to only rebuild if something is newer than the previous build.</p>
Heise mp3 downloader (Python)
2009-01-17T11:51:39-08:00d.schlabinghttp://code.activestate.com/recipes/users/4168903/http://code.activestate.com/recipes/576618-heise-mp3-downloader/
<p style="color: grey">
Python
recipe 576618
by <a href="/recipes/users/4168903/">d.schlabing</a>
(<a href="/recipes/tags/oop/">oop</a>, <a href="/recipes/tags/script/">script</a>, <a href="/recipes/tags/threads/">threads</a>).
</p>
<p>This little script presents new heise-news-articles individually by title and asks if it should download the corresponding mp3-file.</p>
PyTube (Python)
2008-12-07T01:19:17-08:00Jonny Reeveshttp://code.activestate.com/recipes/users/4167414/http://code.activestate.com/recipes/576524-pytube/
<p style="color: grey">
Python
recipe 576524
by <a href="/recipes/users/4167414/">Jonny Reeves</a>
(<a href="/recipes/tags/internet/">internet</a>, <a href="/recipes/tags/script/">script</a>, <a href="/recipes/tags/search/">search</a>, <a href="/recipes/tags/youtube/">youtube</a>).
Revision 3.
</p>
<p>Based off PyGoogle, this script searches Youtube. </p>