Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > local moduile acess from cgi-bin

Reply
Thread Tools

local moduile acess from cgi-bin

 
 
noro
Guest
Posts: n/a
 
      07-25-2006
hello all.

I do some coding in python but this is my first attampt to write
somthing for hte web.

I need to write a cgi-bin script for a web-server, and i've got the
access for it from our "SYSTEM". the problem is that this script uses
some modules (pg, pyLab) that i've installed localy in my home dir.
Python knows how to find them due to an enviorment variable inthe shell
(please corrent me if i'm wrong).

now, i am by no means big expert about web servers, but if i got it
right, the web server run under some user ("www-data" or such).
so howi can i make this user (and the web) be able to run my python
code without having to install the modules as shared. (which i dont
think they will allow me).

thanks very much
amit

 
Reply With Quote
 
 
 
 
Bruno Desthuilliers
Guest
Posts: n/a
 
      07-25-2006
noro wrote:
> hello all.
>
> I do some coding in python but this is my first attampt to write
> somthing for hte web.
>
> I need to write a cgi-bin script for a web-server, and i've got the
> access for it from our "SYSTEM". the problem is that this script uses
> some modules (pg, pyLab) that i've installed localy in my home dir.
> Python knows how to find them due to an enviorment variable inthe shell
> (please corrent me if i'm wrong).
>
> now, i am by no means big expert about web servers, but if i got it
> right, the web server run under some user ("www-data" or such).
> so howi can i make this user (and the web) be able to run my python
> code without having to install the modules as shared. (which i dont
> think they will allow me).


import sys
sys.path.append('/home/amir/<wherever-your-modules-are>')

should do the trick.

HTH
--
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
p in '(E-Mail Removed)'.split('@')])"
 
Reply With Quote
 
 
 
 
noro
Guest
Posts: n/a
 
      07-26-2006
thanks bruno

Bruno Desthuilliers wrote:
> noro wrote:
> > hello all.
> >
> > I do some coding in python but this is my first attampt to write
> > somthing for hte web.
> >
> > I need to write a cgi-bin script for a web-server, and i've got the
> > access for it from our "SYSTEM". the problem is that this script uses
> > some modules (pg, pyLab) that i've installed localy in my home dir.
> > Python knows how to find them due to an enviorment variable inthe shell
> > (please corrent me if i'm wrong).
> >
> > now, i am by no means big expert about web servers, but if i got it
> > right, the web server run under some user ("www-data" or such).
> > so howi can i make this user (and the web) be able to run my python
> > code without having to install the modules as shared. (which i dont
> > think they will allow me).

>
> import sys
> sys.path.append('/home/amir/<wherever-your-modules-are>')
>
> should do the trick.
>
> HTH
> --
> bruno desthuilliers
> python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
> p in '(E-Mail Removed)'.split('@')])"


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
A News (NNTP) error occurred: Acess denied to your node Echy Firefox 8 12-27-2005 06:35 AM
Controling View Wireless Network Acess Points =?Utf-8?B?d2lnZ2xlYnJvdGhlcg==?= Wireless Networking 1 05-10-2005 04:55 PM
Connected on the network can not acess internet =?Utf-8?B?VE9OWVJPTUU=?= Wireless Networking 1 05-04-2005 10:09 PM
How to set up a public acess point yar Wireless Networking 6 11-18-2004 08:32 PM
Adding Wireless acess point to existing network. Shawn Wireless Networking 1 10-17-2004 03:53 PM



Advertisments