A question for profile

slchen at larc.ee.nthu.edu.tw slchen at larc.ee.nthu.edu.tw
Mon Jul 4 11:35:46 EDT 2005


Now, I have a question about profile.
I write a program as below:
file name: pro.py
-------------------------------

import profile
import string,re,sys,random,time
import main,read_dont

#Read the  data
S1=sys.argv[1]
S2=sys.argv[2]
T=read_dont.readfile(S1,string.atoi(S2))
print "T[0] is %s" % T[0]


print "Total test pattern bit # is %d" % (len(T)*len(T[0]))

#End Read  data ######################


print "hello"
profile.run('main.solver(T,string.atoi(sys.argv[3]))')
-----------------------------------
main and read_dont are two functions which are defined by me.

But when I execute the instruction

 python pro.py pattern_1196.v 14 7

, it show some error message
the error message is ~~

Traceback (most recent call last):
  File "pro.py", line 3, in ?
    import profile
  File "/usr/lib/python2.2/profile.py", line 18, in ?
    # provided that the above copyright notice appears in all copies,
and
NameError: name 'profile' is not defined

but I have import the module profile,
Is there any error?

Thanks a lot!

                           Sen-Lung Chen




More information about the Python-list mailing list