Quantcast
Channel: Jannich Brendle's blog » python
Browsing latest articles
Browse All 7 View Live

Learning Python and the Python Imaging Library

So, I’m learning python at the moment and I think that it’s a really great language. When I’m learning a new language, I usually look on the interwebs for funny programming exercises, like...

View Article



Solving projecteuler with pyCUDA

Project Euler is a great pastime activity, and it just got even more exciting with the use of pyCUDA. PyCUDA lets you access Nvidia‘s CUDA parallel computation API from Python. So I decided to solve a...

View Article

Installing python on external storage with OpenWrt

Okay, I figured I should try installing python on my OpenWrt router, and it was easier than I thought! I have an external harddrive attached to my routers USB port, mounted on /mnt/hdd/. This is the...

View Article

Calculating password entropy in python

Okay, I recently decided to make a simple python class that could calculate password entropy. After reading the wikipedia article on the subject, I came up with this solution: class PasswordStrength:...

View Article

Converting a gtk.gdk.Pixbuf object to an Image object in python

If you have a Pixbuf object in python and you need to have an Image object representing that Pixbuf, here’s what you need to do: import Image, gtk.gdk pb = gtk.gdk.Pixbuf(gtk.gdk.COLORSPACE_RGB, False,...

View Article


Difference between two lists in python – a simple solution

Sometimes, you have two lists in python and you need too know the difference between two lists. With a quick list comprehension, this is easy to find out: numbers = [1,2,3,4,5,6,7,8] even =...

View Article

Using if/else combination in a list comprehension in Python

Okay, you might know how to use conditionals in a list comprehension in Python, like so: original_list=[1,2,3,4,5,6,7,8,9] evens=[x for x in original_list if x%2==0] odds=[x for x in original_list if...

View Article
Browsing latest articles
Browse All 7 View Live




Latest Images