#!/usr/bin/env python # -*- encoding: utf-8 -*- # -*- coding: utf-8 -*- # -*- tabstop: 4 -*- from os import chdir as cd, getcwd as pwd, path as ph H = ph.expanduser('~') # Home dir hh = lambda s: s.replace(H, '~') from sys import stdout as sto _dbg =lambda _str: sto.write(hh(str(_str))) pwd1 = pwd() apath = ph.abspath(__file__) rpath = ph.realpath(__file__) cd(ph.dirname(apath)) _dbg("abspath:\t%s\n" % apath) _dbg("weak abspath:\t%s\n" % ph.abspath(__file__)) _dbg("realpath:\t%s\n" % rpath) _dbg("weak realpath:\t%s\n" % ph.realpath(__file__))