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
Write a program that will take price data for stocks and print it graphically to the screen. Your program should begin by asking the user for the file name. It should then create a

There are three seating categories at a stadium. For a softball game, Class A seats cost $15, Class B seats cost $12, and Class C seats cost $9. Write a program that asks how many

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

Bank transfer What  if we  have  two  values,  representing bank  accounts, and  need  to transfer an  amount of money  amt between them?  Consider that a bank account is show

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

List mutation and shared structure Lists are mutable data  structures, which defines  that  we can actually modifies  the values  stored in their components. We do this by usi

I need server, client and trusted side communicating and charging a service with that protocol (or needham shroeder)

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 exampl

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

Procedures in Firrst-class objects In Python, unlike  many  other  languages, methods are behave in much  the same way as num­ bers:  they  can be stored as values  of variabl