View Full Version : Small Python error?

07 July 2010, 02:35 PM
Hey all,

I'm just starting to dig into python and thought I would start by making something small as a quick test. This is what I've written:

import maya.cmds as mc

def long():
longName = mc.file(q=True, sceneName=True)
print longName

def short():
shortName = mc.file(q=True, sceneName=True, shortName=True)
print shortName

I then saved this as a file called ""

I then type this in the script editor:

import joSceneName

and then type:


Now I thought this would work without a problem but unfortunately I get this error:
# Result: <function long at 0x1328F8B0> #

Any ideas as to what I've done wrong??


07 July 2010, 02:38 PM
you are just referencing the function object, you want to CALL the function, so need to add brackets:



07 July 2010, 03:06 PM
Oh man, now I feel dumb, lol!!

Thanks bud.

CGTalk Moderation
07 July 2010, 03:06 PM
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.