[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Question regarding python scripting

From: Philippe Michel
Subject: Re: Question regarding python scripting
Date: Sun, 29 Dec 2019 23:14:59 +0100

On Wed, Dec 25, 2019 at 10:20:42PM +0000, Cihan Göksu wrote:

> Is there a way to communicate between the interactive pyshell (by typing 
> ">") and an external python script? For example, how can I send commands 
> to py Interactive shells via another python script? Is it possible to 
> import e.g. gnubg.match object into another python script?

gnubg.* is not a module that you can import in another python 
interpreter, it is only available to gnubg's embedded python.

The general idea is to do the reverse: run your python script inside 
gnubg's python shell, where you can use anything available in your 
Python path. Something like:

% ./gnubg -t
(No game) >
>>> from pytz import *
>>> timezone('Europe/Paris');
<DstTzInfo 'Europe/Paris' LMT+0:09:00 STD>


reply via email to

[Prev in Thread] Current Thread [Next in Thread]