how to write integer number in particular no of bytes in python ( file writing)
<p>assume i have to store few integer numbers like 1024 or 512 or 10240 or 900000 in a file, but the condition is that i can consume only 4 bytes (not less nor max).but while writing a python file using write method it stored as "1024" or "512" or "10240" ie they written as ascii value but i want to store directly their binary value.</p>

<p>Any help will really appreciable. </p>
