From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id FAA11844; Thu, 29 Apr 2004 05:09:27 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id FAA12022 for ; Thu, 29 Apr 2004 05:09:26 +0200 (MET DST) Received: from hotmail.com (bay9-f26.bay9.hotmail.com [64.4.47.26]) by nez-perce.inria.fr (8.12.10/8.12.10) with ESMTP id i3T39Pjq008740 for ; Thu, 29 Apr 2004 05:09:25 +0200 Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Wed, 28 Apr 2004 20:09:24 -0700 Received: from 192.174.21.220 by by9fd.bay9.hotmail.msn.com with HTTP; Thu, 29 Apr 2004 03:09:24 GMT X-Originating-IP: [192.174.21.220] X-Originating-Email: [max_powers280@hotmail.com] X-Sender: max_powers280@hotmail.com From: "Max Powers" To: caml-list@inria.fr Subject: [Caml-list] Calling Ocaml from Python Date: Thu, 29 Apr 2004 12:39:24 +0930 Mime-Version: 1.0 Content-Type: text/plain; format=flowed Message-ID: X-OriginalArrivalTime: 29 Apr 2004 03:09:24.0639 (UTC) FILETIME=[5FF48AF0:01C42D97] X-Miltered: at nez-perce by Joe's j-chkmail ("http://j-chkmail.ensmp.fr")! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; python:01 python:01 gui:01 gui:01 wxpython:01 toolkits:01 blind:99 ocaml:01 ocaml:01 caml:01 280:98 jsp:98 parser:02 parser:02 module:03 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk This is a bit of a repeat of a question that I posted to comp.lang.python (sorry to anyone who was there too!). I'm looking for some advice on integrating a python GUI with an OCaml library. (Note: I'm fairly new to both ocaml and python; more of a perl and c++ programmer!) Basically the story is this, I'm building a GUI on the front of an existing OCaml tool. I'm writing the GUI in wxPython (there are a number of reasons why, I investigated various caml gui toolkits and unfortunately they didn't quite satisfy the requirements I had). Currently the GUI is envisaged as a glorified configuration file editor; it should help users to generate configuration files that are then handed to the ocaml tool to execute. The problem is this, both the python GUI and the ocaml tool need to know how to parse/understand the configuration file format, and I'd like to write the parser once (in ocaml, using ocamllex/yacc probably) and use it twice (in the GUI and the base tool). My challenge now is to figure out how to call the ocaml parser library from python. I currently have two possibilities in mind. Surfing the web uncovered Pycaml, which suggests integration both ways, however from the examples I only understand how python can be called from ocaml (not the other way). The second possibility is to wrap the ocaml module in a c library that can then be imported into the python code. What I'm hoping is that someone on the list has tried this sort of thing before and can give a little advice on the best way forwards (and hopefully reduce the number of blind alleys I explore!). Thanks, Max (sorry for the length of the message and any abuse of the nomenclature!) _________________________________________________________________ Personalise your phone with chart ringtones and polyphonics. Go to http://ringtones.com.au/ninemsn/control?page=/ninemsn/main.jsp ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners