On Mon, May 29, 2017 at 10:35 AM Todd Widup <[email protected]> wrote:

> hadnt tried it yet.  been working on another area of this project.  once I
> drop this update to them, ill add some stuff to use __file__ in and see if
> that works correctly or not.
>
> hmmm, if I did this
>
> in module Path
>
> fil=__file__
>
> then in module Bob
>
> import Path as pth
>
> test=pth.fil
>
>
Maybe I don't understand the question, but to me it looks like its the
exact same thing as just referring to __file__ directly. All it is doing is
creating another reference to the __file__ global variable.


>
>
>
>
> if I path was a py and Bob was a PYC..you think it would compile like I
> expect?
>
> On Sun, May 28, 2017 at 3:27 PM, Justin Israel <[email protected]>
> wrote:
>
>>
>>
>> On Mon, May 29, 2017, 10:22 AM Todd Widup <[email protected]> wrote:
>>
>>> justin's correct
>>>
>>
>> Did that suggestion to use the globals end up working?
>>
>>
>>> On Sun, May 28, 2017 at 5:13 AM, Justin Israel <[email protected]>
>>> wrote:
>>>
>>>>
>>>>
>>>> On Sun, May 28, 2017, 8:18 PM Marcus Ottosson <[email protected]>
>>>> wrote:
>>>>
>>>>> How about this?
>>>>>
>>>>> def getExecutingfile():
>>>>>   return __file__
>>>>>
>>>>> ​
>>>>> ​
>>>>>
>>>>
>>>> That just returns the file of the current module. The original code
>>>> wants to inspect the calling frame which could be in another module.
>>>>
>>>> If this utility module is used in some other tool it might look like:
>>>>
>>>> import foo.utils
>>>> print foo.utils.getExecutingFile()
>>>> # myModule.py
>>>>
>>>> --
>>>>> 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/CAFRtmOAtghUXNDCX3Ww7uypxMDiYC_cTi2L-mcZjR7k247vPbg%40mail.gmail.com
>>>>> <https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOAtghUXNDCX3Ww7uypxMDiYC_cTi2L-mcZjR7k247vPbg%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>>>> .
>>>>> For more options, visit https://groups.google.com/d/optout.
>>>>>
>>>> --
>>>> 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/CAPGFgA0A07nAE3CLKWUi4%3DiXSDtJatEe9Bo3wPXNjEkyE0dp%2Bg%40mail.gmail.com
>>>> <https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA0A07nAE3CLKWUi4%3DiXSDtJatEe9Bo3wPXNjEkyE0dp%2Bg%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>>> .
>>>
>>>
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>>
>>> --
>>> Todd Widup
>>> Creature TD / Technical Artist
>>> [email protected]
>>>
>>> --
>>> 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/CABBPk363H_y4AoUCj1ctv-RPQaNcCo0pocik6bN1Tj0%3DK9g7Bg%40mail.gmail.com
>>> <https://groups.google.com/d/msgid/python_inside_maya/CABBPk363H_y4AoUCj1ctv-RPQaNcCo0pocik6bN1Tj0%3DK9g7Bg%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>> --
>> 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/CAPGFgA1ESdNzO%2BnAzu%2BX_6zK1zK9afesPUdwoWK7EnuYLJ24aw%40mail.gmail.com
>> <https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA1ESdNzO%2BnAzu%2BX_6zK1zK9afesPUdwoWK7EnuYLJ24aw%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>
>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> --
> Todd Widup
> Creature TD / Technical Artist
> [email protected]
>
> --
> 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/CABBPk35nZMmkH2Q8RCGLEywb7h1C%2BLbvhGWbvhcjZchj496z8A%40mail.gmail.com
> <https://groups.google.com/d/msgid/python_inside_maya/CABBPk35nZMmkH2Q8RCGLEywb7h1C%2BLbvhGWbvhcjZchj496z8A%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CAPGFgA3NYChB_DfVsf%2B9nZ9626qCxeNZqCZn2CVB2eoqa8AOkQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to