第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

在 Google Colab 中查看字符串輸出時出現(xiàn)問題

在 Google Colab 中查看字符串輸出時出現(xiàn)問題

繁星點點滴滴 2023-08-22 15:23:47
當(dāng)我運行命令“print(abide.description)”時,我應(yīng)該獲得這樣的輸出,但我獲得的輸出是這樣的。整個字符串顯示在一行中,這使得閱讀和解釋變得非常困難。如何獲得如上圖所示的輸出?我的代碼片段:print(abide.description)輸出:
查看完整描述

1 回答

?
qq_笑_17

TA貢獻1818條經(jīng)驗 獲得超7個贊

問題是abide.description返回字節(jié)而不是字符串。如果你希望它作為普通字符串打印,你可以使用該bytes.decode()方法將字節(jié)轉(zhuǎn)換為unicode字符串。


例如:


content_bytes = b'this is a byte string\nand it will not be wrapped\nunless it is first decoded'


print(content_bytes)

# b'this is a byte string\nand it will not be wrapped\nunless it is first decoded'


print(content_bytes.decode())

# this is a byte string

# and it will not be wrapped

# unless it is first decoded


查看完整回答
反對 回復(fù) 2023-08-22
  • 1 回答
  • 0 關(guān)注
  • 1601 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號