From: yjcoshc (yjcoshc_at_gmail.com)
Date: Mon Aug 28 2017 - 03:03:42 CDT

The evaltcl is useful. Thanks for your help!

在 2017年08月28日 02:39, Vermaas, Joshua 写道:
> Hi,
>
> Yes, with the caveat that you need to use the "evaltcl" framework, as
> the python bindings are more of a stub right now from what I can tell.
> So you'd do something like this, which I dug up from a setup script I
> wrote for my own ends:
>
> from VMD import evaltcl
> evaltcl("cv molid top ; cv configfile ../distz.conf; cv update;")
> result = float(evaltcl("cv colvar pos value"))
> evaltcl("cv delete")
>
> Basically any call where you actually care about the output should be
> done separately from setup stuff and without semicolons so the output
> isn't quashed. Setup lines can be fused together into one line just for
> less typing.
>
> -Josh
>
>
> On 08/25/2017 08:51 PM, yjcoshc_at_gmail.com wrote:
>> n/Hello,
>>
>> I know how to use colvars module in VMD tcl mode. Is it also possible to
>> use it after "gopython" in VMD?
>>
>> The colvars project seems have an interface of python
>> here(https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FColvars%2Fcolvars%2Ftree%2Fmaster%2Fpython&data=02%7C01%7CJoshua.Vermaas%40nrel.gov%7Cefbb0bced0bd4a19e2d308d4ec2d4d1c%7Ca0f29d7e28cd4f5484427885aee7c080%7C0%7C0%7C636393126693734340&sdata=nMcU8G3dz%2FFgke7aNIk5e5%2FLahRFjpLhTLidJWUJObk%3D&reserved=0).
>>
>> Thanks,
>>
>> yjcoshc
>>
>>