CGTalk > Software > Autodesk Maya > Maya Programming
Login register
Thread Closed share thread « Previous Thread | Next Thread »  
Thread Tools Search this Thread Display Modes
Old 07-16-2010, 02:35 PM   #1
United Kingdom
Join Date: Apr 2002
Posts: 123
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!
Old 07-16-2010, 02:38 PM   #2
HighEnd3D deserter
NaughtyNathan's Avatar
Naughty Nathan
Technical Artist
Sony SCEE Liverpool
Manchester, United Kingdom
Join Date: May 2008
Posts: 2,608
you are just referencing the function object, you want to CALL the function, so need to add brackets:

Old 07-16-2010, 03:06 PM   #3
United Kingdom
Join Date: Apr 2002
Posts: 123
Ta :)

Oh man, now I feel dumb, lol!!

Thanks bud.
1.21 gigawatts!
Old 07-16-2010, 03:06 PM   #4
CGTalk Moderation
Lord of the posts
CGTalk Forum Leader
Join Date: Sep 2003
Posts: 1,066,479
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

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 02:28 AM.

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