uTidylib question..

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • bruce

    #1

    uTidylib question..

    hi...

    you can do :

    import tidy
    s = tidy.parseStrin g(foo)

    which runs the information in "foo" through tidy, for cleaning. this results
    in "s" being a "document object"

    print "s" will display the contents of the object.

    my question, can the "document object" be turned/translated into a string
    var?

    thanks

    -bruce


  • Marc 'BlackJack' Rintsch

    #2
    Re: uTidylib question..

    In <mailman.8050.1 152664200.27775 .python-list@python.org >, bruce wrote:
    import tidy
    s = tidy.parseStrin g(foo)
    >
    which runs the information in "foo" through tidy, for cleaning. this results
    in "s" being a "document object"
    >
    print "s" will display the contents of the object.
    If this means it prints out what you want as a string…
    my question, can the "document object" be turned/translated into a string
    var?
    …then yes: ``str(s)``

    Ciao,
    Marc 'BlackJack' Rintsch

    Comment

    Working...