From mboxrd@z Thu Jan 1 00:00:00 1970 From: stardiviner Subject: Re: ob-python noweb and :var reference error Date: Fri, 29 Dec 2017 20:06:12 +0800 Message-ID: References: <6b421b98-6a4c-cd1a-07ec-efd2fd4b559d@gmail.com> <87r2rdix0a.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:36329) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eUtQc-0000uG-EQ for emacs-orgmode@gnu.org; Fri, 29 Dec 2017 07:06:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eUtQX-0007D0-HH for emacs-orgmode@gnu.org; Fri, 29 Dec 2017 07:06:22 -0500 Received: from mail-pl0-x230.google.com ([2607:f8b0:400e:c01::230]:36413) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eUtQX-0007CF-BM for emacs-orgmode@gnu.org; Fri, 29 Dec 2017 07:06:17 -0500 Received: by mail-pl0-x230.google.com with SMTP id b12so22881989plm.3 for ; Fri, 29 Dec 2017 04:06:17 -0800 (PST) In-Reply-To: <87r2rdix0a.fsf@nicolasgoaziou.fr> Content-Language: en-US List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Nicolas Goaziou Cc: emacs-orgmode If I use that noweb reference, then I got this error: >  File "", line 8 >    client = DelugeRPCClient('127.0.0.1', 58846, cat ~/.config/deluge/auth | cut -d ":" -f 1, cat ~/.config/deluge/auth | cut -d ":" -f 2)                                                      ^ SyntaxError: invalid syntax This is because the <> output is not a string in Python src block. I also tried to specify `:results` to `value`, `output` and `raw` in `deluge-daemon-password` etc. But none of them works. On 12/29/2017 07:39 PM, Nicolas Goaziou wrote: > Hello, > > stardiviner writes: > >> I installed python packages through `pip`: >> >> #+begin_src shell >> pip install deluge-client >> #+end_src >> >> >> If you want to test those src blocks, you also need to make sure Deluge >> installed and daemon started. >> >> And use `deluge-client` like this: >> >> #+NAME: deluge-daemon-username >> #+begin_src shell >> >> cat ~/.config/deluge/auth | cut -d ":" -f 1 #+end_src >> >> #+RESULTS: deluge-daemon-username >> : localclient >> >> #+NAME: deluge-daemon-password >> #+begin_src shell >> >> cat ~/.config/deluge/auth | cut -d ":" -f 2 #+end_src >> >> #+RESULTS: deluge-daemon-password >> : 9b83ceded9ac08cc5c7403b093115874a6086958 >> >> #+begin_src python :noweb yes :results list >> from deluge_client import DelugeRPCClient >> >> client = DelugeRPCClient('127.0.0.1', 58846, username, password) > Shouldn't this be: > > client = DelugeRPCClient('127.0.0.1', 58846, <>, <>) > > Untested. > > Regards, >