[Tutor] Equivalent of a Subroutine in Python?

Seelinger, Bruce bseelinger@neteffectcorp.com
Wed, 31 Jan 2001 17:12:29 -0500


This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_001_01C08BD2.E6AD3D40
Content-Type: text/plain;
	charset="iso-8859-1"

Hello,

Another question from someone totally new to Python. Is there an equivalent
in Python to a sub-routine, (e.g. gosub and return).  I want to create a
modular program with sub-routines to perform distinct tasks wihin the
program for organizational and debugging purposes, etc.  Is the only (or
best) way to do this is with modules?  A function works but the values
obtained within the function do not appear to be valid outside of that
function.  I guess I am looking for the best approach to create the
subroutines for execution from the main flow of the program.

Thanks for any assistance!

Regards,

Bruce Seelinger

------_=_NextPart_001_01C08BD2.E6AD3D40
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Diso-8859-1">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =
5.5.2652.35">
<TITLE>Equivalent of a Subroutine in Python?</TITLE>
</HEAD>
<BODY>

<P><FONT SIZE=3D2 FACE=3D"Arial">Hello,</FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Arial">Another question from someone totally =
new to Python. Is there an equivalent in Python to a sub-routine, (e.g. =
gosub and return).&nbsp; I want to create a modular program with =
sub-routines to perform distinct tasks wihin the program for =
organizational and debugging purposes, etc.&nbsp; Is the only (or best) =
way to do this is with modules?&nbsp; A function works but the values =
obtained within the function do not appear to be valid outside of that =
function.&nbsp; I guess I am looking for the best approach to create =
the subroutines for execution from the main flow of the =
program.</FONT></P>

<P><FONT SIZE=3D2 FACE=3D"Arial">Thanks for any assistance!</FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Arial">Regards,</FONT>
</P>

<P><FONT SIZE=3D2 FACE=3D"Arial">Bruce Seelinger</FONT>
</P>

</BODY>
</HTML>
------_=_NextPart_001_01C08BD2.E6AD3D40--