can i write a assemly language programs in python

Dave Angel davea at ieee.org
Thu Jul 9 09:41:38 EDT 2009


m.reddy prasad reddy wrote:
> can any one tell me how to write assembly language programs in python...if
> no is there any other way to write the programs in python
>
> Reddi prasad reddy
> ph.no:09958083797
>
>   
Assembly language is a different programming language than Python.  You 
can use both in the same process, much in the same way you can use C or 
C++ with Python.  In fact, some of the system DLL's are written (partly) 
in assembler, though mostly in C or C++.

You'll need to tell us what your real goal is.  Are you a python 
programmer trying to optimize some loop?  Are you taking a course in 
assembler, and hope that somehow Python will help?  Do you have Python 
installed on your system?  What system is it?

As far as I know, Python has no "inline assembler" mode, as C does.   So 
anything written in assembler would be in a separate DLL, not mixed in 
your .py files.  It's not hard to mix assembly files with C or C++ files 
(or Pascal, or dozens of other compiled languages), and link them into a 
single DLL.  But Python's access to that DLL will be done through a 
module like ctypes, or SWIG.


DaveA



More information about the Python-list mailing list