By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,675 Members | 2,270 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,675 IT Pros & Developers. It's quick & easy.

A question for profile

P: n/a
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

Jul 21 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Sorry~~
I found the problem~~
There is an error profile.pyc in the same folder.
some it execute error.

thanks a lot!

Jul 21 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.