Hi All,
I've been using Python for a project with OpenSim and am wondering if there is a command for looking up all available commands for a class within the shell. In Matlab this can be achieved with methodsview and the class - is there an equivalent for Python?
Thanks,
Aaron
'methodsview' in Python
- Dimitar Stanev
- Posts: 1096
- Joined: Fri Jan 31, 2014 5:14 am
Re: 'methodsview' in Python
Hi,
Depending on the editor that you use, you can have completion in Python that gives you a list of available functions.
Regards
Depending on the editor that you use, you can have completion in Python that gives you a list of available functions.
Regards
Re: 'methodsview' in Python
Hi Dimitar,
I'm using Spyder IDE.
I've noticed this auto-complete come up every now and then, but it seems to be sporadic/inconsistent. It also seems to only work to one level - i.e. it will give me the initial options for something like opensim.
I'm using Spyder IDE.
I've noticed this auto-complete come up every now and then, but it seems to be sporadic/inconsistent. It also seems to only work to one level - i.e. it will give me the initial options for something like opensim.
- ; but then won't do so when linking them together like opensim.Model('modelname.osim').[won't list options here]. It also lacks a little bit in comparison to the methodsview in that when run in Matlab this would give you the options plus the argument inputs/various options for argument inputs across the commands - is there any solution for this that you know of or would other editors be more effective with this?
Thanks,
Aaron
- Dimitar Stanev
- Posts: 1096
- Joined: Fri Jan 31, 2014 5:14 am
Re: 'methodsview' in Python
Yes, if you need a second level completion you have to get the object first e.g.:
you can do something like this in ipython:
but as the bindings are auto-generated they lack comprehensive documentation, therefore you need to revisit the C++ doxygen.
Code: Select all
model = opensim.Model()
model.[compeltion]
Code: Select all
model.getCoordinateSet? [enter]
help('model.getCoordinateSet')