php and python: how to unpickle using PHP?

Discussion in 'Python' started by Ted Zeng, Oct 2, 2006.

  1. Ted Zeng

    Ted Zeng Guest

    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
     
    Ted Zeng, Oct 2, 2006
    #1
    1. Advertising

  2. 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
     
    Irmen de Jong, Oct 2, 2006
    #2
    1. Advertising

  3. Ted Zeng

    Guest

    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, 2006
    #3
  4. On Mon, 02 Oct 2006 23:44:26 +0200, Irmen de Jong <>
    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
     
    Thomas Jollans, Oct 2, 2006
    #4
  5. Ted Zeng

    Tim Arnold Guest

    <> wrote in message
    news:...
    > 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
     
    Tim Arnold, Oct 3, 2006
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Yun Mao

    secure unpickle?

    Yun Mao, Jan 19, 2004, in forum: Python
    Replies:
    7
    Views:
    377
    Michael Hudson
    Jan 20, 2004
  2. Tim Peters

    RE: secure unpickle?

    Tim Peters, Jan 19, 2004, in forum: Python
    Replies:
    0
    Views:
    446
    Tim Peters
    Jan 19, 2004
  3. sosman

    unpickle error

    sosman, Jun 28, 2004, in forum: Python
    Replies:
    2
    Views:
    729
    sosman
    Jun 29, 2004
  4. Ted Zeng
    Replies:
    0
    Views:
    679
    Ted Zeng
    Oct 13, 2006
  5. Rajive Narain
    Replies:
    0
    Views:
    2,068
    Rajive Narain
    Sep 18, 2009
Loading...

Share This Page