[Tutor] [Q] IDLE setting

Andrew Wilkins toodles@yifan.net
Fri, 2 Nov 2001 08:58:06 +0800


This is a multi-part message in MIME format.

------=_NextPart_000_0028_01C1637C.7D284450
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hi Young-Jin

You're quite right in thinking that Python works with sys.path. All you =
need to do is append the directory to sys.path that contains the =
program. sys.path.append("directory")
Example:

####
>>> import sys
>>> sys.path
['C:\\Python21\\Tools\\idle', 'C:\\Python21', 'C:\\Python21\\DLLs', =
'C:\\Python21\\lib', 'C:\\Python21\\lib\\plat-win', =
'C:\\Python21\\lib\\lib-tk']
>>> import monkey
Traceback (most recent call last):
  File "<pyshell#3>", line 1, in ?
    import monkey
ImportError: No module named monkey
>>> sys.path.append('c:\\monkey')
>>> import monkey
His nature was - IRREPRESSIBLE!
###

Regards,
Andrew

  ----- Original Message -----=20
  From: Young-Jin Lee=20
  To: tutor@python.org=20
  Sent: Friday, November 02, 2001 7:49 AM
  Subject: [Tutor] [Q] IDLE setting


  Hi, I'm a newbie trying to learn Python.
  I have a problem using IDLE. I think IDLE import modules only from the =
sys.path, but I don't know how to change the sys.path in IDLE (or =
outside a IDLE). I tried to run a wxPython demo code after loading the =
file into IDLE, but IDLE failed to load it. But I could run it on the =
command window of windows 2000 os.=20

  Thanks in advance.

  YJ

------=_NextPart_000_0028_01C1637C.7D284450
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 http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2600.0" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Hi Young-Jin</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>You're quite right in thinking that =
Python works=20
with sys.path. All you need to do is append the directory to sys.path =
that=20
contains the program. sys.path.append("directory")</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Example:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>####</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>&gt;&gt;&gt; import sys</FONT><FONT =
face=3DArial=20
size=3D2><BR>&gt;&gt;&gt; sys.path<BR>['C:\\Python21\\Tools\\idle',=20
'C:\\Python21', 'C:\\Python21\\DLLs', 'C:\\Python21\\lib',=20
'C:\\Python21\\lib\\plat-win', 'C:\\Python21\\lib\\lib-tk']</FONT><FONT=20
face=3DArial size=3D2><BR>&gt;&gt;&gt; import monkey<BR>Traceback (most =
recent call=20
last):<BR>&nbsp; File "&lt;pyshell#3&gt;", line 1, in =
?<BR>&nbsp;&nbsp;&nbsp;=20
import monkey<BR>ImportError: No module named monkey<BR>&gt;&gt;&gt;=20
sys.path.append('c:\\monkey')<BR>&gt;&gt;&gt; import monkey<BR>His =
nature was -=20
IRREPRESSIBLE!</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>###</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Regards,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Andrew</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
  <DIV style=3D"FONT: 10pt arial">----- Original Message ----- </DIV>
  <DIV=20
  style=3D"BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: =
black"><B>From:</B>=20
  <A title=3Dylee12@uiuc.edu href=3D"mailto:ylee12@uiuc.edu">Young-Jin =
Lee</A>=20
</DIV>
  <DIV style=3D"FONT: 10pt arial"><B>To:</B> <A title=3Dtutor@python.org =

  href=3D"mailto:tutor@python.org">tutor@python.org</A> </DIV>
  <DIV style=3D"FONT: 10pt arial"><B>Sent:</B> Friday, November 02, 2001 =
7:49=20
  AM</DIV>
  <DIV style=3D"FONT: 10pt arial"><B>Subject:</B> [Tutor] [Q] IDLE =
setting</DIV>
  <DIV><BR></DIV>
  <DIV><FONT face=3DArial size=3D2>Hi, I'm a newbie trying to learn=20
  Python.</FONT></DIV>
  <DIV><FONT face=3DArial size=3D2>I have a problem using IDLE. I think =
IDLE import=20
  modules only from the sys.path, but I don't know how to change the =
sys.path in=20
  IDLE (or outside a IDLE). I tried to run a wxPython demo code after =
loading=20
  the file into IDLE, but IDLE failed to load it. But I&nbsp;could run =
it on the=20
  command window of windows 2000 os. </FONT></DIV>
  <DIV>&nbsp;</DIV>
  <DIV><FONT face=3DArial size=3D2>Thanks in advance.</FONT></DIV>
  <DIV>&nbsp;</DIV>
  <DIV><FONT face=3DArial =
size=3D2>YJ</FONT></DIV></BLOCKQUOTE></BODY></HTML>

------=_NextPart_000_0028_01C1637C.7D284450--