import sys import math def TPCflagsUnpk(flagWord): """Unpack the TPC word """ if ( flagWord <= 128 ): print 'old schema' else: for x in range(0,32): npow = pow(2,x) flag = (flagWord & npow) print "flag = ", (x+1), ' ' ,flag if __name__ == '__main__': flagWord = int(sys.argv[1]) TPCflagsUnpk(flagWord)