<div class="gmail_quote">On Sun, Dec 20, 2009 at 5:18 AM, Chris Rebert <span dir="ltr"><<a href="mailto:clp2@rebertia.com">clp2@rebertia.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><div></div><div class="h5">On Sun, Dec 20, 2009 at 2:06 AM, Victor Subervi <<a href="mailto:victorsubervi@gmail.com">victorsubervi@gmail.com</a>> wrote:<br>
> Hi;<br>
> I'm looking for something like os.environ['HTTP_REFERER'] but for python<br>
> scripts. That is, if I have a script that is imported by another script, how<br>
> can I have the script that is being imported determine which script imported<br>
> it?<br>
<br>
</div></div>Allow me to ask the meta-question of: Why do you want to do that?<br>
There is quite possibly a better means to accomplish whatever end you have.<br></blockquote><div><br>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.<br>
TIA,<br>V<br></div></div>