|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here! |
|
#1
|
|||
|
|||
|
creating an .EXE for a Python module wrapping Flash
hi,
I managed to get Python to be a wrapper for flash and they work well together but even after 3 days of working on it, I still cannot get py2exe to create a standalone. Has anyone successfully done this? |
|
#2
|
||||
|
||||
|
Do tell, very intersted. How exactly do you mean wrapping flash? Anyway creating exe's with py2exe is usually very easy, or i've never had a problem with it... what exactly is the problem?
Mark. |
|
#3
|
|||
|
|||
|
Quote:
To use Flash as a standalone application, we need something more powerful to wrap Flash, treating Flash as a COM object. Flash can then use fscommands to talk to the wrapper, the wrapper can talk to the OS, do stuffs, then send back stuffs to Flash. The usual combination for this is using VB and Flash. I guess a better word usage is to have VB as the backend and Flash as the front-end? But you should get the idea by now... So I use Python as the wrapper for Flash and it works great in authoring. But having py2exe to create an executable is extremely problematic for me. First, it seems using "win32com.client.gencache.EnsureModule" call prevents proper importing of the flash object, so I tried a different approach of using makepy.py to make a Python equivalence of the Flash object and use the "import" call instead of the "win32com.client.gencache.EnsureModule" and sure enough, it works in authoring, and the "ImportError" is gone when I execute the resulting .EXE, but now, I get a: "Application Error : The instruction at "0x1e034336" referenced memory at "0x00000004". The memory could not be "read"." Now, I'm stuck. |
|
#4
|
|||
|
|||
|
malnart, i am stuck with similar problems and i am wondering if by this time you have found a solution?
I, too, am embeding a swf in a python program and while authoring everything works fine. Even when building with py2exe i get no problems, but when trying to run the .exe i get AttributeError: 'module' object has no attribute 'ShockwaveFlash' if anybody has found a working solution i would be really happy if you could share ![]() thank you. |
|
#5
|
|||
|
|||
|
if anyone is interested, i finally found a way around this problem
![]() URL |
|
#6
|
||||
|
||||
|
Looks great! I'll have to try and remember this for if i ever do any flash Python interaction
! Anyway one little thing i knowticed from you're blog. The last line 'flashControl = flash'...Code:
if wxPlatform == '__WXMSW__':
from wxPython.lib.activexwrapper import MakeActiveXClass
import flash
flashControl = flash
could be writen like this using the as keyword in the import statment, which simply imports the 'flash' module and binds it to a different name... Code:
if wxPlatform == '__WXMSW__':
from wxPython.lib.activexwrapper import MakeActiveXClass
import flash as flashControl
Doesn't make much sence to me to have a copy of the 'flash' module (flashControle and flash) floating around in you're program but i may have missed something .Anyway have fun, Mark. |
|
#7
|
|||
|
|||
|
you're completely right Netytan
![]() <lame excuse> i just wanted to "illustrate" the thing that has changed and as i reference the flashControl later on i left it that way... </lame excuse> ![]() |
|
#8
|
|||
|
|||
|
well, I downloaded and compiled your code and I got the exact same error as my code, that's when I figure I didnt do anything wrong code-wise. So I reinstalled Python and everything works. I think it's because I had ActivePython installed...
Anyhow, it's time to get rid of VB! |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Python Programming > creating an .EXE for a Python module wrapping Flash |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|