title: Encrypt file with GPG in python 3 with subprocess
body: <p>How do I encrypt file with subprocess, so the output will be string.  </p>
  
  <pre><code> password = '%030x' % random.randrange(16**30)
   encrypted_file = subprocess.geststatusoutput("echo "+password+
   "|gpg --password-fd 0 &lt; "+ name_of_selected_file)
  </code></pre>
  
  <p>I want to encrypted _file to be a string so I could use it as encrypted file to upload with post request.<br>
  What is the best way to do it with gnupg library?</p>