A question for profile

Discussion in 'Python' started by slchen@larc.ee.nthu.edu.tw, Jul 4, 2005.

  1. Guest

    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 4, 2005
    #1
    1. Advertising

  2. Guest

    Sorry~~
    I found the problem~~
    There is an error profile.pyc in the same folder.
    some it execute error.

    thanks a lot!
    , Jul 4, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. will
    Replies:
    1
    Views:
    1,011
    Spaliwal
    Mar 1, 2004
  2. =?Utf-8?B?QXJuaWU=?=

    Beta 2 Profile Question

    =?Utf-8?B?QXJuaWU=?=, Jun 28, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    418
    =?Utf-8?B?QXJuaWU=?=
    Jun 28, 2005
  3. Brad
    Replies:
    1
    Views:
    1,122
    Roedy Green
    Jul 19, 2005
  4. Andy B
    Replies:
    0
    Views:
    507
    Andy B
    May 3, 2008
  5. Steven
    Replies:
    5
    Views:
    467
    Steven
    Oct 24, 2008
Loading...

Share This Page