I am using Python 3.4.3. What am I trying to do is, storing a cmd command's output into a variable without printing that into command line. Here I found the answer but it works on the old version but on 3.4.3, variable "var" contains some random characters. And for example if I try to test that with the command "dir", it prints a mess.
import subprocess
from subprocess import Popen, PIPE
var = subprocess.Popen(COMMAND, stdin = PIPE, stdout = PIPE, stderr = PIPE).communicate()[1]
print(var)