A few newbie questions 
Author Message
 A few newbie questions

Dear python experts,

I've been investigating scripting languages for use in our project. So
far, Python seems to be the best. I just want to make sure that it is
both easy and possible to do the following tasks before I recommend
using it on our project. I'd appreciate any comments, suggestions or
pointers to documentation on how to do the following in Python:

1. Need to get a list of names of all instances of a certain type. For
instance, the GUI process (a separate Unix process) will want to query
Python for a list of names of all variables of type int.

2. The GUI process will want to be notified whenever a new global
variable is created or destroyed in Python.

3. Since our system is a multiprocessor one, we'll need to modify the
Python's allocation procedure for built in types to allocate them in
shared space.

4. External processes need to send command strings to Python for it to parse.

Thank you.

Sincerely,
Tony Brusseau



Sun, 22 Feb 1998 03:00:00 GMT  
 A few newbie questions

Quote:
> 1. Need to get a list of names of all instances of a certain type. For
> instance, the GUI process (a separate Unix process) will want to query
> Python for a list of names of all variables of type int.

Hmm, I'm not sure why you want this, and there seems to be some
confusion: a list of all instances of type 'int' won't tell you about
all variables containing int objects; with "a list of names of all
variables", do you mean only global variables or also local variables,
and perhaps also anonymous "variables" stored away in lists or
dictionaries?  A list of names of all global variables of a given type
can certainly be assembled (at some cost -- you'll have to scan all
modules); a list of all instances would require modifications  to the
implementation.  (Actually, there's some optional debugging code that
keeps track of *all* objects, which you could use as a start there.)

Quote:
> 2. The GUI process will want to be notified whenever a new global
> variable is created or destroyed in Python.

Again, why exactly do you need this?  Python doesn't support
notification of changes to variables.  Since globals are stored in
dictionaries, it should possible to modify the dictionary
implementation to optionally set traps on dictionary changes.

Quote:
> 3. Since our system is a multiprocessor one, we'll need to modify the
> Python's allocation procedure for built in types to allocate them in
> shared space.

Pythin uses malloc, so if you can substitute your own malloc, you're
set.

Quote:
> 4. External processes need to send command strings to Python for it to parse.

No problem there!


URL: <http://www.python.org/~guido/>



Sun, 22 Feb 1998 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. A few newbie questions...

2. a few newbie questions...

3. A few newbie questions

4. A few more newbie questions..

5. Few newbie syntax questions

6. newbie....a few questions

7. Please asm newbie with few questions

8. Newbie here, a few questions

9. A few more newbie questions

10. Newbie has a few questions

11. Some questions on elided text in the text widget (and a few other text widget questions)

12. Newbie Question (Was: Newbie Question...)

 

 
Powered by phpBB® Forum Software