我现在使用的代码是:-
from VideoCapture import Device
cam = Device()
cam.saveSnapshot('image.jpg')
Run Code Online (Sandbox Code Playgroud)
使用 py 2.7 和导入的 pygame 以及 all 和 videocapture 我在 pycharm 中收到此错误:-
C:\Python27\python.exe F:/Xtraz/Orion/Key-Logger.py
Traceback (most recent call last):
File "F:/Xtraz/Orion/Key-Logger.py", line 3, in <module>
cam.saveSnapshot('image.jpg')
File "C:\Python27\lib\VideoCapture.py", line 200, in saveSnapshot
self.getImage(timestamp, boldfont, textpos).save(filename, **keywords)
File "C:\Python27\lib\VideoCapture.py", line 138, in getImage
im = Image.fromstring('RGB', (width, height), buffer, 'raw', 'BGR', 0, -1)
File "C:\Users\admin\AppData\Roaming\Python\Python27\site-packages\PIL\Image.py", line 2080, in fromstring
"Please call frombytes() instead.")
NotImplementedError: fromstring() has been removed. Please call frombytes() instead. …Run Code Online (Sandbox Code Playgroud) 我有一个带有字符串数据的类,我应该使用hashlib.sha256(). 例如,我无法直接使用块 c 获取哈希
Hash = hashlib.sha256(c.encode()).digest()
Run Code Online (Sandbox Code Playgroud)
我想计算整个对象的散列,有人建议我在类中有一个函数,以便它返回其中的数据散列。它与整个块的相同吗?什么是更好的实施?