GUI programming with Python

GUI programming with Python A graphical user interface (GUI) is essential for applications which should be used by standard computer users (non-developers, not computer scientists, ...). However, I have almost no experience with GUI development outside of the web. Multiple GUI toolkits exist and the only one I have ever used is Tk for a very, very simple GUI. In this article, I want to share some of my thoughts about GUI development with Python as a beginner. I...

Distribution of Random Variables when max gets applied

Distribution of Random Variables when max gets applied I just wanted to solve an exercise where I had random variables $X_1, \dots, X_n$ which were all $U([0, 1])$ distributed and $Y_n = \max(X_1, \dots, X_n)$. I wondered what the distribution of $Y_n$ is (for big $n$), so I wanted to plot it. How do I plot it? With Python, of course :-) Here is the program: #!/usr/bin/env python import matplotlib.pyplot as plt import numpy.random def main(): # Generate Data n = 10000 numbers_a...

Bug Reporting

Bug Reporting Bug reporting is extremely important. It helps developers to get aware of problems and hence get the possibility to do something against it. It is impossible to guarantee for any real, non-trivial software that it has no bugs. Even when you formally prove that it is correct, the prove might be wrong. However, when users report bugs one can get confident that the remaining bugs are appearing very rarely or causing not so much harm....

Regular Expressions with Python

Regular Expressions with Python Python supports regular expressions (RegEx) just as any other general purpose programming language. This mini article shows two examples how to use them. The package which gives RegEx support is called re. Replacing Spaces Replace multiple whitespace characters (spaces, tabs, newlines, ...) by a single space (by Nasir): import re text = "The fox jumped over the log." replaced = re.sub("\s\s+", " ", text) To speed things up you can also compile the pattern. This...

Analyzing PyPI Metadata

Analyzing PyPI Metadata PyPI, the Python Package Index, gives a very crappy but simple interface to query metadata about its packages. I scrapped all of the packages metadata. 53,533 packages were scrapped (date: 2015-01-18), because I wanted to see if there is malware on PyPI (related to this question on security.SE). The database looks like this: PyPI metadata Exploring the data When I scapped the data from PyPI, I made all database fields "varchar 255" as there seems...

LaTeX and tables

LaTeX and tables This is a quick article I had for quite a while as a draft. It might not be finished or have other problems, but I still want to share it. LaTeX is an awesome typesetting language: It is powerful enough to let you do anything you want, it has a great community and standard solutions for every common problem as it is quite old. But tables... well, let's say there is much room for improvement....

Hörspiele

Hörspiele This is a quic article I had for quite a while as a draft. It might not be finished or have other problems, but I still want to share it. Ich habe früher (damals, als ich noch keinen PC hatte :-) ) sehr gerne Hörspiele gehört. Nun, mit meinem neuen Smartphone, dachte ich könnte ich das ja mal wieder machen. Auf der Suche nach (kostenlosen) Hörspielen habe ich folgendes gefunden: Neuvertonung.de: Eine kleine Gruppe hat...