Re: Accessing Python variables in an extension module

2007-07-16 Thread MD
Hi Alex, Thanks for your reply. It was exactly what I was looking for. Two additional questions 1) Is there anyway to find out which modules a variable belongs to when I have only its name (and its not qualified with the complete name like module.varname) 2) Is there anyway to find the type of

Re: Accessing Python variables in an extension module

2007-07-16 Thread Diez B. Roggisch
MD wrote: Hi Alex, Thanks for your reply. It was exactly what I was looking for. Two additional questions 1) Is there anyway to find out which modules a variable belongs to when I have only its name (and its not qualified with the complete name like module.varname) No. 2) Is there

Re: Accessing Python variables in an extension module

2007-07-16 Thread Alex Martelli
MD [EMAIL PROTECTED] wrote: Hi Alex, Thanks for your reply. It was exactly what I was looking for. Two additional questions 1) Is there anyway to find out which modules a variable belongs to when I have only its name (and its not qualified with the complete name like module.varname)

Re: Accessing Python variables in an extension module

2007-07-16 Thread MD
Hi Alex, Thanks for the answer. Are there any C defines (for e.g. STRING, BOOLEAN) corresponding to each Python type? Thanks, -Manas On Jul 16, 9:53 am, [EMAIL PROTECTED] (Alex Martelli) wrote: MD [EMAIL PROTECTED] wrote: Hi Alex, Thanks for your reply. It was exactly what I was

Re: Accessing Python variables in an extension module

2007-07-16 Thread Hrvoje Niksic
MD [EMAIL PROTECTED] writes: 2) Is there anyway to find the type of the object in C using something like a switch statement? I was looking for something like this switch type(object) { STRING: This is a string object; break; INTEGER: This is an integer object;

Re: Accessing Python variables in an extension module

2007-07-16 Thread Alex Martelli
MD [EMAIL PROTECTED] wrote: Hi Alex, Thanks for the answer. Are there any C defines (for e.g. STRING, BOOLEAN) corresponding to each Python type? No, I know of no such defines -- what good would they do? Alex -- http://mail.python.org/mailman/listinfo/python-list

Accessing Python variables in an extension module

2007-07-15 Thread MD
Hi, I would like to access variables defined in my Python program in a C module extension for Python. Is this possible? I looked at the Python C API reference but didn't find anything there that could help me. Thanks in advance for any help/tips. Regards, -MD --

Re: Accessing Python variables in an extension module

2007-07-15 Thread Alex Martelli
MD [EMAIL PROTECTED] wrote: Hi, I would like to access variables defined in my Python program in a C module extension for Python. Is this possible? I looked at the Python C API reference but didn't find anything there that could help me. If they're global variables of a certain module