python server

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • linuxpld

    #1

    python server

    Hello

    I`m writing a program (server in future) in python.
    I would like to write it in such a way that I will be able to write gui
    in any language and connect to my python program and use functionality
    included with it.
    are there any libraries that I could use?

    I dont know if i wrote it understandably but maybe picture will explain
    it:

    |------------|
    | python |
    | | <- module in python -> <- connection ("???") -> <-gui in
    any language (java, c++, python, etc).
    | server |
    |-----------|
    what could I use as "???"? http? mqseries? webservices? what are the
    possibilites?

    thx for answers
    linuxfan

  • Bill Mill

    #2
    Re: python server

    On 7 Nov 2005 10:22:18 -0800, linuxpld <linuxpld@gazet a.pl> wrote:[color=blue]
    > Hello
    >
    > I`m writing a program (server in future) in python.
    > I would like to write it in such a way that I will be able to write gui
    > in any language and connect to my python program and use functionality
    > included with it.
    > are there any libraries that I could use?[/color]

    Lots...Perhaps you should start off in understanding your problem by
    learning about sockets:


    Sockets are a generalized method for passing data between programs on
    the same or different computers.
    [color=blue]
    >
    > I dont know if i wrote it understandably but maybe picture will explain
    > it:
    >
    > |------------|
    > | python |
    > | | <- module in python -> <- connection ("???") -> <-gui in
    > any language (java, c++, python, etc).
    > | server |
    > |-----------|
    > what could I use as "???"? http? mqseries? webservices? what are the
    > possibilites?[/color]

    http, webservices, xmlrpc, corba, people to type in messages between
    programs, carrier pigeons, and sockets are all possibilities. I'm
    gonna recommend that you learn sockets, because they're a general
    solution to this problem, and many methods of inter-program
    communication are based on sockets, but I don't know the specifics of
    the program you're designing.

    How tightly will the client and server interact? In what environment
    (ie over the internet, over a corporate LAN, on the same computer, on
    Internet2)? Is there any framework in existance, or is this program
    being written from scratch?

    Peace
    Bill Mill
    bill.mill at gmail.com

    Comment

    • Magnus Lycka

      #3
      Re: python server

      linuxpld wrote:[color=blue]
      > I`m writing a program (server in future) in python.
      > I would like to write it in such a way that I will be able to write gui
      > in any language and connect to my python program and use functionality
      > included with it.
      > are there any libraries that I could use?[/color]

      Thee are many solutions. An XML-RPC server springs to mind as a
      solution. There are several Python XML-RPC servers, and clients
      for a wide range of languages, see:


      Plain sockets can work of course, but that's fairly low
      level: You'll need to device a protocol etc.

      For more possible solutions, see

      Comment

      • Frithiof Andreas Jensen

        #4
        Re: python server


        "linuxpld" <linuxpld@gazet a.pl> wrote in message
        news:1131387737 .953307.178470@ g44g2000cwa.goo glegroups.com.. .[color=blue]
        > Hello
        >
        > I`m writing a program (server in future) in python.
        > I would like to write it in such a way that I will be able to write gui
        > in any language and connect to my python program and use functionality
        > included with it.
        > are there any libraries that I could use?[/color]

        That depends on what you want and what other "goodies" you want.

        I liked "Python Web Modules" http://www.pythonweb.org/ a lot, mostly because
        I needed a decent Database interface and because you do not have to "buy"
        the entire framework like you do with f.ex. CORBA if you only want to use
        some of it. Everything runs a browser these dayz.

        Another possibility is to write a command-line interpreter that takes
        commands from a socket and returns results. All ASCII of course. ASCII is
        easy to debug.

        This is very generic, robust and easy to write test scripts for. The
        disadvantage is that you need a parser in the GUI and one in the
        Application. The huge advantage is that you completely separate the
        internals of the two programs from each other.

        Most client-server UNIX/Linux applications are written this way; i.e. this
        programming method survives in the wild because it is stable and it works.
        The RPC frameworks tend to run up on a wild hype-cycle before being
        generally left to maintenance programmers to sort out.

        Consider a "Mailbox" system, where packages of work is send to a server
        process and processed results are shipped back to the client process. The
        trick is to keep all state inside the "work packages" so the servers do not
        need to track anything. "MAKE" is a file-based implementation of this.


        OTOH:

        For Python <-> Python situations, the "Python Remote Objects", PYRO is not
        bad at all. And it does have an Event mechanism, which can be used as a
        "Mailbox" service. For reliable "shared memory" tasks ZOPE is good or maybe
        SPREAD.

        CORBA is overkill for everything, IMO ;-)
        [color=blue]
        >
        > I dont know if i wrote it understandably but maybe picture will explain
        > it:
        >
        > |------------|
        > | python |
        > | | <- module in python -> <- connection ("???") -> <-gui in
        > any language (java, c++, python, etc).
        > | server |
        > |-----------|
        > what could I use as "???"? http? mqseries? webservices? what are the
        > possibilites?
        >
        > thx for answers
        > linuxfan
        >[/color]


        Comment

        • Frithiof Andreas Jensen

          #5
          Re: python server


          "Magnus Lycka" <lycka@carmen.s e> wrote in message
          news:dkpne7$h5e $1@wake.carmen. se...
          [color=blue]
          > Thee are many solutions. An XML-RPC server springs to mind as a
          > solution. There are several Python XML-RPC servers[/color]
          ......

          Good Idea. Seems that those particular batteries are included with Python
          2.2 and up:

          OP: See help on: "SimpleXMLRPCSe rver" and "xmlrpclib"


          Comment

          Working...