$ cat cleanup_use_psyco_and_list_compr.py
    #!/usr/bin/python

    #import psyco
    #psyco.full()

    postpaid_file = open('/home/sajid/python/wip/stc/2/PSP0000333')
    outfile = open('/home/sajid/python/wip/stc/2/PSP-CBR.dat.psyco',
'w')

    barred = {}

    for number in open('/home/sajid/python/wip/stc/2/CBR0000333'):
        barred[number] = None # just add it as a key

    for number in postpaid_file:
        if number not in barred: outfile.writelines(number)

    postpaid_file.close(); outfile.close()

    --
    $ time ./cleanup_use_psyco_and_list_compr.py

    real    0m22.587s
    user    0m21.653s
    sys     0m0.440s

Not using psyco is faster!

-- 
fynali

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to