On Sun, Dec 20, 2009 at 5:18 AM, Chris Rebert <c...@rebertia.com> wrote:
> On Sun, Dec 20, 2009 at 2:06 AM, Victor Subervi <victorsube...@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
-- http://mail.python.org/mailman/listinfo/python-list