FlashPython

From Jonathan Gardner's Tech Wiki
Jump to: navigation, search

Introduction

I'd like to be able to write a Python program that is compiled into a Flash SWF file.

Compiling Python to ActionScript

I'd have to write some kind of compiler that takes Python code and compiles it into ActionScript. I'd be surprised in the PyPy project isn't useful for this. I'd be surprised if it was hard to do at all.

Writing an ActionScript Python Program

An alternative is to implement Python in ActionScript.

Including Resources

Part of compiling Python to SWF is including the resources that are needed. For instance, your code could have:

sound = Audio("some_file.wav")

And the compiler will recognize that, bring in some_file.wav, and put it into the SWF.

Or Maybe Not

This is just a sweet idea, but it is obviously a long journey to implement.

In the meantime, perhaps I can create a new language from scratch that compiles to ActionScript???

Or better yet, just rely on the tools that Flex provides.