簡體   English   中英

模塊“int”沒有屬性“from_bytes”

[英]module 'int' has no attribute 'from_bytes'

當我在腳本中使用: help(int.from_bytes) ,出現此錯誤:
AttributeError: module 'int' has no attribute 'from_bytes'

但是在 Python 控制台中它可以工作:

from_bytes(bytes, byteorder, *, signed=False) method of builtins.type instance
        Return the integer represented by the given array of bytes.

如果它有用,我已經刪除了 Python2,我應該只有 Python3。

在網上搜索答案時,我一定錯過了一些東西,因為它看起來很基本。

我已經刪除了

import int

從腳本開始,它現在可以工作了。

謝謝@blhsing

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM