[Tutor] Basic Help Implementing Saved Scripts

Alan Gauld alan.gauld at btinternet.com
Thu Jul 10 10:44:16 CEST 2008


<jar_head at fuse.net> wrote in message

> The idea is that I want to make a few functions and be able
> to pull them up within my program without copy and pasting them.
> Is it possible in Python?  Do I have to import them?

Yes, you create a module and import the module.

> I've tried looking at tutorials, etc, but I can't find any that are
> up to date/simple enough to make any sense to me.

The simple ones are the non programmers ones listed
on the Python web sirte(including mine!). Module functionality
hasn't changed significantly in over 10 years so they
should all be up to date!

> I'm running Windows ME and have used IDLE up to this point.

Thats fine. Although you may prefer Pythonwin over IDLE.
Which version of Python are you using? That is more relevant.

> I'd really appreciate it if someone gave me a very simple,
> step by step explanation of how to do this.

Read the functions and modules topic of my tutorial
It includes an example of creating a module and using
a function within it.

-- 
Alan Gauld
Author of the Learn to Program web site
http://www.freenetpages.co.uk/hp/alan.gauld




More information about the Tutor mailing list