Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #2294 > unrolled thread

call php function from python

Started byCrabbyPete <pete.douma@gmail.com>
First post2011-03-31 11:46 -0700
Last post2011-04-01 00:19 -0700
Articles 3 — 3 participants

Back to article view | Back to comp.lang.python


Contents

  call php function from python CrabbyPete <pete.douma@gmail.com> - 2011-03-31 11:46 -0700
    Re: call php function from python John Bokma <john@castleamber.com> - 2011-03-31 13:24 -0600
    Re: call php function from python Tim Roberts <timr@probo.com> - 2011-04-01 00:19 -0700

#2294 — call php function from python

FromCrabbyPete <pete.douma@gmail.com>
Date2011-03-31 11:46 -0700
Subjectcall php function from python
Message-ID<0d2bf776-899c-4257-a78c-c24ac90f5747@s33g2000vbb.googlegroups.com>
I have a python script that automatically loads wordpress, up to the
point that it asks for the admin password.
that is a php function call

function wp_install( $blog_title, $user_name, $user_email, $public,
$deprecated = '', $user_password = '' )

Is there a way to call this function from python?

[toc] | [next] | [standalone]


#2298

FromJohn Bokma <john@castleamber.com>
Date2011-03-31 13:24 -0600
Message-ID<87sju32iw5.fsf@castleamber.com>
In reply to#2294
CrabbyPete <pete.douma@gmail.com> writes:

> I have a python script that automatically loads wordpress, up to the
> point that it asks for the admin password.
> that is a php function call
>
> function wp_install( $blog_title, $user_name, $user_email, $public,
> $deprecated = '', $user_password = '' )
>
> Is there a way to call this function from python?

What do you mean with "loads" wordpress? I think the easiest thing to
do, and what I've done in the past, is to call Wordpress via its web
interface. I.e. instead of trying to find out how to call wp_install,
use the post method with the right data and the right URL.

-- 
John Bokma                                                               j3b

Blog: http://johnbokma.com/    Facebook: http://www.facebook.com/j.j.j.bokma
    Freelance Perl & Python Development: http://castleamber.com/

[toc] | [prev] | [next] | [standalone]


#2339

FromTim Roberts <timr@probo.com>
Date2011-04-01 00:19 -0700
Message-ID<ssuap6tpo26mdcpnfcfbhsd1siemfd96aq@4ax.com>
In reply to#2294
CrabbyPete <pete.douma@gmail.com> wrote:
>
>I have a python script that automatically loads wordpress, up to the
>point that it asks for the admin password.
>that is a php function call
>
>function wp_install( $blog_title, $user_name, $user_email, $public,
>$deprecated = '', $user_password = '' )
>
>Is there a way to call this function from python?

Are you running this script on the web server, or are you invoking this
over a socket using something like urllib?

If you are running remotely, then PHP does not exist.  All you have are
HTTP requests.  You need to make yourself look exactly like a human being
at a browser.  Fortunately, that's not too hard.
-- 
Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web