<?xml version="1.0" encoding="UTF-8"?> <rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
> <channel><title>ADM Blog &#187; window</title> <atom:link href="http://blog.another-d-mention.ro/tag/window/feed/" rel="self" type="application/rss+xml" /><link>http://blog.another-d-mention.ro</link> <description>No matter how you see things, reality changes when you reach understanding</description> <lastBuildDate>Fri, 22 Jul 2011 06:56:49 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.1</generator> <item><title>How to run python code in Windows batch (bat) files</title><link>http://blog.another-d-mention.ro/programming/how-to-run-python-code-in-windows-batch-bat-files/</link> <comments>http://blog.another-d-mention.ro/programming/how-to-run-python-code-in-windows-batch-bat-files/#comments</comments> <pubDate>Wed, 23 Jun 2010 12:58:05 +0000</pubDate> <dc:creator>admin</dc:creator> <category><![CDATA[Programming]]></category> <category><![CDATA[Python]]></category> <category><![CDATA[bat]]></category> <category><![CDATA[batch]]></category> <category><![CDATA[code]]></category> <category><![CDATA[py]]></category> <category><![CDATA[window]]></category> <guid
isPermaLink="false">http://blog.another-d-mention.ro/?p=829</guid> <description><![CDATA[Here’s the bit of tricky batch file magic that does it: 1 2 3 @setlocal enabledelayedexpansion &#38;&#38; python -x &#34;%~f0&#34; %* &#38; exit /b !ERRORLEVEL! #start python code here print &#34;hello world&#34; The way it works is that the first line of the file does two different things. 1. starts python interpreter passing the name [...]
Related posts:<ol><li><a
href='http://blog.another-d-mention.ro/programming/sudoku-solver-in-python/' rel='bookmark' title='Permanent Link: Sudoku solver in python'>Sudoku solver in python</a></li><li><a
href='http://blog.another-d-mention.ro/programming/python/quick-python-script-explanation/' rel='bookmark' title='Permanent Link: Quick Python Script Explanation'>Quick Python Script Explanation</a></li><li><a
href='http://blog.another-d-mention.ro/programming/java-script/open-and-save-files-to-desktop-without-going-to-server/' rel='bookmark' title='Permanent Link: Open and Save files to Desktop without going to Server'>Open and Save files to Desktop without going to Server</a></li></ol>]]></description> <content:encoded><![CDATA[<p>Here’s the bit of tricky batch file magic that does it:</p><div
class="wp_syntax"><table><tr><td
class="line_numbers"><pre>1
2
3
</pre></td><td
class="code"><pre class="python" style="font-family:monospace;">@setlocal enabledelayedexpansion <span style="color: #66cc66;">&amp;&amp;</span> python -x <span style="color: #483d8b;">&quot;%~f0&quot;</span> <span style="color: #66cc66;">%*</span> <span style="color: #66cc66;">&amp;</span> exit /b <span style="color: #66cc66;">!</span>ERRORLEVEL<span style="color: #66cc66;">!</span>
<span style="color: #808080; font-style: italic;">#start python code here</span>
<span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;hello world&quot;</span></pre></td></tr></table></div><p>The way it works is that the first line of the file does two different things.</p><p>1. starts python interpreter passing the name of the file in, and the -x option will tell it to skip the first line (containing .bat file code)<br
/> 2. When python finishes the script exits.</p><p>This nifty trick makes it much nicer for writing admin scripts with python on Windows.</p><p>Related posts:<ol><li><a
href='http://blog.another-d-mention.ro/programming/sudoku-solver-in-python/' rel='bookmark' title='Permanent Link: Sudoku solver in python'>Sudoku solver in python</a></li><li><a
href='http://blog.another-d-mention.ro/programming/python/quick-python-script-explanation/' rel='bookmark' title='Permanent Link: Quick Python Script Explanation'>Quick Python Script Explanation</a></li><li><a
href='http://blog.another-d-mention.ro/programming/java-script/open-and-save-files-to-desktop-without-going-to-server/' rel='bookmark' title='Permanent Link: Open and Save files to Desktop without going to Server'>Open and Save files to Desktop without going to Server</a></li></ol></p>]]></content:encoded> <wfw:commentRss>http://blog.another-d-mention.ro/programming/how-to-run-python-code-in-windows-batch-bat-files/feed/</wfw:commentRss> <slash:comments>2</slash:comments> </item> <item><title>Access all files on your hard disk from the system tray</title><link>http://blog.another-d-mention.ro/misc/access-all-files-on-your-hard-disk-from-the-system-tray/</link> <comments>http://blog.another-d-mention.ro/misc/access-all-files-on-your-hard-disk-from-the-system-tray/#comments</comments> <pubDate>Fri, 27 Feb 2009 12:23:45 +0000</pubDate> <dc:creator>admin</dc:creator> <category><![CDATA[Misc]]></category> <category><![CDATA[Software]]></category> <category><![CDATA[download]]></category> <category><![CDATA[linux]]></category> <category><![CDATA[mac]]></category> <category><![CDATA[window]]></category> <guid
isPermaLink="false">http://blog.another-d-mention.ro/?p=116</guid> <description><![CDATA[Hawkscope is an incredibly useful program that allows you to access your hard disk’s content right from your system tray. Forget about My Computer or the desktop because Hawkscope does not simply show you the hard drives but the entire contents on it through pop open menus. The best part is Hawkscope is available for [...]
Related posts:<ol><li><a
href='http://blog.another-d-mention.ro/misc/view-hidden-files-with-a-keyboard-shortcut/' rel='bookmark' title='Permanent Link: View hidden files with a keyboard shortcut'>View hidden files with a keyboard shortcut</a></li><li><a
href='http://blog.another-d-mention.ro/misc/eee-pc/install-windows-xp-on-your-asus-eee-pc-using-a-usb-flash-drive/' rel='bookmark' title='Permanent Link: Install Windows XP on your Asus Eee PC using a USB flash drive'>Install Windows XP on your Asus Eee PC using a USB flash drive</a></li><li><a
href='http://blog.another-d-mention.ro/programming/java-script/open-and-save-files-to-desktop-without-going-to-server/' rel='bookmark' title='Permanent Link: Open and Save files to Desktop without going to Server'>Open and Save files to Desktop without going to Server</a></li></ol>]]></description> <content:encoded><![CDATA[<p><a
href="http://code.google.com/p/hawkscope/">Hawkscope</a> is an incredibly useful program that allows you to access your hard disk’s content right from your system tray. Forget about My Computer or the desktop because Hawkscope does not simply show you the hard drives but the entire contents on it through pop open menus. The best part is Hawkscope is available for all the three major platforms – Windows, Linux and Mac and it’s open source.</p><p><a
href="http://cache.another-d-mention.ro/images/wp-content/uploads/2009/02/hs-040-win.png"><img
class="alignnone size-medium wp-image-117" title="hs-040-win" src="http://cache.another-d-mention.ro/images/wp-content/uploads/2009/02/hs-040-win-285x300.png" alt="hs 040 win 285x300 Access all files on your hard disk from the system tray" width="285" height="300" /></a></p><p><span
class="fullpost">The program allows you to add custom locations through the Quick Access tab on the settings window. You can also set to view hidden files or even blacklist certain locations from showing. This application is going to save anybody who works on a computer precious amount of time. I’m totally sold.</span></p><p>Related posts:<ol><li><a
href='http://blog.another-d-mention.ro/misc/view-hidden-files-with-a-keyboard-shortcut/' rel='bookmark' title='Permanent Link: View hidden files with a keyboard shortcut'>View hidden files with a keyboard shortcut</a></li><li><a
href='http://blog.another-d-mention.ro/misc/eee-pc/install-windows-xp-on-your-asus-eee-pc-using-a-usb-flash-drive/' rel='bookmark' title='Permanent Link: Install Windows XP on your Asus Eee PC using a USB flash drive'>Install Windows XP on your Asus Eee PC using a USB flash drive</a></li><li><a
href='http://blog.another-d-mention.ro/programming/java-script/open-and-save-files-to-desktop-without-going-to-server/' rel='bookmark' title='Permanent Link: Open and Save files to Desktop without going to Server'>Open and Save files to Desktop without going to Server</a></li></ol></p>]]></content:encoded> <wfw:commentRss>http://blog.another-d-mention.ro/misc/access-all-files-on-your-hard-disk-from-the-system-tray/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> </channel> </rss>
