如何在Python中实现js的escape?

js:

>>>escape(a)
"%E7%AE%97%E4%B8%8D%E4%B8%8A%E5%A4%A7%E7%A5%9E%EF%BC%8C%E6%88%91%E5%B0%B1%E6%98%AF%E5%88%92%E6%B0%B4%E7%9A%84"
>>>decodeURIComponent("%E7%AE%97%E4%B8%8D%E4%B8%8A%E5%A4%A7%E7%A5%9E%EF%BC%8C%E6%88%91%E5%B0%B1%E6%98%AF%E5%88%92%E6%B0%B4%E7%9A%84")
"算不上大神,我就是划水的"

a的原始数据为b'\xc3\xa7\xc2\xae\xc2\x97\xc3\xa4\xc2\xb8\xc2\x8d\xc3\xa4\xc2\xb8\xc2\x8a\xc3\xa5\xc2\xa4\xc2\xa7\xc3\xa7\xc2\xa5\xc2\x9e\xc3\xaf\xc2\xbc\xc2\x8c\xc3\xa6\xc2\x88\xc2\x91\xc3\xa5\xc2\xb0\xc2\xb1\xc3\xa6\xc2\x98\xc2\xaf\xc3\xa5\xc2\x88\xc2\x92\xc3\xa6\xc2\xb0\xc2\xb4\xc3\xa7\xc2\x9a\xc2\x84'
如何在python中得到相同输出呢?

查看回复