I have done something like this with the *sys* module.

import sys
> print(sys.executable)


Then you get the path to the interpreter running on your script and can
parse it (for example for "mayapy") and make some decisions.

Stackoverflow
<http://stackoverflow.com/questions/2589711/find-full-path-of-python-interpreter>
Python Docs <https://docs.python.org/2/library/sys.html>

Maybe there are also other, better ways!
Cheers,
Timm

On Mon, Jun 1, 2015 at 6:33 PM, Todd Widup <[email protected]> wrote:

> is there a way to find out what program called the python script that is
> running?
>
> IE, if its running in Maya, Soft, Houdini, idle, or something else even.
>
> thanks
> -todd
>
> --
> Todd Widup
> Creature TD / Technical Artist
> [email protected]
> [email protected]
> www.toddwidup.com
>
> --
> You received this message because you are subscribed to the Google Groups
> "Python Programming for Autodesk Maya" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/python_inside_maya/CABBPk361T%2BE%2BMyP4VGnz-Xv%2B3b_ONDpCTJSmw7TDJ%3D5FwEuS8g%40mail.gmail.com
> <https://groups.google.com/d/msgid/python_inside_maya/CABBPk361T%2BE%2BMyP4VGnz-Xv%2B3b_ONDpCTJSmw7TDJ%3D5FwEuS8g%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
*Timm Wagener*
*Technical Artist / 3D Generalist*

*www.timmwagener.com <http://www.timmwagener.com>*

Email:
*[email protected] <[email protected]>*

Phone:
*0178-2810920*

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/CA%2Bj65iqEGAss%3D%2BZ6yOrF_6RGt-bW-nSCEaq2RsyoqDK7hjTG-A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to