[Tutor] inquire

XIA Xiao-Qin XQ.Xia@ccsr.cam.ac.uk
Thu, 11 Jan 2001 17:12:42 +0000


--=====_97923316241=_
Content-Type: text/plain; charset="WINDOWS-1250"

Dear Sir/Madam,

Does python offer any method or function to return the name of any object?
eg.

>>>aaa=None
>>>print Wanted_Function(aaa)
'aaa'

the question is if such a function like Wanted_Function() actually exists.

Many Thanks,
Xia XQ


--=====_97923316241=_
Content-Type: text/html; charset="WINDOWS-1250"

<!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 HTML//EN">
<HTML>
<HEAD>

<META content="text/html; charset=windows-1250" http-equiv=Content-Type>
<META content='"MSHTML 4.72.3612.1700"' name=GENERATOR>
</HEAD>
<BODY bgColor=#ffffff style="FONT-FAMILY: Arial" text=#000000>
<DIV><FONT size=2>Dear Sir/Madam,</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>Does python offer any method or function to return the name of 
any object?</FONT></DIV>
<DIV><FONT size=2>eg.</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>&gt;&gt;&gt;aaa=None</FONT></DIV>
<DIV><FONT size=2>&gt;&gt;&gt;print Wanted_Function(aaa)</FONT></DIV>
<DIV><FONT size=2>'aaa'</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>the question is if such a function like Wanted_Function() 
actually exists.</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>Many Thanks,</FONT></DIV>
<DIV><FONT size=2>Xia XQ</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV></BODY></HTML>


--=====_97923316241=_--