Archive for the ‘PYTHON’ Category
Monday, May 18th, 2009
pyamf is pretty sweet for Flash remoting with Pythonic server side, but now we have two nicely done and integrated remoting kits for python on the server side.
amfast is a new remoting library that looks to be as sweet as pyamf (where sweet == fast and useful). I am checking out amfast now but the speed boost alone might be worth it. For instance, working with real-time games, when you need static content you need to grab that quickly sometimes via a content service. The faster that link the better. It also has Twisted integration which is great for networking and SQLAlchemy integration which is in my opinion the best ORM for python (pyamf has twisted, django, pylons, sqlalchemy as well)
amfast is well documented and has some great examples. If you have the Python addiction, check it.
Description
- AmFast is a Flash remoting framework for Python.
- AmFast can use AMF to communicate between Python and Flash, Flex, and any other system that supports AMF.
- AMF is a binary object serialization protocol used by Actionscript based applications.
Server Features
- Support for NetConnection and RemoteObject RPC.
- Support for Producer/Consumer ‘push’ messaging with HTTP polling, HTTP long-polling, and real-time HTTP streaming channels.
- Support for authentication with NetConnection and RemoteObject.
- Flexible Target mapping system to map message destinations to invokable Target objects.
- Support for ChannelSets with multiple Channels to expose resources in different ways.
- Built in Channels for CherryPy, Twisted Web, and plain WSGI.
- Support for configurable Endpoints. Use AmFast’s built-in AMF encoder/decoder C-extension, or use an external AMF encoder/decoder, such as PyAmf for a pure-Python implementation.
AMF Encoder/Decoder Features
- AMF0/AMF3 encoder/decoder written in C as a Python extension for speed.
- More than 10x faster than the PyAmf encoder/decoder (even when using PyAmf’s optional C-extension).
- Map custom classes with ClassDef objects for complete control over serialization/de-serialization.
- Full support for IExternalizable objects.
- Data persistence with SqlAlchemy including remotely-loadable lazy-loaded attributes.
- Actionscript code generation from ClassDef objects.
Tags: ACTIONSCRIPT, AMF, AMF0, AMF3, AS3, messaging, PYTHON, remoting, services, web
Posted in ACTIONSCRIPT, ACTIONSCRIPT3, AMF, APPLICATIONS, ARCHITECT, AS3, DEVELOPMENT, FLASH, FLEX, GAMEDEV, GAMES, LIBRARIES, OPEN SOURCE, PYTHON, TECHNOLOGY, tracking | View Comments
Friday, September 26th, 2008
If you are exporting from blender to actionscript directly so you can get your models into flash as script you can use the Blender to .as3 exporter which so kindly supports all flash 3d engines currently Away3D, Papervision3D and Sandy3D. Dennis Ippel made the Blender exporter a while back but the update supports papervision 2.0.

The benefits of COLLADA are nice but there are so many differences that you can run into trouble. With the exporter it is a direct faces and vector export without all the bloat of DAE/COLLADA xml. This works if you are only developing for flash and dont’ need to use the models in other platforms/systems/engines that aren’t in flash.
Tags: 3d, AS3, blender, engines, exporter, FLASH, pipeline
Posted in 3D ENGINES, 3d, ACTIONSCRIPT, ACTIONSCRIPT3, ARCHITECT, AS3, AWAY3D, DEVELOPMENT, FLASH, FLEX, GAMEDEV, OPEN SOURCE, PAPERVISION, PERFORMANCE, PROGRAMMING, PYTHON, RENDERING, SANDY, TECHNOLOGY, TOOLS | View Comments
Wednesday, April 16th, 2008
Tags: AMF, AMF0, AMF3, AS3, FLASH, gae, google app engine, netconnection, pyamf, PYTHON, remoting, result
Posted in ACTIONSCRIPT, ACTIONSCRIPT3, AMF, API, APPLICATIONS, ARCHITECT, AS3, DATA, DEVELOPMENT, FLASH, FLEX, GAMEDEV, MARKET, OPEN SOURCE, PROGRAMMING, PYTHON, RED5, STANDARDS, SYNDICATION, TECHNOLOGY, TOOLS | Comments Off
Thursday, March 20th, 2008
I have officially been sucked into the Python vortex. I recently have really been digging IronPython, Jython and good old plain Python but have not ventured here yet. Google (They employ Guido), Microsoft (IronPython) and Sun (Jython) are all becoming infected pythonistas as well. But this is just too cool, Python to AS3 code with flex-pypy. This project is very young but could be fun, source at Google Code.
Haxe has a similar premise where it can compile to Flash6-9 versions of actionscript 2-3 which makes for a system with better reach. Python code for this is lots of fun and very flexible. Python is becoming a baseplane language and one great language for transcending platform lock-in.
Check out this snippet pulled from here (click to see sample game)
#/usr/bin/env python
"""
This simple example has very little to do with the pygame
chimp example, except that it will act the same (more or less)
and it uses the same resources, only they got converted to
mp3s, pngs.
"""
#Import Modules
from pypy.translator.flex.modules.flex import *
class MyRect:
def __init__(self,x,y,w,h):
self.x, self.y,self.w,self.h = x,y,w,h
SCREEN_W = 468
SCREEN_H = 60
class Game:
def __init__(self):pass
def init(self,screen):
self.screen = screen
screen.layout = 'absolute'
screen.setActualSize(SCREEN_W, SCREEN_H)
screen.addEventListener('mouseMove',mousemotion)
screen.addEventListener('enterFrame',do_loop)
screen.addEventListener('click',chimp_whip)
self.bg = load_sprite("py_background_png");
self.screen.addChild(self.bg)
self.chimp = load_sprite("py_chimp_png");
self.screen.addChild(self.chimp)
self.orig_y = self.chimp.y
img2 = self.fist = load_sprite("py_fist_png")
self.screen.addChild(img2)
img2.move(400,img2.height/2)
self.move = 1
self.spin = 0
self.hit = 0
self.hit_move = 1
self.sfx = {}
self.sfx['whip'] = load_sound_resource("py_punch_mp3")
self.sfx['nohit'] = load_sound_resource("py_whiff_mp3")
def loop(self):
img = self.chimp
if self.spin:
self.spin -= 1
img.rotation = self.spin*24
else:
img.x += self.move * 8
if img.x > SCREEN_W-img.width:
self.move = -1
if img.x < 0:
self.move = 1
if self.hit:
self.hit -= 1
self.fist.y += 6 * self.hit_move
if self.hit SCREEN_W - img_halfw:
newx = SCREEN_W - img.width
if newx img.x and e.stageX < img.x+img.width:
game.sfx['whip'].play()
game.spin = 20
else:
game.sfx['nohit'].play()
def flash_main( x=1 ):
game.init(castToWindow(x))
Tags: ACTIONSCRIPT, ACTIONSCRIPT3, AS3, CODE, FLASH, FLEX, flex-pypy, pypy, PYTHON
Posted in ACTIONSCRIPT, ACTIONSCRIPT3, ARCHITECT, AS3, BASEPLANE, DEVELOPMENT, DYNAMIC, FLASH, FLEX, FUNCTIONAL, HAXE, MARKET, OPEN SOURCE, PROGRAMMING, PYTHON, STANDARDS, TECHNOLOGY | View Comments
Thursday, April 26th, 2007
Posted in CODE, PIXEL, PROGRAMMING, PYTHON | Comments Off