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 QAA14707; Thu, 29 Apr 2004 16:17:02 +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 QAA14479 for ; Thu, 29 Apr 2004 16:17:01 +0200 (MET DST) Received: from gatekeeper.elmer.external.excelhustler.com (gatekeeper.excelhustler.com [68.99.114.105]) by nez-perce.inria.fr (8.12.10/8.12.10) with ESMTP id i3TEH0jq026827 for ; Thu, 29 Apr 2004 16:17:00 +0200 Received: from chatterbox.elmer.internal.excelhustler.com (unknown [192.168.0.12]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (Client CN "chatterbox.elmer.internal.excelhustler.com", Issuer "excelhustler.com" (not verified)) by gatekeeper.elmer.external.excelhustler.com (Postfix) with ESMTP id B660BE013F; Thu, 29 Apr 2004 09:16:59 -0500 (CDT) Received: from localhost (localhost [127.0.0.1]) by chatterbox.elmer.internal.excelhustler.com (Postfix) with ESMTP id 3B9BC5C005; Thu, 29 Apr 2004 09:16:59 -0500 (CDT) Received: from wile.internal.excelhustler.com (wile.internal.excelhustler.com [192.168.1.34]) by chatterbox.elmer.internal.excelhustler.com (Postfix) with ESMTP id 280655C004; Thu, 29 Apr 2004 09:16:59 -0500 (CDT) Received: by wile.internal.excelhustler.com (Postfix, from userid 1000) id 21A941B058; Thu, 29 Apr 2004 09:16:59 -0500 (CDT) Date: Thu, 29 Apr 2004 09:16:59 -0500 From: John Goerzen To: Max Powers Cc: caml-list@inria.fr Subject: Re: [Caml-list] Calling Ocaml from Python Message-ID: <20040429141659.GC12640@excelhustler.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.5.1+cvs20040105i X-Scanned-By: clamscan at chatterbox.elmer.internal.excelhustler.com 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; caml-list:01 python:01 2004:99 python:01 gui:01 gui:01 quux:01 ocaml:01 ocaml:01 parser:02 parser:02 string:03 wrote:03 library:03 btw:03 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Thu, Apr 29, 2004 at 12:39:24PM +0930, Max Powers wrote: > 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. How about not writing a parser at all? In Python, use ConfigParser, and in OCaml, use, erm, ConfigParser! :-) (See http://quux.org/devel/missinglib) BTW, the ConfigParser in missinglib will shortly have string interpolation in the same manner as Python has. > 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). Hmm... what makes that a problem for you? (What specifically are you trying to do that requires you to call OCaml from Python?) -- John ------------------- 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