0
from aqt import mw

It is from an anki(a program make in python) add-on source code, where can I find the mw file? I found folder /usr/share/anki/aqt, but I didn't find mw folder or mw.py file, where else could it be? Or is there method to display its path?

Searene
  • 25,920
  • 39
  • 129
  • 186
  • `mw` could be an entity (eg an object, function or constant) defined in the `aqt` module. Is there an `aqt.py` or `aqt.pyc` file? – PM 2Ring Oct 10 '14 at 09:32

3 Answers3

2

to identify the type of mw, do type(mw) in your python console. It might be something defined in the __init__.py file of the aqtdir. If 'mw' is a module, then you can try mv.__file__.

Antoine
  • 1,070
  • 7
  • 11
1

Start python interpreter with -v flag, for every import its path will be printed like a comment
Here an example with a funny module:

user@host ~/$ python -v
###
#a bunch of bultin imports
###
>>> import sexmachine
import sexmachine # directory /usr/local/lib/python2.7/dist-packages/sexmachine
# /usr/local/lib/python2.7/dist-packages/sexmachine/__init__.pyc matches /usr/local/lib/python2.7/dist-packages/sexmachine/__init__.py
import sexmachine # precompiled from /usr/local/lib/python2.7/dist-packages/sexmachine/__init__.pyc
xecgr
  • 5,095
  • 3
  • 19
  • 28
1

You should check this out.

from aqt import mw
print mw.__file__

Edit: wtf? "Trivial answer converted to comment"?

Community
  • 1
  • 1
José Tomás Tocino
  • 9,873
  • 5
  • 44
  • 78