<?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>freedom blog reloaded &#187; everywhere</title>
	<atom:link href="http://blog.peijnik.at/topics/python/everywhere/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.peijnik.at</link>
	<description>Stephan's Free Software blog</description>
	<lastBuildDate>Tue, 10 Nov 2009 18:04:05 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Python everywhere: computer games</title>
		<link>http://blog.peijnik.at/2009/04/02/python-everywhere-computer-games/</link>
		<comments>http://blog.peijnik.at/2009/04/02/python-everywhere-computer-games/#comments</comments>
		<pubDate>Thu, 02 Apr 2009 16:35:44 +0000</pubDate>
		<dc:creator>stephan</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[everywhere]]></category>
		<category><![CDATA[foss]]></category>

		<guid isPermaLink="false">http://blog.peijnik.at/?p=92</guid>
		<description><![CDATA[This is the second article in my series Python everywhere and covers the use of Python for in computer games. The first article of this series covered the use of Python for the conficker worm scanner tool and can be found here.
Games written in Python
As PyGame provides a nice library for writing games purely in [...]]]></description>
			<content:encoded><![CDATA[<p>This is the second article in my series Python everywhere and covers the use of Python for in computer games. The first article of this series covered the use of Python for the conficker worm scanner tool and can be found <a title="Python everywhere: conficker scanner" href="http://blog.peijnik.at/2009/03/31/python-everywhere-conficker-scanner/">here</a>.<br />
<span id="more-92"></span><strong>Games written in Python</strong></p>
<p>As <a title="pygame.org" href="http://www.pygame.org/">PyGame</a> provides a nice library for writing games purely in Python it is becoming more common to use Python for this task too. The book &#8220;<a title="Beginning Game Development with Python and Pygame  @ apress.com" href="http://www.apress.com/book/view/9781590598726">Beginning Game Development with Python and Pygame</a>&#8221; is linked directly from the PyGame homepage, and thus is probably a good resource if you want to start writing games in Python.</p>
<p>However, I do not want to go into detail on how this library works, but rather provide you with a few examples of games written in Python. To provide you with a few examples I had a look at the <a title="pyweek.org" href="http://www.pyweek.org/">PyWeek</a> homepage. PyWeek is a Python Game Programming Challenge which invites everyone to participate, so the winners of this contest are of high-quality, and I&#8217;m showing you the latest two winners.</p>
<p>There are always two winners of PyWeek in for indivduals who have created games and teams. The latest winners are &#8220;<a title="Team Rambo @ pyweek.org" href="http://www.pyweek.org/e/Rambo/">Team Rambo</a>&#8221; in the individual effort category and &#8220;<a title="Midnight Sun @ pyweek.org" href="http://www.pyweek.org/e/midnightsun/">Midnight Sun</a>&#8221; with their two-man team.</p>
<p><strong>PyWeek: Team Rambo&#8217;s Stringrolled (individual)</strong></p>
<p style="text-align: left;">Stringrolled makes use of the pygame library I mentioned earlier and is a <a title="Platform game @ en.wikipedia.org" href="http://en.wikipedia.org/wiki/Platform_game">platform game</a>. In a mere 2377 lines of code, including comments and blank lines, Team Rambo created an impressive game, coming with a story, easy-to-learn controls and nice 2D-graphics, screenshot below. <a href="http://media.pyweek.org/dl/7/Rambo/pyweek3.png"><img class="aligncenter" title="Screenshot of Stringrolled" src="http://media.pyweek.org/dl/7/Rambo/pyweek3.png" alt="Stringrolled screenshot @ media.pyweek.org" width="384" height="240" /></a></p>
<p style="text-align: left;"><strong>PyWeek: Midnight Sun&#8217;s Kite Story</strong></p>
<p style="text-align: left;">Kite Story is yet another interesting game, with game mechanics I have not seen ever before. You are controlling a kite with your mouse and are trying to catch objects, such as bees and birds, with the kite&#8217;s rope. So what you basically do you draw a loop around an object with<a href="http://media.pyweek.org/dl/7/midnightsun/ss2.png"><img class="alignleft" title="Kite Story: catching a sky diver" src="http://media.pyweek.org/dl/7/midnightsun/ss2.png" alt="Kite Story screenshot @ media.pyweek.org" width="357" height="359" /></a> your mouse and that way catch it. Every third cought object you advance to the next level, but keep in mind not to collide with the objects, because you will lose them and in turn be doing the previous level again, screenshot below. It should be noted that this game does not make use of PyGame at all, but rather relies on <a title="pyglet.org" href="http://pyglet.org/">pyglet</a>, and is 1997 lines of code in length, again counting blank lines and comments too.</p>
<p style="text-align: left;">
<p style="text-align: left;">
<p style="text-align: left;">
<p style="text-align: left;">
<p style="text-align: left;">
<p style="text-align: left;">
<p style="text-align: left;">
<p style="text-align: left;">
<p style="text-align: left;">
<p style="text-align: left;">
<p style="text-align: left;"><strong>Games using Python</strong></p>
<p style="text-align: left;">You have seen now that it is possible to write a game completely in Python, but there&#8217;s another use-case of Python in games: scripting.<br />
Some (proprietary) games, such as <a title="Modding Sid Meier's Civilization IV @ 2kgames.com" href="http://www.2kgames.com/civ4/blog_03.htm">Civilization IV</a>, offer Python support in their editors and SDKs. This quote from the article at 2kgames.com should give you a good idea of what can be done using Python in Civilization IV:</p>
<blockquote>
<p style="text-align: left;">The next level offers <strong>Python and XML</strong> support, letting modders with more experience manipulate the game world and everything in it. XML (eXtensible Markup Language) files can be edited in standard text editors or in special XML file editors that have ease-of-use features like a grid view. Editing these files will allow players to tweak simple game rules and change or add content. For instance, they can add new unit or building types, change the cost of wonders, or add new civilizations. Players can also change the sounds played at certain times or edit the play list for your soundtrack. NOTE: You can have custom soundtracks simply by adding music to the custom folder. You only need to edit the XML in order to assign certain pieces to specific eras or remove certain pieces.</p>
</blockquote>
<blockquote><p>The Python scripting language is fully integrated throughout the game and offers experienced modders a chance to really strut their stuff! People with some programming skills will be able to do things to alter the game in interesting and extraordinary ways. For instance, all of the game interface screens are exposed to Python, so modders will be able to change the information that&#8217;s displayed, as well as how it&#8217;s positioned on the screen. We also use Python to create and generate all of the random map scripts that are included in the game. So, players will now have the ability to add scripted events to the game like automatically generating units when a tile is reached, having specific situations trigger automatic war, or get this, bringing back Civil Wars caused by unrest, Civ II style!</p></blockquote>
<p><a title="EVE Online Homepage" href="http://www.eveonline.com/">EVE Online</a> is another game making use of Python, as an <a title="stackless python 2.5 @ eveonline.com" href="http://www.eveonline.com/devblog.asp?a=blog&amp;bid=488">article</a> over at eveonline.com points out.</p>
<p><strong>Python everywhere &#8211; also in compuater games</strong></p>
<p>Even though I am sure you can come up with a lot more examples of Python being used in computer games I think I have proven my point. Python is being used not only to create computer games, but sometimes also to provide developers with a way of extending games. To me personally it feels as if adoption of Python for this very task is increasing too, and I expect Python to be used even more by the game development community in the future.</p>
<p>You can expect the third part of this series to be released in about a week, so please check back regularly if you like the series.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.peijnik.at/2009/04/02/python-everywhere-computer-games/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Python everywhere: conficker scanner</title>
		<link>http://blog.peijnik.at/2009/03/31/python-everywhere-conficker-scanner/</link>
		<comments>http://blog.peijnik.at/2009/03/31/python-everywhere-conficker-scanner/#comments</comments>
		<pubDate>Tue, 31 Mar 2009 11:30:23 +0000</pubDate>
		<dc:creator>stephan</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[everywhere]]></category>
		<category><![CDATA[foss]]></category>

		<guid isPermaLink="false">http://blog.peijnik.at/?p=87</guid>
		<description><![CDATA[This article is the first in my new series &#8220;Python everywhere&#8221;.
As this is the first article in this series I would like to explain what the series is all about.
As an avid Python user and developer I want to share my observations whenever I find Python applications doing not-so-unusual things, Python applications running on embedded [...]]]></description>
			<content:encoded><![CDATA[<p>This article is the first in my new series &#8220;Python everywhere&#8221;.</p>
<p>As this is the first article in this series I would like to explain what the series is all about.<br />
As an avid Python user and developer I want to share my observations whenever I find Python applications doing not-so-unusual things, Python applications running on embedded devices. In the end I want to point out just what the name of this series suggests: Python is everywhere and can be used for everything.</p>
<p>So, straight ahead to the first issue: the conficker scanner.</p>
<p><span id="more-87"></span>When reading an article about a detection mechanism for the conficker worm on <a title="Deutsche Forscher entwickeln Netzwerk-Scan für Conficker-Wurm @ heise.de" href="http://www.heise.de/security/Deutsche-Forscher-entwickeln-Netzwerk-Scan-fuer-Conficker-Wurm--/news/meldung/135434">heise Security</a> [german] I was myself wondering a few things, but wanted to give it a try. So I followed the link to the article <a title="Detecting Conficker @ honeynet.org" href="http://honeynet.org/node/388">Detecting Conficker</a>, by <a title="Werner Tillmann\s blog @ honeynet.org" href="http://honeynet.org/blog/9">Tillmann Werner</a>. Before clicking the link I was wondering whether I could get this tool running on GNU/Linux using wine, or another method.</p>
<p>After downloading the ZIP file and unpacking it I thought I was dreaming. There were two Python files, along with a <em>COPYING</em> file.<br />
So, even though before having a look at the code I wanted to know the COPYING conditions, and again I saw something unexpected: it&#8217;s licensed under the <strong>GPLv3</strong>, great!</p>
<p>As there are some computers running a proprietary operating system from Redmond on this network I immediately gave it a shot. I started the script (<em>scs.py</em>), and after fulfilling its requirements (namely the <em>impacket</em> Python module) I ran it on the local network and it worked without any problems. No conficker found on this network, after all my flatmates have their systems secured &#8211; good.</p>
<p>So there you have another use-case for Python: detecting malware over the network.<br />
Kudos should go to Tillmann Werner, not only for this piece of Python code, but also for his work on the <a title="honeynet project (honeynet.org)" href="http://honeynet.org/">honeynet project</a> and, together with Felix Leder, the great <a title="Know Your Enemy: Containing Conficker paper @ honeynet.org" href="https://www.honeynet.org/papers/conficker">analysis</a> of conficker. Keep up the good work, and thanks for proving Python can also be used for this task.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.peijnik.at/2009/03/31/python-everywhere-conficker-scanner/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
