Author Topic: Python and Assembly?  (Read 2196 times)

0 Members and 1 Guest are viewing this topic.

Offline DerpyTurtle

  • Peasant
  • *
  • Posts: 80
  • Cookies: -12
    • View Profile
Python and Assembly?
« on: March 22, 2013, 12:25:32 am »
I was wondering if it were possible to make an .exe out of some python scripts I have by using assembly by including them and making a call to them before compiling, Im fairly new to assembly and am not 100% sure what it can do yet, thats why I am asking if this will work

Offline techb

  • Soy Sauce Feeler
  • Global Moderator
  • King
  • *
  • Posts: 2350
  • Cookies: 345
  • Aliens do in fact wear hats.
    • View Profile
    • github
Re: Python and Assembly?
« Reply #1 on: March 22, 2013, 01:26:27 am »
Honestly, I don't really understand the question. Do you want to exec assembly in Python? Or exec Python in assembly? Since you mentioned .exe do you want to compile your python script that uses ASM into an .exe, or generate an .exe from ASM that calls some python scripts?

For ASM in python, this may be relevant, but I have never done it nor had a need to. But this might be of use?
http://stackoverflow.com/questions/6040932/executing-assembler-code-with-python

But to be honest, I don't see a need for this. If you need something in ASM why put python in it? It will hinder exec speed and all, and if you need ASM in a python script, what's wrong with using C instead?
>>>import this
-----------------------------

Offline DerpyTurtle

  • Peasant
  • *
  • Posts: 80
  • Cookies: -12
    • View Profile
Re: Python and Assembly?
« Reply #2 on: March 22, 2013, 01:50:55 am »
I want to use Assembly to call my python scripts and make an exe out of that, and Im wondering if it would function or not.


Thank you for the references I will give them a look!

Offline techb

  • Soy Sauce Feeler
  • Global Moderator
  • King
  • *
  • Posts: 2350
  • Cookies: 345
  • Aliens do in fact wear hats.
    • View Profile
    • github
Re: Python and Assembly?
« Reply #3 on: March 22, 2013, 02:07:13 am »
I'm not an assembler programmer, but here are some links:

http://stackoverflow.com/questions/11964935/run-another-program-from-assembly-language

http://stackoverflow.com/questions/10056685/assembly-load-and-execute-issue
If Python is in the system path maybe?

http://my.opera.com/assembly%20pro/blog/how-run-a-program-in-assembly
Again not an ASM person, but may hold relevance?

Although I would req running assembly in your python script for ease. Python can/will support running assembly, be much easier to put ASM in python itself. My opinion though.
« Last Edit: March 22, 2013, 02:09:22 am by techb »
>>>import this
-----------------------------