import subprocess

p = subprocess.Popen("tr a-z A-Z", shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE)

output, error = p.communicate("translatetoupper".encode('utf-8'))

print(output.decode('utf-8'))   # TRANSLATETOUPPER

9f95b1aeb088a3f2f3161249cfb5ef66870e58f0
<mask token>

<mask token>
print(output.decode('utf-8'))

<mask token>
p = subprocess.Popen('tr a-z A-Z', shell=True, stdin=subprocess.PIPE,
    stdout=subprocess.PIPE)
output, error = p.communicate('translatetoupper'.encode('utf-8'))
print(output.decode('utf-8'))

import subprocess
p = subprocess.Popen('tr a-z A-Z', shell=True, stdin=subprocess.PIPE,
    stdout=subprocess.PIPE)
output, error = p.communicate('translatetoupper'.encode('utf-8'))
print(output.decode('utf-8'))

import subprocess

p = subprocess.Popen("tr a-z A-Z", shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE)

output, error = p.communicate("translatetoupper".encode('utf-8'))

print(output.decode('utf-8'))   # TRANSLATETOUPPER
