Need some advice

A

azrael

I am starting to work on a application and need some advice.

I am planing to develop a desktop application which would have some
usage, but also it should be able to comunicate to a web server which
hosts a php web application. So I wanted to ask if someone has some
expirience with connecting PHP webapplications with Python desktop
applications. Could someone at leaset point me to the right direction
where to look for informations.

Please, I know that google is my best friend, and I googled already,
but hoped that someone would give me a really great link
 
T

Tim Chase

I am planing to develop a desktop application which would have
some usage, but also it should be able to comunicate to a web
server which hosts a php web application. So I wanted to ask
if someone has some expirience with connecting PHP
webapplications with Python desktop applications. Could
someone at leaset point me to the right direction where to
look for informations.

Assuming you've already done the desktop application part (that's
google'able), you're just interested in Python web-service
utilization. You omit details of your PHP interface, whether
it's REST or SOAP. If it's a RESTful interface, you can just use
the batteries-included urllib/urllib2[1] to request the page you
want, and then use the resulting data. If it's a SOAP interface,
you can use the methods described at [2] to interact with it.

-tkc

[1]
http://www.python.org/doc/2.5.2/lib/module-urllib.html
http://www.python.org/doc/2.5.2/lib/module-urllib2.html


[2]
http://diveintopython.org/soap_web_services/index.html
http://pywebsvcs.sourceforge.net/
 
B

Bruno Desthuilliers

azrael a écrit :
I am starting to work on a application and need some advice.

I am planing to develop a desktop application which would have some
usage, but also it should be able to comunicate to a web server which
hosts a php web application. So I wanted to ask if someone has some
expirience with connecting PHP webapplications with Python desktop
applications. Could someone at leaset point me to the right direction
where to look for informations.

Short anwser: 'http'.

Longer answer: when it comes to interacting with a web application, the
language used to develop both applications is irrelevant. The client app
sends an HTTP request, and receive an HTTP response.
 
A

azrael

There have been some discutions with my partner about which protocol
to use. We agreed to use also http. But we are looking for a
possibility to use something to trasfer python objects like Json
objects.

If my memory is me well http transfers data in plaintext. Because of
the risk of datacapturing, is there a better soulutioon to suggest to
be more secure like shttp if it is implemented in python
 
B

Bruno Desthuilliers

azrael a écrit :
There have been some discutions with my partner about which protocol
to use. We agreed to use also http. But we are looking for a
possibility to use something to trasfer python objects like Json
objects.

'like' ???

there are a couple json implementation for Python, and for PHP too IIRC.
If my memory is me well http transfers data in plaintext.
Because of
the risk of datacapturing, is there a better soulutioon to suggest to
be more secure like shttp

I suppose you mean https...
if it is implemented in python

http://www.python.org/doc/2.5.2/lib/https-handler-objects.html
 
L

Larry Bates

azrael said:
I mean shttp. (secure hyper text transfer protocol)

Bruno is correct, the protocol IS https, you don't type shttp into your browser
get secure http connection.

You don't transfer python objects with JSON, you can transfer data that was
stored in Python objects via converting them to JSON (e.g. most JSON resembles a
Python dictionary, but it is a text representation). PHP couldn't do anything
with a Python object.

You may want to pick up a copy of "RESTful Web Services", from O'Reilly. It is
an excellent starting place for you.

-Larry
 
B

Bruno Desthuilliers

Larry Bates a écrit :
Bruno is correct, the protocol IS https, you don't type shttp into your
browser get secure http connection.

Well, there *is* a shttp protocol too - or at least, there's a RFC. Now
the fact is I never heard of it in 5 years of doing mostly web
development, and it seems that there are pretty few (if any) working
implementation available.

(snip)
 
L

Larry Bates

alex23 said:
Bruno is correct, the protocol IS https, you don't type shttp into your browser
get secure http connection.

https[1] and shttp[2] are two entirely different protocols.

[1] http://en.wikipedia.org/wiki/Https
[2] http://en.wikipedia.org/wiki/Secure_hypertext_transfer_protocol

Ok, I stand corrected on "shttp". I've been a programmer for over 30 years and
have been using python and web development for about 7 years and I've never seen
any reference to it until now. IMHO it wouldn't be a good idea to implement any
production code utilizing such an obscure protocol when https is available. You
asked for "advice" in the Subject of OP, that's my advice.

-Larry
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top