Writing a source code in Python
<p>I have a Source code in C, I want to write it in Python. I have <code>.so</code> library files for my C code, is it possible to change <code>.so</code> files to <code>.py</code> lib files for execution? </p>

<p>If so, how can I execute my python files? 
I mean in order to run C in python, we use something like below:</p>

<pre><code>gcc -shared -I/usr/include/python2.3/ -lpython2.3 -o myModule.so myModule.c
</code></pre>

<p>So is there is something like this to execute my python files or can I just use import command to execute?</p>

<p>You can use Python's <a href="https://docs.python.org/3.5/library/ctypes.html" rel="nofollow">ctypes</a> module to load <code>so</code> files and use their functions.<br>
Take a look at the second answer <a href="http://stackoverflow.com/questions/145270/calling-c-c-from-python?noredirect=1&amp;lq=1">here</a>.</p>

python