# Help Me! A Problem

**URL:** https://forum.highend3d.com/t/help-me-a-problem/48777
**Category:** Maya
**Tags:** python
**Created:** [March 12, 2009, 9:52am UTC](https://forum.highend3d.com/t/help-me-a-problem/48777 "2009-03-12T09:52:14Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![liuguanghui](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/l/ea666f/32.png) [@liuguanghui](https://forum.highend3d.com/u/liuguanghui)
#### Post date: [March 12, 2009, 9:52am UTC](https://forum.highend3d.com/t/help-me-a-problem/48777/1 "2009-03-12T09:52:14Z")

</div>

how can I use just like whatIs command in python,I just want to use it to know the other .py file`s location,thanks!!!

---

<div class="post-metadata">

### Author: ![joojaa](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/j/5daacb/32.png) [@joojaa](https://forum.highend3d.com/u/joojaa)
#### Post date: [March 13, 2009, 10:34am UTC](https://forum.highend3d.com/t/help-me-a-problem/48777/2 "2009-03-13T10:34:53Z")

</div>

Print the function without parentheses, thet will give you the module it is pasrt of and teht you will find on your disk. You can also send the command something that crashes it that will give you stack trace (to this end you can inject a strack trace on all lines)

Anyway pytyhon dont exactly work like mel, So it doesnt really know what file it is executing form as the runtime environment caoul have changed vastly after the fact that the code was askied form file.

---

<div class="post-metadata">

### Author: ![kurianos3d](https://forum.highend3d.com/user_avatar/forum.highend3d.com/kurianos3d/32/55947_2.png) [@kurianos3d](https://forum.highend3d.com/u/kurianos3d)
#### Post date: [March 13, 2009, 11:39am UTC](https://forum.highend3d.com/t/help-me-a-problem/48777/3 "2009-03-13T11:39:15Z")

</div>

Are you talking about modules in python ..

then maybe

CODE  
import os  
print os.\_\_file\_\_

And next thing i know its such a dirt idea anyway just a try

CODE  
import maya.mel as mel  
def newWhatIs(commandP):  
&nbsp;&nbsp;&nbsp;&nbsp;sendBack=mel.eval("whatIs \""+commandP+"\"")  
&nbsp;&nbsp;&nbsp;&nbsp;return(sendBack)  
getTypeH=newWhatIs("animView")  
print getTypeH

---

<div class="post-metadata">

### Author: ![joojaa](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/j/5daacb/32.png) [@joojaa](https://forum.highend3d.com/u/joojaa)
#### Post date: [March 14, 2009, 9:40pm UTC](https://forum.highend3d.com/t/help-me-a-problem/48777/4 "2009-03-14T21:40:31Z")

</div>

I wanted to add that you can use the vars command to investigate what objects and files you have been loading up:

so suppose you have:

CODE  
import maya.precomp

and you want to know what mayaPrecomp is?

then do:

CODE  
print vars(maya)["precomp"]

will result in maya sumarizing wher its atken form However please not somebody might hav injected code past you.

---

<div class="post-metadata">

### Author: ![joojaa](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/j/5daacb/32.png) [@joojaa](https://forum.highend3d.com/u/joojaa)
#### Post date: [March 14, 2009, 9:45pm UTC](https://forum.highend3d.com/t/help-me-a-problem/48777/5 "2009-03-14T21:45:32Z")

</div>

I wanted to add that you can use the vars command to investigate what objects and files you have been loading up:

so suppose you have:

CODE  
import maya.precomp

and you want to know what mayaPrecomp is?

then do:

CODE  
print vars(maya)["precomp"]

will result in maya sumarizing wher its atken form However please not somebody might hav injected code past you.

Theres aslternate tool in module sys called modules wich can investigate even unloaded bits and pieces, this probably reflect best how mayas whatIs does but for python modules, it of course doesnt do anything for functions:

CODE  
import sys  
sys.modules["maya.precomp"]
