By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,676 Members | 2,262 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,676 IT Pros & Developers. It's quick & easy.

php and python: how to unpickle using PHP?

P: n/a
Hi,

I store some test results into a database after I use python
To pickle them (say, misfiles=['file1','file2'])

Now I want to display the result on a web page which uses PHP.
How could the web page unpickle the results and display them?
Is there a PHP routine that can do unpickle ?

Ted zeng

Oct 2 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Ted Zeng wrote:
Hi,

I store some test results into a database after I use python
To pickle them (say, misfiles=['file1','file2'])

Now I want to display the result on a web page which uses PHP.
How could the web page unpickle the results and display them?
Is there a PHP routine that can do unpickle ?

Ted zeng
Pickle is Python specific.
You may be able to write something that can unpickle
the basic datatypes but I wouldn't bother with it.

Try to find a language neutral marshaling format
(yaml? xml? whatever) and access that from both Python and PHP...

--Irmen
Oct 2 '06 #2

P: n/a
Ted Zeng:
I store some test results into a database after I use python
To pickle them (say, misfiles=['file1','file2'])
Now I want to display the result on a web page which uses PHP.
How could the web page unpickle the results and display them?
Is there a PHP routine that can do unpickle ?
Instead of pickling, maybe you can save the data from python in json
format:
http://www.json.org/
Then you can read it from PHP.

Bye,
bearophile

Oct 2 '06 #3

P: n/a
On Mon, 02 Oct 2006 23:44:26 +0200, Irmen de Jong <ir**********@xs4all.nl>
let this slip:
Ted Zeng wrote:
(...)
Try to find a language neutral marshaling format
(yaml? xml? whatever) and access that from both Python and PHP...
yaml should be well-suited due to its nature as serialization format, akin
to pickle.

--
Thomas Jollans alias free-zombie
Oct 2 '06 #4

P: n/a

<be************@lycos.comwrote in message
news:11*********************@h48g2000cwc.googlegro ups.com...
Ted Zeng:
>I store some test results into a database after I use python
To pickle them (say, misfiles=['file1','file2'])
Now I want to display the result on a web page which uses PHP.
How could the web page unpickle the results and display them?
Is there a PHP routine that can do unpickle ?

Instead of pickling, maybe you can save the data from python in json
format:
http://www.json.org/
Then you can read it from PHP.
wddx format is a workable solution as well

http://pyxml.sourceforge.net/
plus
http://us2.php.net/wddx
Oct 3 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.