Freiheit stirbt mit Sicherheit. _

.:: Gooey ::.

Turns your Python console script into a GUI application in one-line if you are using optparse.
29.08.14 09:52:00 - balle - 962 comments - Python

.:: Snakes on a Hadoop ::.

18.07.14 16:07:31 - balle - 81 comments - Python

.:: Django for big kids ::.

"As we’re approaching 8 billion page views per month and 45k requests per second, we’ve learned a couple things about delivering comments to a lot of different people. Disqus is very well known for using Django for almost all of our web traffic, and that continues to be a thing today. As with any web framework, there are inherent trade-offs: rapid development vs performance, familiarity for new developers vs something custom, etc. Disqus likes to lean towards rapid development and familiarity over performance, and something fine tuned for our exact needs."
Quelle: Blog Disqus
30.09.13 09:52:10 - balle - 675 comments - Python

.:: Python Macros ::.

"Karnickel is a small library that allows you to use macros (similar to those found in Lisp) in Python code. In a nutshell, macros allow you to insert code (the macro definition) at a different point in the code (the macro call). It is different from calling functions in that the code is inserted before it is even compiled.

("Karnickel" is German for "rabbit", and there's a vicious killer rabbit in "Monty Python and the Holy Grail" that is best left alone...)"


"MacroPy is an implementation of Syntactic Macros in the Python Programming Language. MacroPy provides a mechanism for user-defined functions (macros) to perform transformations on the abstract syntax tree (AST) of a Python program at import time. This is an easy way to enhance the semantics of a Python program in ways which are otherwise impossible, for example providing an extremely concise way of declaring classes"
14.06.13 13:19:04 - balle - 742 comments - Python

.:: CLPython ::.

"CLPython is an open-source implementation of Python written in Common Lisp.
It bridges the Python and Lisp worlds, so you can:

access Python libraries from Lisp;
access Lisp libraries from Python."

19.04.13 16:21:53 - balle - 867 comments - Python

.:: Kivy ::.

" Kivy is running on Linux, Windows, MacOSX, Android and IOS. You can run the same code on all supported platforms.
It can use natively most inputs protocols and devices like WM_Touch, WM_Pen, Mac OS X Trackpad and Magic Mouse, Mtdev, Linux Kernel HID, TUIO. A multi-touch mouse simulator is included."

12.04.13 12:40:18 - balle - 710 comments - Python

.:: Stop writing classes ::.

Today I found a great talk from Jack Diederich at PyCon 2012 about "Classes are great but they are also overused."
Especially with design pattern in the so shiny Java ecosystem. I like simple, readable code and totally agree with the speaker.

08.03.13 10:23:21 - balle - 575 comments - Python

.:: Solar system simulator ::.

During the XMAS holidays Thanassis Tsiodras wrote a gravity simulator for simulating solar systems in about 250 lines of Python code.
Amazing work have a look at it!

Gravity simulation video

Read more
03.01.13 10:21:49 - balle - 821 comments - Python

.:: Jarvis ::.

"The central idea is that the feedback loop when you are coding should be the shortest possible, so you can see the effect of your code changes instantly, or almost. Jarvis is a Python coding companion. Point it to a python function, and it will execute it. As soon as you change and save your code, Jarvis will detect it, and will rerun the function.

If an exception is raised, it will be displayed in the error panel.

If you insert some debugging statements in your code, they will be displayed in the debug panel."

28.06.12 16:13:17 - balle - 96 comments - Python

.:: Generating unit tests in Python ::.

"Let's say you're working on this old Python project. It's ugly and unpredictable, but you have no choice but to keep it alive. Luckily you've heard about this new tool called Pythoscope, which can help you cure the old guy. Pythoscope is a unit test generator for programs written in Python."
25.06.12 17:05:17 - balle - 709 comments - Python

.:: Django Chuck ::.

"Django Chuck is a modular, open source, command-based project build system, that gives you the power to create new projects as fast as pushing on a button.

It creates a virtualenv and a Django project for you, installs all required Python packages, creates the database and a fab file for
automatic deployment and thanks to the module system you can easily add functionality like CMS, Facebook, Twitter, multilang and
search engine support to a new or existing project.

But Chuck cannot be just used to create a project it can also checkout the source for you and setup everything until the Django
server is running and you're ready to do your development work. Just leave all the annoying stuff to Chuck and if there is some
task Chuck can't do for you at the moment you can add your own command to let Chuck configure your continuos integration system,
setup your hosting or do whatever you might imagine!"


Das Video zu unserem DjangoCon Vortrag zu Django Chuck gibt es hier
20.06.12 10:04:18 - balle - 135 comments - Python

.:: Pyjama ::.

"Pyjamas is a Rich Internet Application (RIA) Development Platform for both Web and Desktop.

It contains a Python-to-Javascript compiler, an AJAX framework and a Widget Set API. Pyjamas started life as a Python port of Google Web Toolkit, the Java-to-Javascript compiler."

10.11.11 14:45:40 - balle - 157 comments - Python

.:: Django Jenkins ::.

"Plug and play continuous integration with django and jenkins"
For Pylint / PEP8 checks, unit testing, jslint, code coverage and windmill tests in one quick shot!
07.10.11 16:34:31 - balle - 470 comments - Python

.:: Remote debugging uwsgi processes ::.

Today I needed to debug a uwsgi process remotely and I found Winpdb very useful. Just install it on remote and local, add the following code to your source to debug

import rpdb2; rpdb2.start_embedded_debugger('secret')

start a SSH tunnel to forward the debug port securely

ssh -L 51000:localhost:51000 user@host

Locally start winpdb, enter secret as password and use File -> Attach to attach to the process.
25.08.11 14:07:54 - balle - 475 comments - Python

.:: Viele Files auf vielen Hosts per SSH tailen ::.

Ganz einfach mit ein paar Zeilen Python Code:

from sshtail import SSHMultiTailer

tailer = SSHMultiTailer({
'': ['/path/to/log1.log', '/path/to/log2.log'],
'': ['/path/to/log3.log'],

for host, filename, line in tailer.tail():
print "%s:%s - %s" % (host, filename, line)

Und vorher sshtail installieren:
pip install sshtail
22.08.11 14:30:24 - balle - 863 comments - Python