I've been reading "Maya Python for Games and Films" and I’m having trouble with something mentioned on page 32. The book mentions that python provides a built in function, type(), which allows you to determine the type of a variable at any point. Whenever I try to execute that function with a variable inside the parenthesis, I get an error in Maya. An example would be:
contents = ‘toys’
type(contents)
# Error: TypeError: file line 2: ‘module’ object is not callable #
I'm actually further along in the book on page 65 where I'm trying to following along but running into the following:
def process_all_textures():
print(‘process all textures’)
type(process_all_textures)
# Error: TypeError: file line 4: ‘module’ object is not callable #
Any idea why I am getting this error? Other built in Python functions such as id() work just fine.
--
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 python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/553d65d8-d08d-4bf0-bfee-3dcc597c54cb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
when I print type I get the following:<module 'maya.app.type.AEtypeTemplate' from 'C:\Program Files\Autodesk\Maya2017\Python\lib\site-packages\maya\app\type\AEtypeTemplate.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 python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/872a4080-dca5-4eea-ae68-fc801d0e9762%40googlegroups.com.
Thanks for the info. Strange because its from nothing that I have created myself. I just tried out using the type() function in an older version of maya that I have and it worked fine. Where I'm having the trouble is with a beta version of the software.
--
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 python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/bc343e25-4315-4f65-95c5-4643b8b60e6d%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAKrPLDLGc%3DVLv7gdNZPWqrL5h54VupQ%3D%2BPJC4qRurGoOO%2Bt_Ug%40mail.gmail.com.