In 'IDA PRO', let 'IDAPython' import default module at startup
<p>We know 'IDAPython' loads several modules by default at startup, such as idaapi, idautils.... I wrote a module to let python print all numbers as hex format in the command window, which I wish can be imported each time when python loads  those default modules. how to achieve that?</p>

<p>Create a file <code>%APPDATA%\Hex-Rays\IDA Pro\idapythonrc.py</code> with the following content:</p>

<pre><code>import idaapi
idaapi.require('mymodule')
</code></pre>

<p>With this file in place, you can even keep <code>mymodule.py</code> in the same directory.</p>

<p>P.S. IDA can tell you the path to this directory, too, which could be handy on other OSes or if the relevant company name changes again ;-).  Just enter:</p>

<pre><code>get_user_idadir()
</code></pre>

<p>at the prompt.</p>

python ida