From: Giacomo Fiorin (giacomo.fiorin_at_gmail.com)
Date: Thu Aug 31 2017 - 09:50:57 CDT

Hi, the Python wrapper uses the same scripting interface used for Tcl (to
be precise, it calls C functions directly without through Tcl).

The current functionality of the Tcl and Python interfaces is the same.
But since in NAMD you are always using Tcl anyway, I would recommend like
Josh did to use the evaltcl() function, so that you use all parts of NAMD
the same way.

Giacomo

On Mon, Aug 28, 2017 at 4:03 AM, yjcoshc <yjcoshc_at_gmail.com> wrote:

> 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=http
>>> s%3A%2F%2Fgithub.com%2FColvars%2Fcolvars%2Ftree%2Fmaster%
>>> 2Fpython&data=02%7C01%7CJoshua.Vermaas%40nrel.gov%7C
>>> efbb0bced0bd4a19e2d308d4ec2d4d1c%7Ca0f29d7e28cd4f5484427885a
>>> ee7c080%7C0%7C0%7C636393126693734340&sdata=nMcU8G3dz%
>>> 2FFgke7aNIk5e5%2FLahRFjpLhTLidJWUJObk%3D&reserved=0).
>>>
>>> Thanks,
>>>
>>> yjcoshc
>>>
>>>
>>>
>

-- 
Giacomo Fiorin
Associate Professor of Research, Temple University, Philadelphia, PA
Contractor, National Institutes of Health, Bethesda, MD
http://goo.gl/Q3TBQU
https://github.com/giacomofiorin