Does this work by chance?

# File_1 
from file_2 import selection as sel


def create_window():
    
     def pushButton():
         sel()



On Friday, October 28, 2016 at 10:46:26 AM UTC-5, Padraig Ó Cuínn wrote:
>
> Hi Marcus,
>
> I am trying to get to selection() which is in a maya code file, The UI is 
> built under a create_window() function, in a UI specific file. The code 
> is separated from the UI. 
>
> under create_window() I have another function nested in it for the button 
> to call selection() but it is not reaching due to the enclosure,
>
> File_1 
> from file_2 import selection as sel
>
>
> def create_window():
>     
>      def pushButton():
>          file_2.sel()
>
> File_2
> import pymel.core
>
>
> def selection():
>     pymel.core.selection(n="transforms")
>
> as you can see there are two files and due to the closure I can't execute 
> the selection function. I know I could easily throw it under the pushbutton 
> inside the UI but i strictly want UI code alone and maya code alone on 
> another file. 
>
> Thanks again
>

-- 
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/a6ed571e-c9ef-4274-a263-cfd47d779837%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to