1. Historical Values in Python

    Often in programming we have some "constant" value that we define as a variable in Python. But the only try constant is change.

    Consider for example you have a program that needs to process a file with a certain filename. So you might have something like:

    FILENAME = "foo.txt"
    
    data …
    Tagged as : development python
  2. Python Cannot Return Multiple Values

    It is often said that Python functions can return multiple values, but this isn't really true. Often the examples given to show Python returning multiple values is something like this:

    def foo():
       return 1, 3
    
    a, b = foo()
    

    But is that really returning multiple values? No. Well then how come …

    Tagged as : development python
  3. du and hard links

    If, like me, you've ever been curious about if/how coreutil's du command handles hard links:

    $ mkdir test
    $ mkdir test/a test/b
    $ dd if=/dev/zero of=test/a/a bs=1M count=1
    1+0 records in
    1+0 records out
    1048576 bytes (1.0 MB, 1.0 …
    Tagged as : unix du coreutils

Page 2 / 3