[Tutor] help with python 1.5 wrong dos version

brian smith brian@plug15.fsnet.co.uk
Fri, 28 Jan 2000 22:21:05 -0000


This is a multi-part message in MIME format.

------=_NextPart_000_000D_01BF69DD.F77FCCE0
Content-Type: multipart/alternative;
	boundary="----=_NextPart_001_000E_01BF69DD.F77FCCE0"


------=_NextPart_001_000E_01BF69DD.F77FCCE0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

please could you help me when i use python 1.5 on win98 when i gone =
passed
install hello world then get command prompt c:\python> any command i =
give comes up incorrect dos version thank  you bri.

------=_NextPart_001_000E_01BF69DD.F77FCCE0
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Diso-8859-1" =
http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.2314.1000" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>
<DIV><FONT face=3DArial size=3D2>please could you help me when i use =
python 1.5 on=20
win98 when i gone passed</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>install hello world then get command =
prompt=20
c:\python&gt; any command i give comes up incorrect dos version =
thank&nbsp; you=20
bri.</FONT></DIV></FONT></DIV></BODY></HTML>

------=_NextPart_001_000E_01BF69DD.F77FCCE0--

------=_NextPart_000_000D_01BF69DD.F77FCCE0
Content-Type: text/html;
	name="Intro.htm"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
	filename="Intro.htm"

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from =
url=3D(0061)http://www.honors.montana.edu/~jjc/easytut/easytut/node3.html=
 -->
<!--Converted with LaTeX2HTML 98.2 beta6 (August 14th, 1998)=0A=
original version by:  Nikos Drakos, CBLU, University of Leeds=0A=
* revised and updated by:  Marcus Hennecke, Ross Moore, Herb Swan=0A=
* with significant contributions from:=0A=
  Jens Lippmann, Marek Rouchal, Martin Wilck and others =
--><HTML><HEAD><TITLE>Intro</TITLE>
<META content=3DIntro name=3Ddescription>
<META content=3Deasytut name=3Dkeywords>
<META content=3Ddocument name=3Dresource-type>
<META content=3Dglobal name=3Ddistribution>
<META content=3D"text/html; charset=3Diso-8859-1" =
http-equiv=3DContent-Type><LINK=20
href=3D"Intro_files/easytut.css" rel=3DSTYLESHEET><LINK =
href=3D"node4.html"=20
rel=3Dnext><LINK href=3D"node2.html" rel=3Dprevious><LINK =
href=3D"easytut.html"=20
rel=3Dup><LINK href=3D"node4.html" rel=3Dnext>
<META content=3D"MSHTML 5.00.2314.1000" name=3DGENERATOR></HEAD>
<BODY><!--Navigation Panel--><A=20
href=3D"http://www.honors.montana.edu/~jjc/easytut/easytut/node4.html"=20
name=3Dtex2html77><IMG align=3Dbottom alt=3Dnext border=3D0 height=3D24=20
src=3D"Intro_files/next_motif.png" width=3D37></A> <A=20
href=3D"http://www.honors.montana.edu/~jjc/easytut/easytut/easytut.html" =

name=3Dtex2html73><IMG align=3Dbottom alt=3Dup border=3D0 height=3D24=20
src=3D"Intro_files/up_motif.png" width=3D26></A> <A=20
href=3D"http://www.honors.montana.edu/~jjc/easytut/easytut/node2.html"=20
name=3Dtex2html67><IMG align=3Dbottom alt=3Dprevious border=3D0 =
height=3D24=20
src=3D"Intro_files/previous_motif.png" width=3D63></A> <A=20
href=3D"http://www.honors.montana.edu/~jjc/easytut/easytut/node2.html"=20
name=3Dtex2html75><IMG align=3Dbottom alt=3Dcontents border=3D0 =
height=3D24=20
src=3D"Intro_files/contents_motif.png" width=3D65></A> <BR><B>Next:</B> =
<A=20
href=3D"http://www.honors.montana.edu/~jjc/easytut/easytut/node4.html"=20
name=3Dtex2html78>Hello, World</A> <B>Up:</B> <A=20
href=3D"http://www.honors.montana.edu/~jjc/easytut/easytut/easytut.html" =

name=3Dtex2html74>Non-Programmers Tutorial For Python</A> =
<B>Previous:</B> <A=20
href=3D"http://www.honors.montana.edu/~jjc/easytut/easytut/node2.html"=20
name=3Dtex2html68>Contents</A> &nbsp; <B><A=20
href=3D"http://www.honors.montana.edu/~jjc/easytut/easytut/node2.html"=20
name=3Dtex2html76>Contents</A></B> <BR><BR><!--End of Navigation =
Panel--><!--Table of Child-Links--><A=20
name=3DCHILD_LINKS><STRONG>Subsections</STRONG></A>=20
<UL>
  <LI><A=20
  =
href=3D"http://www.honors.montana.edu/~jjc/easytut/easytut/node3.html#SEC=
TION00310000000000000000"=20
  name=3Dtex2html79>First things first</A>=20
  <LI><A=20
  =
href=3D"http://www.honors.montana.edu/~jjc/easytut/easytut/node3.html#SEC=
TION00320000000000000000"=20
  name=3Dtex2html80>Running Python</A>=20
  <LI><A=20
  =
href=3D"http://www.honors.montana.edu/~jjc/easytut/easytut/node3.html#SEC=
TION00330000000000000000"=20
  name=3Dtex2html81>Windows</A> </LI></UL><!--End of Table of =
Child-Links-->
<HR>

<H1><A name=3DSECTION00300000000000000000>Intro</A> </H1>
<P>
<H1><A name=3DSECTION00310000000000000000>First things first</A> </H1>
<P>So, you've never programmed before. As we go through this tutorial I =
will=20
attempt to teach you how to program. There really is only one way to =
learn to=20
program. <B>You</B> must read code and write code. I'm going to show you =
lots of=20
code. You should type in code that I show you to see what happens. Play =
around=20
with it and make changes. The worst that can happen is that it won't =
work. When=20
I type in code it will be format like this:=20
<P><PRE>##Python is easy to learn
print "Hello, World!"
</PRE>
<P>Thats so it is easy to distinguish from the other text. To make it =
confusing=20
I will also print what the computer outputs in that same font.=20
<P>Now, on to more important things. In order to program in Python you =
need the=20
Python software. If you don't already have the Python software go to=20
http://www.python.org/download/ and get the proper version for your =
platform.=20
Download it, read the instructions and get it installed.=20
<P>
<H1><A name=3DSECTION00320000000000000000>Running Python</A> </H1>This =
section is=20
somewhat vague since I am trying to explain how to run Python in general =
and not=20
on a specific machine (though I am writing from a Unix viewpoint). If =
you have a=20
Microsoft(tm) Windows machine see the next section for details. If you =
have a=20
Macintosh see http://www.python.org for other documentation.=20
<P>First you should check to see if you can run Python in interactive =
mode. To=20
do this go to a command prompt and type <TT>python</TT>. If everything =
is=20
working you should see something like this: <PRE>Python 1.5.1 (#1, Dec =
17 1998, 20:58:15)  [GCC 2.7.2.3] on linux2
Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
&gt;&gt;&gt;
</PRE>The <TT>&gt;&gt;&gt;</TT> is Python's way of telling you it is =
waiting for=20
you to type something in.=20
<P>If you did not get the <TT>&gt;&gt;&gt;</TT> prompt then something is =
wrong.=20
Check and make sure that you properly installed Python. Check to see =
that the=20
python executable is in the path.=20
<P>Once you got the Python interpreter running you can play around with =
it. Here=20
are some things you could try: <PRE>&gt;&gt;&gt; 1+1
2
&gt;&gt;&gt; 3*4+5=20
17
&gt;&gt;&gt; a=3D12
&gt;&gt;&gt; a    =20
12
&gt;&gt;&gt; "Hi"
'Hi'
&gt;&gt;&gt;
</PRE>
<P>To exit try typing Ctrl+Z or Ctrl+D or if neither of those works type =

<CODE>import sys; sys.exit(0)</CODE>. Next, how to run Python programs. =
First=20
you need create a Python program. To do that you should type in the =
following in=20
a text editor:<A=20
href=3D"http://www.honors.montana.edu/~jjc/easytut/easytut/footnode.html#=
foot25"=20
name=3Dtex2html1><SUP><IMG align=3Dbottom alt=3D[*] border=3D1=20
src=3D"Intro_files/foot_motif.png"></SUP></A><PRE>print "Hello, World!"
</PRE>
<P>Now save the file in some convenient location as hello.py. Next go to =

directory with the file that you save the file in and type <TT>python=20
hello.py</TT>. The screen should look something like this: =
<PRE>&gt;python hello.py
Hello, World!
</PRE>
<P>If you get some error message check to make sure you saved the file =
in the=20
right place.=20
<P>From now on I will mainly give you programs to type in that you =
should save=20
and then run.=20
<P>
<H1><A name=3DSECTION00330000000000000000>Windows</A> </H1>First install =
Python.=20
Then goto a command line which can be done one of two ways: Click=20
<B>Start&gt;&gt;Programs&gt;&gt;MS-DOS Prompt</B>, or click=20
<B>Start&gt;&gt;Run</B>, then type <B>command</B> and hit <B>Enter</B>.=20
<P>This will open up a DOS screen with a prompt that probably looks like =
this:=20
<P><PRE>C:\WINDOWS&gt;
</PRE>
<P>Type <B>python</B> and hit <B>Enter</B>. If you get <TT>Bad command =
or file=20
name</TT> then either you forgot to install Python or =
<TT>python.exe</TT> is not=20
in the <TT>PATH</TT> variable (to see what the <TT>PATH</TT> variable =
has in it=20
type <B>PATH</B>).=20
<P>To fix the problem click <B>Start&gt;&gt;Find&gt;&gt;Files or =
Folders</B> and=20
then look for a file <B>Named</B> <TT>python.exe</TT>. If it is found =
then the=20
problem is the <TT>PATH</TT>, otherwise Python was not properly =
installed.=20
<P>To fix the <TT>PATH</TT> problem the directory that includes=20
<TT>python.exe</TT> needs to be added to <TT>PATH</TT>. The directory =
that=20
<TT>python</TT> is in is the folder that <TT>Find</TT> shows to the left =
of the=20
name. If the whole name is not shown Right click on the python icon and =
go to=20
<B>Properties</B>. The <TT>Properties</TT> dialog will have a line =
called=20
<TT>Location:</TT> that shows the directory where <TT>python.exe</TT> is =
at.=20
Next go to the command prompt and type in <CODE>PATH=3D"C:\Location of=20
Python\";%PATH%</CODE>. For Example: <PRE>C:\WINDOWS&gt;python
Bad command or file name

C:\WINDOWS&gt;PATH=3D"C:\Programe Files\Python";%PATH%

C:\WINDOWS&gt;python
Python 1.5.1 (#0, Apr 13 1998, 20:22:04) [MSC 32 bit (Intel)] on win32
Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
&gt;&gt;&gt;
</PRE>Type Ctrl+Z to get out of interactive mode (i.e. hold down the =
Ctrl Key=20
and then press down on the Z key at the same time, then release both.).=20
<P>Next type this program in a text editor (such as Notepad): <PRE>print =
"Hello, World!"
</PRE>and save it in a convenient location such as=20
<CODE>C:\python\hello.py</CODE>.=20
<P>From here you need to change the path to the Python directory where =
you saved=20
your first program. The command to do this is (Hit Enter): <PRE>cd =
\python
</PRE>which should give you a prompt like: <PRE>C:\Python&gt;
</PRE>
<P>Now you are ready to run your first program. Just type python =
hello.py=20
<P><PRE>&gt;python hello.py
Hello, World!
</PRE>
<P>From now on in the tutorial I will assume that you know how to create =
and run=20
programs.=20
<P>
<HR>
<!--Navigation Panel--><A=20
href=3D"http://www.honors.montana.edu/~jjc/easytut/easytut/node4.html"=20
name=3Dtex2html77><IMG align=3Dbottom alt=3Dnext border=3D0 height=3D24=20
src=3D"Intro_files/next_motif.png" width=3D37></A> <A=20
href=3D"http://www.honors.montana.edu/~jjc/easytut/easytut/easytut.html" =

name=3Dtex2html73><IMG align=3Dbottom alt=3Dup border=3D0 height=3D24=20
src=3D"Intro_files/up_motif.png" width=3D26></A> <A=20
href=3D"http://www.honors.montana.edu/~jjc/easytut/easytut/node2.html"=20
name=3Dtex2html67><IMG align=3Dbottom alt=3Dprevious border=3D0 =
height=3D24=20
src=3D"Intro_files/previous_motif.png" width=3D63></A> <A=20
href=3D"http://www.honors.montana.edu/~jjc/easytut/easytut/node2.html"=20
name=3Dtex2html75><IMG align=3Dbottom alt=3Dcontents border=3D0 =
height=3D24=20
src=3D"Intro_files/contents_motif.png" width=3D65></A> <BR><B>Next:</B> =
<A=20
href=3D"http://www.honors.montana.edu/~jjc/easytut/easytut/node4.html"=20
name=3Dtex2html78>Hello, World</A> <B>Up:</B> <A=20
href=3D"http://www.honors.montana.edu/~jjc/easytut/easytut/easytut.html" =

name=3Dtex2html74>Non-Programmers Tutorial For Python</A> =
<B>Previous:</B> <A=20
href=3D"http://www.honors.montana.edu/~jjc/easytut/easytut/node2.html"=20
name=3Dtex2html68>Contents</A> &nbsp; <B><A=20
href=3D"http://www.honors.montana.edu/~jjc/easytut/easytut/node2.html"=20
name=3Dtex2html76>Contents</A></B> <!--End of Navigation Panel-->
<ADDRESS>Josh Cogliati <A =
href=3D"mailto:jjc@iname.com">jjc@iname.com</A>=20
</ADDRESS></BODY></HTML>

------=_NextPart_000_000D_01BF69DD.F77FCCE0--