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?

1
  • 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? Commented Oct 10, 2014 at 9:32

3 Answers 3

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__.

Sign up to request clarification or add additional context in comments.

Comments

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

Comments

1

You should check this out.

from aqt import mw
print mw.__file__

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

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.