Xavier, thankyou for your help.
On 17 May 2017 at 14:02, Xav...@CE... <Xav...@ce...>
wrote:
> On Wed, 2017-05-17 at 11:32 +0200, John Hearns wrote:
> > I guess I am being too sh-type shell centric here.
> >
> >
> > I have a bash script which is running some commands relevan to PbsPro.
> > So I would load the pbspro module we have the execute the command,
> > perhaps:
> >
> >
> > module load pbspro
> > qmgr -c "list server"
> >
> >
> > Is there an equivalent way to do this in Python?
> > ie. to load a module and when you call subrpocess to run a command
> > have the environment inherited?
>
> Yes you can also do that in Python. After sourcing a Python-specific
> Modules init script, you are able to call 'module' function.
>
> Initialisation and usage example is provided in the "Examples of
> initialization" section of the module(1) man page:
>
> http://modules.sourceforge.net/tcl/module.html
>
> Enjoy,
> Xavier
>
> > Before anyone says it, I realise that there is a PbsPro Python
> > interface using hooks.
> > I am just trying to do something quick and dirty.
>
> ------------------------------------------------------------
> ------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> Modules-interest mailing list
> Mod...@li...
> https://lists.sourceforge.net/lists/listinfo/modules-interest
>
|