Re: [Tutor] PYTHONPATH (Mac OS X)

2012-01-13 Thread David Rock
* Stayvoid [2011-12-30 16:11]: > >You don't have any option. > >You either type in the full path or you get the user to tell you > >in some way - either with a prompt or via an input argument. > > OK, now I get it. > > How can I tell this to the end-user? > Should I write a README file or what?

Re: [Tutor] PYTHONPATH (Mac OS X)

2011-12-30 Thread Alan Gauld
On 30/12/11 13:11, Stayvoid wrote: I've tried to run lengthcounter_lutz from the file's folder and this worked out. cd /Users/Username/Python_modules/ python /Users/Username/Python_modules/lengthcounter_lutz.py You should only have needed: > python ./lengthcounter_lutz.py the ./ tells Linux

Re: [Tutor] PYTHONPATH (Mac OS X)

2011-12-30 Thread Stayvoid
>You don't have any option. >You either type in the full path or you get the user to tell you >in some way - either with a prompt or via an input argument. OK, now I get it. How can I tell this to the end-user? Should I write a README file or what? I've tried to run lengthcounter_lutz from the f

Re: [Tutor] PYTHONPATH (Mac OS X)

2011-12-26 Thread Alan Gauld
On 26/12/11 12:23, Stayvoid wrote: Simply that python is saying it cannot find the file. So it is probably in a different folder ... Those files are in the same folder: /Users/Username/Python_modules/ And is that where you are running the code from? That is the critical factor. By just prov

Re: [Tutor] PYTHONPATH (Mac OS X)

2011-12-26 Thread Dave Angel
On 12/26/2011 07:23 AM, Stayvoid wrote: Simply that python is saying it cannot find the file. So it is probably in a different folder to the one in which the program is running. You need to provide a valid path to the file, Those files are in the same folder: /Users/Username/Python_modules/ I

Re: [Tutor] PYTHONPATH (Mac OS X)

2011-12-26 Thread Stayvoid
>Simply that python is saying it cannot find the file. >So it is probably in a different folder to the one in which the program is >running. You need to provide a valid path to the file, Those files are in the same folder: /Users/Username/Python_modules/ I don't want to write a full path here: i

Re: [Tutor] PYTHONPATH (Mac OS X)

2011-12-25 Thread Alan Gauld
On 25/12/11 22:55, Stayvoid wrote: There is a module called lcclient_lutz.py: from lengthcounter_lutz import countLines, countChars print countLines('lengthcounter_lutz.py'), countChars('lengthcounter_lutz.py') countChars('lengthcounter_lutz.py') File "/Users/Username/Python_modules/lengthc

Re: [Tutor] PYTHONPATH (Mac OS X)

2011-12-25 Thread Stayvoid
Hey there! I'm reading Lutz's Learning Python. Here is some code from the book. There is a module called lcclient_lutz.py: from lengthcounter_lutz import countLines, countChars print countLines('lengthcounter_lutz.py'), countChars('lengthcounter_lutz.py') And there is another one called length

Re: [Tutor] PYTHONPATH (Mac OS X)

2011-12-20 Thread Alan Gauld
On 20/12/11 01:33, Stayvoid wrote: I want to have a possibility to import modules from the folder, which is not included in the load path. The code and error below has nothing to do with importing modules or the PYTHONPATH value. module.py - def testfunc(name): file = open(name)

Re: [Tutor] PYTHONPATH (Mac OS X)

2011-12-19 Thread Dave Angel
On 12/19/2011 08:33 PM, Stayvoid wrote: Please clarify, or expand, or tell us what problem you are having or trying to solve. Hi! I want to have a possibility to import modules from the folder, which is not included in the load path. Example: module.py - def testfunc(name): file =

Re: [Tutor] PYTHONPATH (Mac OS X)

2011-12-19 Thread Stayvoid
> Please clarify, or expand, or tell us what problem you are having or > trying to solve. Hi! I want to have a possibility to import modules from the folder, which is not included in the load path. Example: module.py - def testfunc(name): file = open(name) return len(file.readlines(

Re: [Tutor] PYTHONPATH (Mac OS X)

2011-12-18 Thread bob gailer
On 12/18/2011 5:45 PM, Stayvoid wrote: Hey there! How to set it right? You may not get an answer as your question is pretty vague. Please clarify, or expand, or tell us what problem you are having or trying to solve. -- Bob Gailer 919-636-4239 Chapel Hill NC ___

[Tutor] PYTHONPATH (Mac OS X)

2011-12-18 Thread Stayvoid
Hey there! How to set it right? Cheers! ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] pythonpath

2010-11-01 Thread Emile van Sebille
On 11/1/2010 2:41 PM Chris King said... Dear Tutors, When I try to import a module, how can I make it look in certain directories for them easily. Sincerely, Chris I'm not sure it's still the preferred way of setting sys.path, but site.py sets sys.path and contains info on *.pth files and oth

Re: [Tutor] pythonpath

2010-11-01 Thread Steven D'Aprano
Chris King wrote: it didn't work Define "it" and "didn't work". What did you try? What happened when you tried it? -- Steven ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/l

Re: [Tutor] pythonpath

2010-11-01 Thread John
hehe. yeah, I had to go check my old PC that's collecting dust on how to navigate the 'happy dungeon' of windows wizards... I do prefer: export PYTHONPATH=/my/custom/dir On Mon, Nov 1, 2010 at 11:03 PM, Vince Spicer wrote: > > > On Mon, Nov 1, 2010 at 4:00 PM, Vince Spicer wrote: >> >> >> On

Re: [Tutor] pythonpath

2010-11-01 Thread Chris King
On 11/1/2010 6:13 PM, Walter Prins wrote: On 1 November 2010 21:58, Chris King @gmail.com > wrote: the first way with work for Window, the second is for Linux or posix systems Sorry I can't help with PYTHONPATH on windows. To set a PYTHON

Re: [Tutor] pythonpath

2010-11-01 Thread Walter Prins
On 1 November 2010 21:58, Chris King wrote: > the first way with work for Window, the second is for Linux or posix > systems > > Sorry I can't help with PYTHONPATH on windows. > > To set a PYTHONPATH in Windows, click "Start", right click "My computer", click "Properties", click "Advanced" tab

Re: [Tutor] pythonpath

2010-11-01 Thread Walter Prins
On 1 November 2010 21:57, Chris King wrote: > On 11/1/2010 5:47 PM, Vince Spicer wrote: > it didn't work > > Then you've done something wrong. Post the code, and/or the error message, if any. Walter ___ Tutor maillist - Tutor@python.org To unsubscr

Re: [Tutor] pythonpath

2010-11-01 Thread Vince Spicer
On Mon, Nov 1, 2010 at 4:00 PM, Vince Spicer wrote: > > > On Mon, Nov 1, 2010 at 3:58 PM, Chris King wrote: > >> On 11/1/2010 5:57 PM, Vince Spicer wrote: >> >> >> >> On Mon, Nov 1, 2010 at 3:54 PM, Chris King wrote: >> >>> On 11/1/2010 5:47 PM, Vince Spicer wrote: >>> >>> >>> >>> On Mon, No

Re: [Tutor] pythonpath

2010-11-01 Thread John
Chris, I haven't worked on windows in ages, but I think you can set a PYTHONPATH variable if you right click on My Computer and maybe the advanced tab, there is a place to set ENVIRONMENT VARIABLES. Create a new one called PYTHONPATH pointing to your directory. -john On Mon, Nov 1, 2010 at 10:58

Re: [Tutor] pythonpath

2010-11-01 Thread Vince Spicer
On Mon, Nov 1, 2010 at 3:58 PM, Chris King wrote: > On 11/1/2010 5:57 PM, Vince Spicer wrote: > > > > On Mon, Nov 1, 2010 at 3:54 PM, Chris King wrote: > >> On 11/1/2010 5:47 PM, Vince Spicer wrote: >> >> >> >> On Mon, Nov 1, 2010 at 3:41 PM, Chris King wrote: >> >>> Dear Tutors, >>>Whe

Re: [Tutor] pythonpath

2010-11-01 Thread Chris King
On 11/1/2010 5:57 PM, Vince Spicer wrote: On Mon, Nov 1, 2010 at 3:54 PM, Chris King @gmail.com > wrote: On 11/1/2010 5:47 PM, Vince Spicer wrote: On Mon, Nov 1, 2010 at 3:41 PM, Chris King http://g.nius.ck>@gmail.com > wrote:

Re: [Tutor] pythonpath

2010-11-01 Thread Chris King
On 11/1/2010 5:47 PM, Vince Spicer wrote: On Mon, Nov 1, 2010 at 3:41 PM, Chris King @gmail.com > wrote: Dear Tutors, When I try to import a module, how can I make it look in certain directories for them easily. Sincerely, Chris

Re: [Tutor] pythonpath

2010-11-01 Thread Karim
On 11/01/2010 10:41 PM, Chris King wrote: Dear Tutors, When I try to import a module, how can I make it look in certain directories for them easily. Sincerely, Chris ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscriptio

Re: [Tutor] pythonpath

2010-11-01 Thread Vince Spicer
On Mon, Nov 1, 2010 at 3:41 PM, Chris King wrote: > Dear Tutors, >When I try to import a module, how can I make it look in certain > directories for them easily. > Sincerely, >Chris > ___ > Tutor maillist - Tutor@python.org > To unsubscribe o

[Tutor] pythonpath

2010-11-01 Thread Chris King
Dear Tutors, When I try to import a module, how can I make it look in certain directories for them easily. Sincerely, Chris ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/l

Re: [Tutor] PYTHONPATH-corrected

2009-07-01 Thread Alan Gauld
"Steve Willoughby" wrote in directories for chapers. Now I am on modules, and some are reused in later chapters. I have set up a directory for the modules. How do I add it to my PYTHONPATH? So, for example, in a bash/sh shell, you'd say: export PYTHONPATH="/path/to/my/modules" And you ca

Re: [Tutor] PYTHONPATH-corrected

2009-06-30 Thread Steve Willoughby
On Tue, Jun 30, 2009 at 02:33:27PM -0400, Bob Rea wrote: > In working my way through the book on python, I am working > in directories for chapers. Now I am on modules, and some > are reused in later chapters. I have set up a directory for > the modules. How do I add it to my PYTHONPATH? > I can

[Tutor] PYTHONPATH-corrected

2009-06-30 Thread Bob Rea
In working my way through the book on python, I am working in directories for chapers. Now I am on modules, and some are reused in later chapters. I have set up a directory for the modules. How do I add it to my PYTHONPATH? I can use sys.path.append but that only lasts for the session. This is

[Tutor] PYTHONPATH

2009-06-30 Thread Bob Rea
In working my way through the book on python, i am working in directories for chapers. Now I am on modules, and some are reused in later chapters. I have set up a directory for the modules. How do I add it to my PYTHONPATH? I can use sys.path.append but that only lasts for the session. -- Bob