Roland's homepage

My random knot in the Web

Articles tagged with "programming"

  1. Python number conversions

    Sometimes one has to convert numbers from and to different formats. Below are some examples in Python that I picked up over time. What you see are excerpts of IPython sessions.

    To and from hexadecimal (base 16):

    In [1]: hex(100)
    Out[1]: '0x64'
    
    In [2]: int(0xa7)
    Out[2 ...
  2. A new STL convertor added

    In addition to stl2pov, I've now written a program that writes a shaded projection of the STL file (along the z-axis) as a PostScript file. It supports arbitrary rotations of the STL file around x-, y- or z-axis and automatically centers the object in the view, so you can ...

  3. stl2pov rewrite

    Python logo

    On 2011-04-04 I re-wrote my parser for STL files in Python. The original C parser was 411 lines (excluding comments and blank lines). The new parser in Python is 134 lines. This is also without comments. It took me about two hours to write from scratch. But that includes debugging ...

  4. Learning Python

    XKCD python strip

    Over the years I've heard a lot about the Python programming language. Now I have decided to start and learn it. I'm already reasonably fluent in languages like Perl, Lua, C and Bourne shell. But each of those feels like it's lacking somewhat. Building and maintaining versions ...


Page 1 / 1