unicode' object is not callable!! in Python

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
Old 04 April 2009   #1
unicode' object is not callable!! in Python

hello people
i was running this Python script in maya2009 and it worked but after i restart maya
it gave me an error "# Error: 'unicode' object is not callable"
can any one till me what dose that mean

thank you

import maya.cmds as cmds
window=cmds.promptDialog(m="Enter Number Of AX",b="O.K")
if window =="O.K":
.............numberOfTeeth=cmds.promptDialog(q=Tru e,tx=True)
.............numberOfTeeth=int(numberOfTeeth)
.............Gear=cmds.polyPipe(sa=numberOfTeeth)
.............base=cmds.getAttr(Gear[1]+".sa")
.............min = base * 2
.............max = (base * 3)-1
.............cmds.select(cl=True)
.............for i in range(min,max,2):
........................cmds.select(Gear[1]+".f[%d]"%i,add=True)
.............cmds.polyExtrudeFacet(ltz=1)
.............cmds.select(cl=True)
else:
print numberOfTeeth
__________________
Ability can take you to the top, but it takes character to keep you there.

Last edited by saedAbdelhafez : 04 April 2009 at 12:35 AM.
 
Old 04 April 2009   #2
have you tried restarting Maya and running your script again? i just ran it in 2009 and (after changing the second Gear[1] to Gear[0]) it ran just fine. the error you are getting can occur when you accidentally override a function with a string ( unicode is a type of string )

cmds.select = 'foo'
cmds.select()
# Error: 'str' object is not callable
# Traceback (most recent call last):
#   File "<maya console>", line 1, in 
# TypeError: 'str' object is not callable #  
 
Old 04 April 2009   #3
Talking :) ..

Gee i dono how did i missed it thankx alot bro ..
__________________
Ability can take you to the top, but it takes character to keep you there.
 
Old 04 April 2009   #4
it happend again :( ...

it happened again :( ... it worked then i did it lately it didn't work !!
__________________
Ability can take you to the top, but it takes character to keep you there.
 
Old 04 April 2009   #5
my guess would be that you are using the name range as a variable in some other script.

try this:

print range


you should get this:

<built-in function range>
 
Old 04 April 2009   #6
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
__________________
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
 
Thread Closed share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 07:38 AM.


Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.