Re: Embedding Python

2005-06-17 Thread Stefan Seefeld
Sébastien Boisgérault wrote: > Hi, > > Imagine that you have a PyObject pointer 'object' > pointing to a Python integer ... let's say 42. > > How would do you attach the variable "answer" to > it so that the code > > PyRun_SimpleString("print answer"); > > works as expected ? > > My current so

Announcement: Synopsis 0.8

2005-06-09 Thread Stefan Seefeld
I'm pleased to announce the release of Synopsis 0.8. Synopsis is a multi-language source code introspection tool that provides a variety of representations for the parsed code, to enable further processing such as documentation extraction, reverse engineering, and source-to-source translation. W

None module reference

2005-05-21 Thread Stefan Seefeld
hello, I'v run into a bug that I find hard to understand: In a python module of mine I import system modules ('sys', say) and then use them from within some functions. However, during program termination I'm calling one such function and the module reference ('sys') is 'None' ! What does that m

Re: domain specific UI languages

2005-04-13 Thread Stefan Seefeld
max(01)* wrote: hi. in a previous thread, mr lundh talks about the possibility to create "domain specific UI languages" using tkinter. can he (or anyone else who pleases) explain what they are? give some examples (simple is better)? Without having read the original thread, I imagine such a beast

Re: Missing Module when calling 'Import' _omnipy

2005-04-12 Thread Stefan Seefeld
[EMAIL PROTECTED] wrote: I found the fike _omnipy.pyd is that what you mean? yep. Here is my Lib Path: [...] As a first step you may consider adding the directory containing '_omnipy.pyd' to your PYTHONPATH variable. Second, you may read any documentation you can find at http://omniorb.sourceforge.

Re: Missing Module when calling 'Import' _omnipy

2005-04-11 Thread Stefan Seefeld
[EMAIL PROTECTED] wrote: I am trying to run an Corba example using Python and i get the follwing error: import _omnipy ImportError: No module named _omnipy Where can i find this Module ? This is an extension module (i.e. the file is named _omnipy.so or _omnipy.dll, I believe), and it is in the

Re: Problem with import "from omniORB import CORBA, PortableServer"

2005-04-11 Thread Stefan Seefeld
[EMAIL PROTECTED] wrote: Thank for the reply, I think your right my problem is the what version to us, I want to write some Python scripts calling Corba Objects what do i need ? omnipython-1.5.2-1 this looks like *really* old (and obsolete) stuff... omniORBpy 2.5 omniORB 4.0.5 Python 2.4.1 These l

Re: Stylistic question about inheritance

2005-03-31 Thread Stefan Seefeld
Andrew Koenig wrote: Of course, there are reasons to have a base class anyway. For example, I might want it so that type queries such as isinstance(foo, Expr) work. My question is: Are there other reasons to create a base class when I don't really need it right now? Coming from C++ myself, I s

Re: Which is easier? Translating from C++ or from Java...

2005-03-28 Thread Stefan Seefeld
[EMAIL PROTECTED] wrote: Patrick Useldinger wrote: cjl wrote: Implementations of what I'm trying to accomplish are available (open source) in C++ and in Java. Which would be easier for me to use as a reference? I'm not looking for automated tools, just trying to gather opinions on which language i

Re: exec src in {}, {} strangeness

2005-03-21 Thread Stefan Seefeld
Bernhard Herzog wrote: Stefan Seefeld <[EMAIL PROTECTED]> writes: Is there anything wrong with 'exec source in a, b' where a and b are distinc originally empty dictionaries ? Again, my test code was class Foo: pass class Bar: foo = Foo and it appears as if 'Foo'

Re: exec src in {}, {} strangeness

2005-03-21 Thread Stefan Seefeld
Peter Hansen wrote: Stefan Seefeld wrote: Indeed, using 'globals()' and 'locals()' works. However, both report the same underlaying object, which is a bit confusing. (Under what circumstances does 'locals()' return not the same object as 'globals()' ?) W

Re: exec src in {}, {} strangeness

2005-03-21 Thread Stefan Seefeld
Do Re Mi chel La Si Do wrote: Hi ! Try : exec f in globals(),locals() or exec(f,globals(),locals()) or exec f in globals(),globals() or exec(f,globals(),globals()) Indeed, using 'globals()' and 'locals()' works. However, both report the same underlaying object, which is a bit confus

exec src in {}, {} strangeness

2005-03-20 Thread Stefan Seefeld
hi there, I have trouble running some python code with 'exec': t.py contains: class Foo: pass class Bar: f = Foo From a python shell I do: >>> f = ''.join(open('t.py').readlines()) >>> exec f in {}, {} Traceback (most recent call last): File "", line 1, in ? File "", line 2, in ? File "",

Re: lies about OOP

2004-12-13 Thread Stefan Seefeld
Craig Ringer wrote: On Tue, 2004-12-14 at 16:02, Mike Thompson wrote: I would pick the publication of "Design Patterns" in 1995 by the Gang of Four (Gamma, Helm, Johnson, and Vlissides), to be the herald of when "the Joy of OOP" would be "widely known." DP formalized a taxonomy for many of the h