Modules, Python Programming

Modules

As you start to write larger programs, you will want  to save the function de?nitions in multiple ?les, collected together according to what  they  do.  So, for example, we may  collect a set of utility  functions together into  in one file, called  utility.py.  This ?le is known as  a module in Python.

 

Now,  if we want  to use  those  procedures in another shell or file,  we will require to say import utility so that  all those  procedures become  available to us and  to the Python interpereter.  Now,  if we have a function in utility.py named foo, we may use it with the name  utility.foo. You may study  more  about  modules, and  how  to instance reference functions described in procedures, in the Python documentation.

 

Posted Date: 8/9/2012 6:59:31 AM | Location : United States







Related Discussions:- Modules, Assignment Help, Ask Question on Modules, Get Answer, Expert's Help, Modules Discussions

Write discussion on Modules
Your posts are moderated
Related Questions
Python Programs You must submit the source code and samples of output for each program.Please do not provide python file (eg. Filename.py). Copy all source code to one word fi

how to calculate standard deviations in programming

I have python game project which is due by next Tuesday. Do you think that I can get it on time if I order today?

Range Very frequently, we will want to iterate through a list of integer values, often as indices.  Python gives a useful function, range, which gives lists of integers. It ma

Task This problem creates a list containing names. The list of names will be printed, sorted, printed again in the new sorted order, written to a new output file, and searched. Ca

protocol rdt2.2 considers there is a bit errors between sender to receiver and also from receiver to sender. So now we have to consider checking bit errors introduced in reply from

Write an algorithm for a program that shows the use of all 6 math functions. Write, test, and debug the program using Python. SAMPLE OUTPUT (not including author/program infor

Write an algorithm for the sum of the given series 1,-1/2,1/4,-1/8.....

Write an algorithm for a program that receives, as input from the user, 2 string variables and 2 integer variables; then joins together and displays the combined strings; and final

how to use re.sub to seperate distint words and phrases when translating text from English to Spanish or vis versa in python programming