473,412 Members | 2,142 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,412 software developers and data experts.

php and python: how to unpickle using PHP?

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
4 2987
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
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
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

<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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Max Ischenko | last post by:
Hi, I've started to develop under Microsoft ASP framework, which allows different lang. used in a ActiveX page. I wonder about possible strategies to use Python modules from VBScript <%%>...
3
by: syd | last post by:
Hello all, In my project, I have container classes holding lists of item classes. For example, a container class myLibrary might hold a list of item classes myNation and associated variables...
12
by: Laszlo Zsolt Nagy | last post by:
Hello, I would like to develop a new network protocol, where the server and the clients are Python programs. I think to be effective, I need to use TCP_NODELAY, and manually buffered transfers....
0
by: Kurt B. Kaiser | last post by:
Patch / Bug Summary ___________________ Patches : 378 open ( +3) / 3298 closed (+34) / 3676 total (+37) Bugs : 886 open (-24) / 5926 closed (+75) / 6812 total (+51) RFE : 224 open...
113
by: John Nagle | last post by:
The major complaint I have about Python is that the packages which connect it to other software components all seem to have serious problems. As long as you don't need to talk to anything outside...
2
by: Raja | last post by:
Hi, Attached is the code . I want my program to save the current printer job properties and , when I reconnect the printer at a latter date , i need to print the saved job . Can you please help...
6
by: Alan Isaac | last post by:
I am on a Windows box. I pickle a tuple of 2 simple objects with the pickle module. It pickles fine. It unpickles fine. I upload to a server. I try to unpickle from the URL. No luck. Try...
2
by: Danny Shevitz | last post by:
Howdy, In my app I need to exec user text that defines a function. I want this function to unpickle an object. Pickle breaks because it is looking for the object definition that isn't in the...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.