473,382 Members | 1,736 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

scope of procedures in python

5
Hi,

The following works.

import maya.cmds as cmds

def importImage( fileName, fileType):
cmds.file( fileName, i=True );
return 1

cmds.fileBrowserDialog( m=0, fc='python("importImage")', ft='image', an='Import_Image', om='Import' )

However in the following situation it does not work. The error is

================================================== ====
Cannot find procedure "importImage".
Start of trace: (command window: line 1).
importImage (command window: line 1).

================================================== ====

import maya.cmds as cmds


def importImage( fileName, fileType):
cmds.file( fileName, i=True );
return 1

def OnBrowse(self, event):
cmds.fileBrowserDialog( m=0, fc='python("importImage")', ft='image', an='Import_Image', om='Import' )

what is the scope of a procedure in python. Can procedures be called globally. How ?

BRgds,

kNish
Mar 24 '08 #1
0 847

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Gabriel Zachmann | last post by:
I am relatively new to python, but i know some other languages, such as C++, fairly well. After reading up a little bit in the reference manual, section 4.1, and searching this NG, i still have 2...
10
by: John Salerno | last post by:
Here's a sentence from Learning Python: "Names not assigned a value in the function definition are assumed to be enclosing scope locals (in an enclosing def), globals (in the enclosing module's...
3
by: rdemyan via AccessMonster.com | last post by:
I have some unbound forms that I want to use transaction wrappers on when updating the table. My question is on the scope of what transaction processing will do. I'm going to keep it simple with...
15
by: Paddy | last post by:
Hi, I am trying to work out why I get UnboundLocalError when accessing an int from a function where the int is at the global scope, without explicitly declaring it as global but not when accessing...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.