Example #1
0
def oper(v1, v2, op):
    sys.debug()
    if (op == '+'):
        print "              ",v1,op,v2,"=",v1+v2,type(v1+v2)
    elif (op == '-'):
        print "              ",v1,op,v2,"=",v1-v2,type(v1-v2)
    elif (op == '*'):
        print "              ",v1,op,v2,"=",v1*v2,type(v1*v2)
    elif (op == '/'):
        print "              ",v1,op,v2,"=",v1/v2,type(v1/v2)
    elif (op == '**'):
        if v2 >  100000000:
            print 'skipping pow of really big number'
            return
        print "              ",v1,op,v2,"=",v1**v2,type(v1**v2)
    elif (op == '%'):
        print "              ",v1,op,v2,"=",v1%v2,type(v1%v2)
    elif (op == '<'):
        print "              ",v1,op,v2,"=",v1<v2,type(v1<v2)
    elif (op == '='):
        print "              ",v1,op,v2,"=",v1==v2,type(v1==v2)
    elif (op == '>'):
        print "              ",v1,op,v2,"=",v1>v2,type(v1>v2)
    elif (op == '<='):
        print "              ",v1,op,v2,"=",v1<=v2,type(v1<=v2)
    elif (op == '!='):
        print "              ",v1,op,v2,"=",v1!=v2,type(v1!=v2)
    elif (op == '>='):
        print "              ",v1,op,v2,"=",v1>=v2,type(v1>=v2)
Example #2
0
def main():

    if any(opt in argv for opt in ['-h', '--help']):
        help()
        exit()
    options, video, output = {}, None, None
    for opt in argv:
        if opt in ['-i', '--input']:
            video = next('-i', argv, lambda x: x if isfile(join(getcwd(), x)) else None)
        key = None
        if opt in ['-q', '--quality']:
            key = 'quality'
        if opt in ['-o', '--output']:
            output = next(opt, argv)
        if opt in ['-d', '--dimension']:
            key = 'dimension'
        if opt in ['-w', '--width']:
            key = 'width'
        if opt in ['-c', '--comment']:
            key = 'comment'
        if key: options[key] = next(opt, argv)
    try:
        Thumbnailer(options).perform(video, output)
    except Exception as e:
        position = traceback(debug()[2])[-1]
        print(f'\nException: {"".join(str(e).split(chr(10)))} (see@{position[2]}:{position[1]})')
        help()
Example #3
0
import sys
print type(123456789L)

print 12345678901234567890123456789L
sys.debug()
print type(12345678901234567890123456789L)