Google
 
Webnews.only-4-geeks.com
Interesting places
news.only-4-geeks.com Forum Index » Python

Simple Path issues

 
Jump to:  
 
Brett Ritter
PostPosted: Sat Jul 26, 2008 6:32 pm    Post subject: Simple Path issues
       
New to Python, and I have some questions on how to best set up a basic
development environment, particular relating to path issues.

Note: I am not root on my development box (which is some flavor of
BSD)

Where should I develop my own modules so as to refer to them in the
standard way. I.E. I want:
import proj

to work regardless of my current working directory, and to function as
if "proj" were a core or third-party module.

I saw that I can set PYTHONPATH, but that seems sub-prime. I noted
that in installing pysqlite (the local installation of python is 2.4)
that I had it install in a lib under my home dir...should I use that
locale?

What is the command to tell me what directories python is checking in?

While I'm at it, what is the best (read: standard) locale to stick my
test cases? same dir as my project? A subdir?

Thanks in advance
 

 
Gary Josack
PostPosted: Sat Jul 26, 2008 6:32 pm    Post subject: Re: Simple Path issues
       
Brett Ritter wrote:
Quote:
New to Python, and I have some questions on how to best set up a basic
development environment, particular relating to path issues.

Note: I am not root on my development box (which is some flavor of
BSD)

Where should I develop my own modules so as to refer to them in the
standard way. I.E. I want:
import proj

to work regardless of my current working directory, and to function as
if "proj" were a core or third-party module.

I saw that I can set PYTHONPATH, but that seems sub-prime. I noted
that in installing pysqlite (the local installation of python is 2.4)
that I had it install in a lib under my home dir...should I use that
locale?

What is the command to tell me what directories python is checking in?

While I'm at it, what is the best (read: standard) locale to stick my
test cases? same dir as my project? A subdir?

Thanks in advance
--
LINK


sys.path is a list that will tell you where python is looking. You can
append to this in your scripts to have python look in a specific
directory for your own modules.

Thanks,
Gary M. Josack
 

 
Brett Ritter
PostPosted: Sat Jul 26, 2008 7:38 pm    Post subject: Re: Simple Path issues
       
On Jul 26, 2:57 pm, Gary Josack <g...@byoteki.com> wrote:
Quote:
sys.path is a list that will tell you where python is looking. You can
append to this in your scripts to have python look in a specific
directory for your own modules.

I can, but that is almost certainly not the standard way to develop a
module.

I see nothing in sys.path that I have write permissions to.

Is altering my PYTHONPATH the normal way to develop (under the
assumption that later users will install in their conventional python
search path)?
 

 
Gary Josack
PostPosted: Sun Jul 27, 2008 3:41 am    Post subject: Re: Simple Path issues
       
Brett Ritter wrote:
Quote:
On Jul 26, 2:57 pm, Gary Josack <g...@byoteki.com> wrote:

sys.path is a list that will tell you where python is looking. You can
append to this in your scripts to have python look in a specific
directory for your own modules.


I can, but that is almost certainly not the standard way to develop a
module.

I see nothing in sys.path that I have write permissions to.

Is altering my PYTHONPATH the normal way to develop (under the
assumption that later users will install in their conventional python
search path)?

--
LINK

If you plan to put your module in a non-standard location then your only

options are adding to sys.path in you program or setting PYTHONPATH. If
this is only for development then you're better off just using
PYTHONPATH with the assumption "users will install in their conventional
python search path".
 

Page 1 of 1 .:.

Google
 
Webnews.only-4-geeks.com

Windows Update | C++ | C | PHP | JavaScript | Photoshop | Programming | Windows 2000 | Python | Windows XP | Object | Flash | Flash - ActionScript | Paint Shop Pro | Excel | PowerPoint | Access | Word | Windows 98 | Internet Explorer 6.0 | CorelDraw12 | Java | XML | asm x86 | Linux Mandrake | Linux RedHat | Outlook |  | news from newsgroups |_ | s

Web Templates

Awesome Website Templates ©

trwa pobierania linkow system wymiany linkow proces pobierania linkow wymiana linkami wymiana linkow