Small Python error?

Become a member of the CGSociety

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

Thread Tools Search this Thread Display Modes
  07 July 2010
Small Python error?

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??

1.21 gigawatts!
  07 July 2010
you are just referencing the function object, you want to CALL the function, so need to add brackets:

  07 July 2010
Ta :)

Oh man, now I feel dumb, lol!!

Thanks bud.
1.21 gigawatts!
  07 July 2010
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
Society of Digital Artists

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

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

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