我需要在linux上的python进程之间有效地传输二进制数据.但是我找不到用管道传递它的方法.我得到的最接近的是将其作为字符串传递,但由于某种原因它保留了二进制形式,因此它给我带来了问题.
ciphertext, tag = cipher1.encrypt_and_digest(input().encode())
print(ciphertext)
Run Code Online (Sandbox Code Playgroud)
密文是二进制的,但是当我在另一个进程中测试它的类型时
print(type(sys.stdin.read()))
Run Code Online (Sandbox Code Playgroud)
我明白了
<class 'str'>
Run Code Online (Sandbox Code Playgroud)
有任何想法吗?
I need to use a pointer to an array and put the third value in ax. My solution:
mov bx, [chrs_ptr]
add bx, 2
mov ax,[bx]
Run Code Online (Sandbox Code Playgroud)
But I couldn't figure out why mov ax, [[chrs_ptr] + 2] gives me the pointer value.
我需要创建一个具有多个charecter的运算符,因为我希望代码更具可读性和更多关联性.例如:
public static bool operator !&(bool a, bool b)
{
return ((a == true && b == true) || (a == false && b = false));
}
Run Code Online (Sandbox Code Playgroud)