Re: [Tutor] folder and module

2006-09-18 Thread linda.s
> Hi Linda, > > what do you get when you try: > > >>> import os > >>> os.getcwd() > > The current working directory is represented in sys.path as the first > element: > > >>> import sys > >>> sys.path[0] > '' > > > Not the most intuitive, perhaps. > > I suspect you are launching your Python env

Re: [Tutor] folder and module

2006-09-17 Thread Brian van den Broek
linda.s said unto the world upon 17/09/06 02:03 PM: > I checked sys.path and environemntal variables: > since the desktop directory is not listed in either of them, > why there is no error report when I import a module which is in the > desktop into test.py which is under a different folder? > L

Re: [Tutor] folder and module

2006-09-17 Thread linda.s
On 9/17/06, Alan Gauld <[EMAIL PROTECTED]> wrote: > >> listed in the variable sys.path. sys.path gets populated when > >> Python starts up and includes some standard locations plus > >> any you define in your PYTHONPATH environment variable. > >> > > I checked my PYTHONPATH environment variable > >

Re: [Tutor] folder and module

2006-09-17 Thread Alan Gauld
>> listed in the variable sys.path. sys.path gets populated when >> Python starts up and includes some standard locations plus >> any you define in your PYTHONPATH environment variable. >> > I checked my PYTHONPATH environment variable > My questions are: > 1. since the desktop directory is not li

Re: [Tutor] folder and module

2006-09-17 Thread Liam Clarke
Hi Linda, At your Python prompt try the following: >>> import sys >>> print sys.path What directories are listed there? On 9/17/06, linda.s <[EMAIL PROTECTED]> wrote: > > > i have test.py under c:\try1\new; > > > I want to import b and b.py is under c:\trytry. How to do it? > > > Also, I impor

Re: [Tutor] folder and module

2006-09-17 Thread linda.s
> > i have test.py under c:\try1\new; > > I want to import b and b.py is under c:\trytry. How to do it? > > Also, I import c and c.py is in the desktop folder but no error > > reported. > > Python imports modules by looking for them in the folders > listed in the variable sys.path. sys.path gets po

Re: [Tutor] folder and module

2006-09-17 Thread Liam Clarke
Hi Linda, As Alan said, you can modify your sys.path at runtime - to clarify, a simple example is: >>> import sys >>> sys.path.append("c:/trytry") "import b" should now work. Regards, Liam Clarke On 9/17/06, Alan Gauld <[EMAIL PROTECTED]> wrote: > Linda, > > > i have test.py under c:\try1\new

Re: [Tutor] folder and module

2006-09-17 Thread Alan Gauld
Linda, > i have test.py under c:\try1\new; > I want to import b and b.py is under c:\trytry. How to do it? > Also, I import c and c.py is in the desktop folder but no error > reported. Python imports modules by looking for them in the folders listed in the variable sys.path. sys.path gets popula

[Tutor] folder and module

2006-09-16 Thread linda.s
Hi there, i have test.py under c:\try1\new; I want to import b and b.py is under c:\trytry. How to do it? Also, I import c and c.py is in the desktop folder but no error reported. Why? Thanks, Linda On 9/2/06, linda. s <[EMAIL PROTECTED]> wrote: > I read something about random.seed() but still c