Roland's homepage

My random knot in the Web

Articles tagged with "python3"

  1. Using gnuplot from Python

    According to my revision control systems (rcs in those days), I’ve been using gnuplot to make graphs since at least 2002. And I’ve got it set up via a custom gnuplotrc to match the style of the TeX documents I often use the graphs in.

    At work we have an Instron 3369 machine for material testing. Recently, I wanted to visualize some tensile test data in ways that I couldn’t get into the test report.

  2. Python bindings for libmagic

    This documents how I installed Python bindings for libmagic.

    There are actually different bindings for libmagic. One set is part of the original distribution. It can be found in /usr/src/contrib/file/python/. But in my opinion it is somewhat cumbersome to use and not very Pythonic.

    The implementation from ahupp/python-magic in Github feels more natural.

  3. foto4lb

    Photos from modern digital cameras are generally so large these days that you have to shrink them to use them in a document. I do this a lot, so I automated it.

    The script shrinks the files it is given to a width of 886 pixels, and shrinks ...

  4. csv2tbl

    The script takes a comma-separated values (“csv”) file, and converts it to a LaTeX table. It handles a couple of different possible seperators; semicolon, comma and tab. Of those it automatically pics the one that occurs most.

    N.B.: it does not try to interpret quotation marks!

    It ...

  5. dicom2png

    This simple python script uses ImageMagick to convert DICOM images from a Philips digital X-ray machine to PNG format. It crops the images from 2048x2048 pixels to 1574x2048 pixels, the actual size of the detector.

    To speed up the processing of multiple pictures, this script runs the conversions in parallel ...

  6. Generate random passwords

    One way of making hard to guess passwords is to take random data and encode it with base64 to make it readable. This is what I’ve done in the script.

    This is mainly useful for passwords that you can store in a secure manner (like in an ...

  7. git-check-all

    This scripts looks for all directories in the users’ home directory that are managed by the git revision control system (i.e. that have a .git subdirectory).

    For each of those directories it checks whether there are uncommitted changes by running git status. If there aren’t any, it runs ...

  8. gitdates

    In answer to this question on stackechange, I wrote (available from github). If it is called from a directory that is under git resivion control, it lists all the files there with the short hashtag and the date from when they were last committed. The current version is ...

Page 1 / 3 Page 2 →