Something Like os.environ['HTTP_REFERER']

Victor Subervi victorsubervi at gmail.com
Sun Dec 20 06:05:55 EST 2009


On Sun, Dec 20, 2009 at 5:18 AM, Chris Rebert <clp2 at rebertia.com> wrote:

> On Sun, Dec 20, 2009 at 2:06 AM, Victor Subervi <victorsubervi at gmail.com>
> wrote:
> > Hi;
> > I'm looking for something like os.environ['HTTP_REFERER'] but for python
> > scripts. That is, if I have a script that is imported by another script,
> how
> > can I have the script that is being imported determine which script
> imported
> > it?
>
> Allow me to ask the meta-question of: Why do you want to do that?
> There is quite possibly a better means to accomplish whatever end you have.
>

I'm writing a shopping cart in which I'm automating as much as is possible.
The problem is that certain kinds of shopping carts have certain peculiar
needs that must be accommodated. For example, a shopping cart for
pharmaceuticals requires authentication and identification of the visitor
before serving the "products" available to the visitor and specific to the
visitor (their prescriptions); the jewelry shopping cart I'm building will
enable automatic pricing updates based on the spot prices of the various
metals. I've realized that I can call specific programs from the pages where
these special functionalities will need to be incorporated and then
programmatically do the necessary. Of course, I can pass the page name as a
parameter, but that's not elegant.
TIA,
V
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20091220/09d0f84a/attachment-0001.html>


More information about the Python-list mailing list