Modules, Python Programming


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  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 named foo, we may use it with the name 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
what is python

Expressions and assignment We can think of most computer programs as performing some sort of transformation on data.  Our code may get as input the exam scores of everyone in

The goal of this exercise is to write a \business phrase" generator, which each time it is called produces lines of business speak, such as: It's time that we became uber-effici

Define a function that draws a pentagon of a size you provide when you call the function. Include a ''''''docstring'''''' as the first line of the function''s body — it tells the p

Non-local references in procedures There  is an important subtlety in the  way  names  are handled in the  environment created by a function call. When  a value  that  is not

Task (Anagrams) Write a function that checks whether two words are anagrams. Two words are anagrams if they contain the same letters. Fore example, silent and listen are anagrams.

What are squared matrices?

simple program using list

#Why can''t I cd my Desktop? A minute ago I would open up cmd and it starts in C:\Users\myname but now it''s starting in C:\WINDOWS\system> and I don''t where I am or how to get ou

Structured assignment Once  we have  tuples and lists, we may use  a nice trick  in assignment expression, based  on the packing and unpacking of tuples. >>> a, b, c = 1, 2