[Tutor] defined()

János Juhász janos.juhasz at VELUX.com
Tue Apr 4 08:44:35 CEST 2006


Dear Tim, 
 Dear Alan,

>> I can't find the defined() function in python, so I used
>>'variable name' in dir()
>
>> Is it really missing, or I am just so simple ?
>
> It is really missing, just as it is for most programming languages.
> Which language(s) do you know that has such a feature?

I should came from Marco Cantu's Delphi 2005 book, that I have read just 
recently.
But I am unable to find it again.

> And why do you consider it so useful that you expect to find
> it in Python?
I don't miss it. It was just a foggy engram, that I couldn't find in the 
help :)

> The main place where I could see such a thing being useful
> would be in dynamically loaded code but then the usual
> approach is to load a dictionary and an 'in' check suffices.
>
> I'm interested in what use you would make of such a thing?

I just started to make a .leo file, where I wanted to place my scripts.

http://webpages.charter.net/edreamleo/front.html

I just tried to collect all of my scripts (sql, wmi, admin, snmp ...), and 
html references, admin knowledge, passwords for active devices... into one 
place, that can be shared with my colleagues with detailed description 
about the usage and the reasons to use of them. Leo seems to be a very 
good candidate for that.

An sql script seems to be like this.

---------
<< ScalaDB >>

data = Query(<< Sql >>)

<< Show Data >>
------------

In the leo file the << ScalaDB >> is simple replaced by the  << ScalaDB >> 
subtree. The script is created dinamically from the texts in the tree. So 
I just wanted to check in the << Show Data >> part, if the data is defined 
previously or not.


Yours sincerely, 
______________________________
Janos Juhasz 


More information about the Tutor mailing list