From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Stefan Israelsson Tampe Newsgroups: gmane.lisp.guile.user Subject: Re: python-on-guile Date: Sun, 9 Feb 2020 18:59:21 +0100 Message-ID: References: <018d235b0c26bb87be28ddb1a2b26d42@selfhosted.xyz> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="25781"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Guile User To: david larsson Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Sun Feb 09 18:59:48 2020 Return-path: Envelope-to: guile-user@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1j0qrz-0006db-Qi for guile-user@m.gmane-mx.org; Sun, 09 Feb 2020 18:59:47 +0100 Original-Received: from localhost ([::1]:53378 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j0qry-0000ea-Qd for guile-user@m.gmane-mx.org; Sun, 09 Feb 2020 12:59:46 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43978) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j0qro-0000cB-W6 for guile-user@gnu.org; Sun, 09 Feb 2020 12:59:38 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j0qrm-0007cV-0X for guile-user@gnu.org; Sun, 09 Feb 2020 12:59:36 -0500 Original-Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]:40281) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j0qrl-0007bk-Pm for guile-user@gnu.org; Sun, 09 Feb 2020 12:59:33 -0500 Original-Received: by mail-wr1-x42d.google.com with SMTP id t3so4723620wru.7 for ; Sun, 09 Feb 2020 09:59:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=59UtDWCj5LSYn2f1fLvui8/7oS8rs/VP0GtxLwNqYw4=; b=oDhiVHzkOmEPs7LLA38XIPJpWQ1O6YbYuBVHpCoZgB7Kzut4Cu+c9t4CUQGqpZDFtJ AW875JplAJ4YdP80Zw7hiVw59Rs0RUQF97FZ9aKjPzIUO1A1Y1yGa/xdCxQWdqq9Go2U QccZyi3NYDqyWL7noSnvsyjcTS9fl7Z9CNX1z9ZwuCt41nUJ+K1x2B27nPQaZgvVLf6s 0qxV+0p6s4/FVpi6Dqxy2ftUffxMH77UQvkSUo41EprVyXBlIqhUQ6xxly5/VMjDd5u3 3Yz2KB7qDXRYgeK1MYj7gnJZNbJ3lzEPsWm/atQ45qSV5OVSB63/yPGAc0Jr1fgE1W6C 23Rw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=59UtDWCj5LSYn2f1fLvui8/7oS8rs/VP0GtxLwNqYw4=; b=t/DPkeK1t6rkvFWUk7Lswhn80GZN5MvFX2a9Pizac5cmYu22cLf1w5NPsCHE5CMNBk EzkpiLY+VksfOZ+tJ98iod1DCnhtuyCN5xRa69gEcbwB/+5tGvg23prbVzdC07zlftRe oClEAG7ElM4SBjxX2HCDHbQ0L+5NBao/aDn+/Y7kXPeBwhji5dOGwBN7GuSrj/oLqhA5 Uki3CjoFSHVC3ZsM+Kfp0N2GaW+qeMYtzvQIn+tsOBTZBzXYsTNP1icY/Wlv4foODySF +7V336mXazfd/7MZsmxdTW4KZ72bwt1ku2ubPYh7eoDXBVBSb/Sa3XHXhlhZj/m04y5u Si6g== X-Gm-Message-State: APjAAAW+NdBmWYoTSDTw9Rdb2/TjNfRHABt45g/iTAMGwd6Hd0bOgkHV ylOesYqtkzMXs/y5QCt+7coStJGs5EWk+W/5wmh42QZn X-Google-Smtp-Source: APXvYqxv85FoRsSFhpLM65mj99U34bOvxlJpKATvy3oOHf/YgDJ+dkokvSVsEI3pe8SMo/J9mY2nYnGp+hphYg0Pi9U= X-Received: by 2002:a05:6000:108b:: with SMTP id y11mr12273194wrw.187.1581271172276; Sun, 09 Feb 2020 09:59:32 -0800 (PST) In-Reply-To: <018d235b0c26bb87be28ddb1a2b26d42@selfhosted.xyz> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::42d X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Original-Sender: "guile-user" Xref: news.gmane.io gmane.lisp.guile.user:16146 Archived-At: I'm the author of that lib. 1) The main bindings are reachable through (language python module python) So you could now go ahead and do > (use-modules (language python module python)) > ;L python And you will get a python shell that works quite ok for one liners 2) If you write a module and place it in a/b/c.py you can use the classes and functions theirin by (use-modules (a b c)) 3) you can load a .py file as (i hope this work) (load "a.py") 4) If you place a module in (language python module a.py) you can import ir as a usual mode as > from a import * The documentation is for the macro framework that enables you to work with python classes and idioms like python iteration. Hope this helps /Stefan On Sun, Feb 9, 2020 at 6:31 PM david larsson wrote: > Hi everyone, > I am trying to wrap my head around how to use the python-on-guile > library, but Im struggling. Does anyone have example code that might > help, and which isn't too advanced? > > All tips and suggestions appreciated! > > Best regards, > David > >