April 2, 2008

Python Extension for libisofs

I am working on a Python extension for the libisofs library. The extension is written in Cython , a Python-like language designed to write Python extensions. At a later point, this extension will be used to create the ISO Images in debimg. It will be disabled by default, but you can enable it via a configuration option.

March 24, 2008

Python Speed: Getting the first part of a string

If you want to get the first part of a string (in the following example a), you should use the partition method of the string, as it is the fastest way (and it also gives you the delimiter in [1] and the other part of the string in [2]): In [1]: a = ‘a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z’ In [2]: timeit a.partition('/')[0] 1000000 loops, best of 3: 362 ns per loop In [3]: timeit a[:a. ... Read more

Copyright © 2018-2020 Julian Andres Klode, articles licensed under CC BY-SA 4.0.
Comments are provided by Mastodon and copyright of their authors.

This website does not store any personally identifiable information. As part of standard web server access_log logging, it stores requests and the user agents and shortened IP addresses used to make them. It does, however, load some avatars from mastodon.

Powered by Hugo, and the Ernest theme.