[Tutor] Newbie!! many questions

AquaRock7@aol.com AquaRock7@aol.com
Mon, 29 Jan 2001 20:08:02 EST


--part1_3b.fbc8bd3.27a76df2_boundary
Content-Type: text/plain; charset="US-ASCII"
Content-Transfer-Encoding: 7bit

!).  There is a way to define and call functions in Python, but is there a 
way to define and call a subroutine?  Or a way to jump to another line of 
code? i.e.:

n = input("Type a number: ")
if n > 0:
       GOTO negativemsg
elif n < 0:
       GOTO posativemsg
else:
       GOTO zeromsg

negativemsg: print "Negative"
positivemsg: print "Positive"
zeromsg: print "Zero"

so I dont have to write repeated code over and over...

2).  sys.stdout and sys.stdin
       what are they!?  ok, sys.stdout is where the print statement goes... 
so how can I use that to my advantage?  How can I manip[ulate this to my 
advantage?

3).  Is there a graphics library for Python?  To go along with the thread 
about making games in Python... Not games that use OS-like grpahics, like 
Tk... Like commercial games with grpahics lilke that.  Like so you can plot a 
pixel on the screen at coordinate x,y, color=red.  Microsoft QBasic did that 
(my first programming language(i know its obsolete, but its great for 
beginners)).  Or locate text anywhere besides the next line down.  Maybe 
there is a way to use DirectX with python?

4).  making executables... so I can run it without Python installed!  How?  
Someone posted about Freeze... I never heard of that, would someone care to 
explain?  Is that what I am looking for?

Thank you, ~Dustin

--part1_3b.fbc8bd3.27a76df2_boundary
Content-Type: text/html; charset="US-ASCII"
Content-Transfer-Encoding: 7bit

<HTML><FONT FACE=arial,helvetica><FONT  SIZE=2>!). &nbsp;There is a way to define and call functions in Python, but is there a 
<BR>way to define and call a subroutine? &nbsp;Or a way to jump to another line of 
<BR>code? i.e.:
<BR>
<BR>n = input("Type a number: ")
<BR>if n &gt; 0:
<BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;GOTO negativemsg
<BR>elif n &lt; 0:
<BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;GOTO posativemsg
<BR>else:
<BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;GOTO zeromsg
<BR>
<BR>negativemsg: print "Negative"
<BR>positivemsg: print "Positive"
<BR>zeromsg: print "Zero"
<BR>
<BR>so I dont have to write repeated code over and over...
<BR>
<BR>2). &nbsp;sys.stdout and sys.stdin
<BR> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;what are they!? &nbsp;ok, sys.stdout is where the print statement goes... 
<BR>so how can I use that to my advantage? &nbsp;How can I manip[ulate this to my 
<BR>advantage?
<BR>
<BR>3). &nbsp;Is there a graphics library for Python? &nbsp;To go along with the thread 
<BR>about making games in Python... Not games that use OS-like grpahics, like 
<BR>Tk... Like commercial games with grpahics lilke that. &nbsp;Like so you can plot a 
<BR>pixel on the screen at coordinate x,y, color=red. &nbsp;Microsoft QBasic did that 
<BR>(my first programming language(i know its obsolete, but its great for 
<BR>beginners)). &nbsp;Or locate text anywhere besides the next line down. &nbsp;Maybe 
<BR>there is a way to use DirectX with python?
<BR>
<BR>4). &nbsp;making executables... so I can run it without Python installed! &nbsp;How? &nbsp;
<BR>Someone posted about Freeze... I never heard of that, would someone care to 
<BR>explain? &nbsp;Is that what I am looking for?
<BR>
<BR>Thank you, ~Dustin</FONT></HTML>

--part1_3b.fbc8bd3.27a76df2_boundary--