News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Daniel Cousineau's Blog:
Serialize Python Variables To PHP
October 22, 2008 @ 08:47:39

As a part of a current project Daniel Cousineau came across the need to bridge two languages - PHP and Python - via some serialized variables. This new post on his blog shows how he did it.

So I'm in the planning stages of a project where I'll probably be doing some heavy lifting in Python and serving up the output through PHP. Obviously this will entail transmitting data between Python and PHP and while I haven't had a chance to do performance testing to see if it's worth it to save to a database, the only other option was to serialize the data to a file that PHP could parse quickly. Obviously, the output from serialize() is going to be the fastest way to recieved the data.

As he was working on his own implementation, he came across a currently existing Python library (that adds the serialize support) and but found it lacking for what he needed. He continued on, working up his own customized implementation with all the features he needed. He includes both the Python and PHP code (cut and paste ready) as well as the results from the serialization of different data types.

0 comments voice your opinion now!
serialize python variable library example


blog comments powered by Disqus

Similar Posts

Skaldrom's Blog: Want to create your own progranning language? Lexer & Parser in PHP!

PHP.net: PHP 5.4.14 and PHP 5.3.24 released!

PHPImpact Blog: Geo Proximity Search with PHP, Python and SQL

Juozas Kaziukenas' Blog: Debugging with FirePHP and Firebug

Zend Developer Zone: PHP Built in Input filtering


Community Events





Don't see your event here?
Let us know!


code development community series zendserver threedevsandamaybe laravel framework tips deployment podcast release language bugfix introduction interview list api symfony conference

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework