Hi Ben!
After looking at the modules I detected the traceback-Module in my installation:
>>> import traceback
>>> def two():
... one()
...
>>> two()
>>> def one():
... print traceback.extract_stack()
...
>>> def two():
... one()
...
>>> two()
[('<stdin>', 1, '?', None), ('<stdin>', 2, 'two', None), ('<stdin>', 2, 'one',
None)]
maybe this could be a start for your investigation
HTH Ewald
Ben Vinger wrote:
> Hello
>
> I want myfunction in the pseudocode below return something different if
> it was called from indexfunction.
>
> def indexfunction():
> blah
>
> def myfunction():
> x = 'whatever'
> if <myfunction was called from indexfunction>:
> return x
> else:
> return <header> + x + <footer>
>
>
> Thanks
> Ben
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Tutor maillist - [email protected]
> http://mail.python.org/mailman/listinfo/tutor
--
Ing. Ewald Ertl HartterGruppe Phone :
+43-3352-33085-558
trinomic Projektmanagement & Informationstechnik GmbH Fax :
+43-3352-33085-600
Wiener Straße 41 mailto:[EMAIL PROTECTED]
A-7400 Oberwart http://www.trinomic.com mailto:[EMAIL PROTECTED]
_______________________________________________
Tutor maillist - [email protected]
http://mail.python.org/mailman/listinfo/tutor