[Tutor] Function output

william wmperry@903internets.com
Sun, 25 Jun 2000 01:03:37 -0500


--=====_96191301741=_
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: quoted-printable

I guess I missed something fundamental in programming because I don't seem=
 to find any references for this.

 A little background, I'm complete novice at programing with Python  as my=
 first language. (well a little Basic back in the 70's) I'm running Python=
 on Windows 95 and I've been reading "Learning Python" , "Teach yourself=
 Python in 24 hrs" and just about anything else I can find.

 The problem I'm having is how to get output from the functions in a module=
 to the screen. I wanted to try writing something other than the book=
 exercises to get a better feel for the process, I wrote a function that=
 generated a random number and a second function that used that number to=
 select from a list. When I type them in in the interactive prompt in Idle=
 they do exactly that but when I place them in a module and save. They=
 refuse to output to the screen either in Idle or from the DOS prompt. I've=
 been working at this for several weeks and the error message(s) change=
 depending on what I try, including no error message and no output. I added=
 a test print message at the end and it does print so It appears to be that=
 the function output isn't being captured or read.  
I'm less concerned with making this work than in why it won't and where I=
 should be looking to find answers.

W M Perry


--=====_96191301741=_
Content-Type: text/html; charset="us-ascii"

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>
<META content="MSHTML 5.00.2722.2800" name=GENERATOR></HEAD>
<BODY bgColor=#ffffff style="FONT-FAMILY: Arial" text=#000000>
<DIV><FONT size=2>I guess I missed something fundamental in programming because 
I don't seem to find any references for this.</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>&nbsp;A little background, I'm complete novice at programing 
with Python&nbsp; as my first language. (well a little Basic back in the 70's) 
I'm running Python on Windows 95 and I've been reading "Learning Python"&nbsp;, 
"Teach yourself Python in 24 hrs" and just about anything else I can 
find.</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>&nbsp;The problem I'm having is how to get output from the 
functions in a module to the screen. I wanted to try writing something other 
than the book exercises to get a better feel for the process, I wrote a function 
that generated a random number and a second function that used that number to 
select from a list. When I type them in in the interactive prompt in Idle they 
do exactly that but when I place them in a module and save.&nbsp;They refuse to 
output to the screen either in Idle or from the DOS prompt. I've been working at 
this for several weeks and the error message(s) change depending on what I try, 
including no error message and no output. I added a test print message at the 
end and it does print so It appears to be that the function output isn't being 
captured or read.&nbsp; </FONT></DIV>
<DIV><FONT size=2>I'm less concerned with making this work than in why it won't 
and where I should be looking to find answers.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT size=3>W M Perry</FONT></DIV>
<DIV>&nbsp;</DIV></BODY></HTML>


--=====_96191301741=_--