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
Your task is to construct a translator from the subset of Python in Project 3 intocontinuation-passing style (CPS). Of course, the expected way of accomplishing this is to trans

Ask question #Minimum 100 worIn this project, create the pseudo code from the following request. The program must have some sort of menu that allows users to make selections to

Procedures in python Procedures are computer program creates that let us capture common patterns of computation by: Grouping together sequences of statements

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

List Comprehensions   Python has a very nice built-in  facility for doing  many  iterative methods, known as list comprehensions. The basic template is       [

Java programs are  what  is known as statically and  strongly defined.  Thus,  the  kinds  of all the variables must  be known at the time that the program is written. That seems

Procedure calls When you compute an expression of the form ( ,  ..., )   the Python interpreter treats  this as a procedure call. It will be simpler to talk about

Internal models As we want to create  more and more complex  machine with  software programs as controllers, we search  that  it is often needful  to create  additional types

Programs and Data Object-oriented programming is a popular way  of managing programs, which  groups together data  with  the procedures that  works on them,  thus  facilitatin

Imagine a "particle" located on the centre square of a two-dimensional grid of dimensions 11 by 75. The particle can only move one square at a time, either up, down, left, or right