How can I identify invisible characters in python strings?

后端 未结 1 1549
清酒与你
清酒与你 2021-02-14 14:09

SHORT VERSION

I am retrieving a database value, which contains a short, but full HTML structure. I want to strip away all of the HTML-tags, and just end

相关标签:
1条回答
  • 2021-02-14 14:35

    To view the contents of a string (including it's "hidden" values) you can always do:

    print( [data] )
    # or
    print( repr(data) )
    

    If you're in a system which you described in the comments you can also do:

    with open('/var/log/debug.log', 'w') as fh:
        fh.write( str( [data] ) )
    

    This will however just give you a general idea of what your data looks like, but if that solves your question or problem then that is great. If you need further assistance, edit your question or submit a new one :)

    0 讨论(0)
提交回复
热议问题