Module calling-newbie question

Discussion in 'Python' started by Roland Hedberg, May 28, 2004.

  1. Hi!

    I'm having problems with using modules. I'lls start with the error as it
    is presented:

    Exception in Tree control callback
    Traceback (most recent call last):
    File "/local/develop/apacheadmin/Tree.py", line 427, in PVT_set_state
    self.widget.get_contents_callback(self)
    File "sexptree.py", line 11, in getelements
    for element in spo.sublist(node):
    File "/local/develop/apacheadmin/sexp.py", line 103, in sublist
    ss = string.split( subspec, "/" )
    File "/usr/local/lib/python2.3/string.py", line 121, in split
    return s.split(sep, maxsplit)

    I using the tkinter based Tree.py module Charles E. "Gene" Cash and have
    built one module sexp.py which among other things tries to split a
    string. Really nothing fancy but it fails when the sexp module is used
    by a python program sexptree.py (also by me).

    Sexp.py as well as sexptree.py imports string.

    What more can I do ??
    What am I doing wrong ??

    -- Roland
    Roland Hedberg, May 28, 2004
    #1
    1. Advertising

  2. Roland Hedberg

    Peter Otten Guest

    Roland Hedberg wrote:

    > Hi!
    >
    > I'm having problems with using modules. I'lls start with the error as it
    > is presented:
    >
    > Exception in Tree control callback
    > Traceback (most recent call last):
    > File "/local/develop/apacheadmin/Tree.py", line 427, in PVT_set_state
    > self.widget.get_contents_callback(self)
    > File "sexptree.py", line 11, in getelements
    > for element in spo.sublist(node):
    > File "/local/develop/apacheadmin/sexp.py", line 103, in sublist
    > ss = string.split( subspec, "/" )
    > File "/usr/local/lib/python2.3/string.py", line 121, in split
    > return s.split(sep, maxsplit)
    >
    > I using the tkinter based Tree.py module Charles E. "Gene" Cash and have
    > built one module sexp.py which among other things tries to split a
    > string. Really nothing fancy but it fails when the sexp module is used
    > by a python program sexptree.py (also by me).
    >
    > Sexp.py as well as sexptree.py imports string.
    >
    > What more can I do ??
    > What am I doing wrong ??


    You could throw in a

    print repr(subspec)

    statement above

    ss = string.split(subspec, "/") # ss = subspec.split("/") in current Python

    to verify that subspec is really a string.

    Peter
    Peter Otten, May 28, 2004
    #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. davout
    Replies:
    0
    Views:
    325
    davout
    Aug 4, 2004
  2. Sean
    Replies:
    9
    Views:
    282
    JRCondon
    Feb 17, 2005
  3. Gopal
    Replies:
    2
    Views:
    282
    Mikael Olofsson
    Sep 27, 2005
  4. Maric Michaud
    Replies:
    0
    Views:
    7,185
    Maric Michaud
    Jun 24, 2006
  5. Jerry C.
    Replies:
    8
    Views:
    228
    Uri Guttman
    Nov 23, 2003
Loading...

Share This Page