python behaves differently when run through CMD
<p>when run through CMD reading a binary file will return a string instead of a byte_array.
for example:</p>

<pre><code>with open("Image_file", "rb") as f:
    data = f.read(1)
print(type(data))
</code></pre>

<p>will return str.
and when you run it via python IDLE it will return a bytearray.
what could be causing this?</p>