<?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>brunotavares.net: ScrapBook &#187; python</title>
	<atom:link href="https://blog.brunotavares.net/?feed=rss2&#038;tag=python" rel="self" type="application/rss+xml" />
	<link>https://blog.brunotavares.net</link>
	<description>Notes. tech and a few thoughs</description>
	<lastBuildDate>Sun, 25 Nov 2018 17:59:26 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5</generator>
		<item>
		<title>Quick http server for static files ( for development )</title>
		<link>https://blog.brunotavares.net/?p=271</link>
		<comments>https://blog.brunotavares.net/?p=271#comments</comments>
		<pubDate>Tue, 08 Jan 2013 13:31:13 +0000</pubDate>
		<dc:creator>bat</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://blog.brunotavares.net/?p=271</guid>
		<description><![CDATA[If you have python installed, change to your static file directory and $ cd /files/html/ $ python -m SimpleHTTPServer Serving HTTP on 0.0.0.0 port 8000 ... This will start an http server on port 8000 that serves all files in the current directory. All the debug is written to console including incomming requests and the [...]]]></description>
				<content:encoded><![CDATA[<p>If you have python installed, change to your static file directory and</p>
<pre>
$ cd /files/html/
$ python -m SimpleHTTPServer
Serving HTTP on 0.0.0.0 port 8000 ...

</pre>
<p>This will start an http server on port 8000 that serves all files in the current directory.<br />
All the debug is written to console including incomming requests and the server reponse to them.</p>
<p>If you want a different port just pass it as argument:</p>
<pre>
$ python -m SimpleHTTPServer 9595
Serving HTTP on 0.0.0.0 port 9595 ...

</pre>
]]></content:encoded>
			<wfw:commentRss>https://blog.brunotavares.net/?feed=rss2&#038;p=271</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>svn and python</title>
		<link>https://blog.brunotavares.net/?p=223</link>
		<comments>https://blog.brunotavares.net/?p=223#comments</comments>
		<pubDate>Fri, 03 Oct 2008 07:50:47 +0000</pubDate>
		<dc:creator>bat</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://blog.brunotavares.net/?p=223</guid>
		<description><![CDATA[I still use svn for some projects, some of them are python. Python pre-compiles the python files, so, the first time i run one of this projects i end up with a bunch of .pyc files that i don&#8217;t want to add to the repository. Since svn doesn&#8217;t know this files the svn status generates [...]]]></description>
				<content:encoded><![CDATA[<p>I still use svn for some projects, some of them are python. </p>
<p>Python pre-compiles the python files, so, the first time i run one of this projects i end up with a bunch of .pyc files that i don&#8217;t want to add to the repository.</p>
<p>Since svn doesn&#8217;t know this files the <code>svn status</code> generates a lot of garbage in the output.</p>
<p>svn has a property ( see <a href="shttp://svnbook.red-bean.com/en/1.1/ch07s02.html">svn properties</a> ) called svn:ignore that tells svn to ignore certain files matching a pattern. The problem is that this property is directory/file based so you have to set it, at least, to every directory.</p>
<p>easy way to do this:<br />
<code>
<pre>
$ cd myproject
$ find . -type d | grep -v '.svn' | xargs svn propset svn:ignore "*.pyc"
$ svn commit
</pre>
<p></code></p>
]]></content:encoded>
			<wfw:commentRss>https://blog.brunotavares.net/?feed=rss2&#038;p=223</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Isolated Python environments.</title>
		<link>https://blog.brunotavares.net/?p=219</link>
		<comments>https://blog.brunotavares.net/?p=219#comments</comments>
		<pubDate>Tue, 30 Sep 2008 23:45:11 +0000</pubDate>
		<dc:creator>bat</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://blog.brunotavares.net/?p=219</guid>
		<description><![CDATA[I&#8217;ve a lot of code that depends on different versions of the same library, its quite hard to maintain the different versions installed in their specific dirs along with all their dependencies without tainting anything else. To be able to run all of this code in one machine i&#8217;ve to make a lot of manipulation [...]]]></description>
				<content:encoded><![CDATA[<p>I&#8217;ve a lot of code that depends on different versions of the same library, its quite hard to maintain the different versions installed in their specific dirs along with all their dependencies without tainting anything else.</p>
<p>To be able to run all of this code in one machine i&#8217;ve to make a lot of manipulation to the PYTHONPATH configuration. This is painfull and time-consuming. The plot thickens if i want to test some new version of the same library.</p>
<p>I found out <a href="http://pypi.python.org/pypi/virtualenv#what-it-does">virtualenv</a>, this is a small python utility that bootstraps isolated python environments. </p>
<p>It allows you to maintain your application, libraries and all their dependencies in a isolated environment. </p>
<p>It also installs setup-tools in the virtual environment turning all your new libraries installations into painless tasks. </p>
<p>It comes with a set of handy scripts ( per-environment ) to activate and deactivate the environment so it&#8217;s quite simple to switch around environments. </p>
<p>Optionally you can make your environments inherit ( as a fallback ) the system site-packages and, with little effort, your enviromnents can be &#8220;relocatable&#8221; not being tied to any specific path which makes it possible to move them around your filesystem.</p>
]]></content:encoded>
			<wfw:commentRss>https://blog.brunotavares.net/?feed=rss2&#038;p=219</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
