Re: ANN: Dao Language v.0.9.6-beta is release!

2005-12-08 Thread Steven D'Aprano
On Thu, 08 Dec 2005 08:23:52 +, Antoon Pardon wrote: > Op 2005-12-07, Steven D'Aprano schreef <[EMAIL PROTECTED]>: >> On Wed, 07 Dec 2005 15:26:59 +, Zeljko Vrba wrote: >> >>> Braces are very convenient to match block start and end. Open a C program >>> in the VI editor, and press % in com

Re: Dynamically add Class to Modules

2005-12-08 Thread Michael Spencer
[EMAIL PROTECTED] wrote: > I'm trying to add a class to a module at runtime. I've seen examples > of adding a method to a class, but I haven't been able to suit it to my > needs. > > As part of a testsuite, I have a main process X that searches > recursively for python test files. Those files ty

Moving a package in cygwin

2005-12-08 Thread 63q2o4i02
Hi, I'm using python 2.4 and windows XP. I have two packages in the windows version of python in site-packages. They are PyVisa and ctypes, and both live in c:\python24\lib\site-packages I'd like to move these to the cygwin version of python on the same system. I tried copying the PyVisa and ct

Re: Unexpected behavior of read only attributes and super

2005-12-08 Thread Steven Bethard
Samuel M. Smith wrote: > If you would care to elaborate on the how the lookup differs with > method descriptor it would be most appreciated. For the more authoritative guide, see: http://users.rcn.com/python/download/Descriptor.htm The basic idea is that a descriptor is an object that sits

Re: Encoding of file names

2005-12-08 Thread Martin v. Löwis
utabintarbo wrote: > Fredrik, you are a God! Thank You^3. I am unworthy > > I believe that may do the trick. Here is the results of running your > code: For all those who followed this thread, here is some more explanation: Apparently, utabintarbo managed to get U+2592 (MEDIUM SHADE, a filled 5

Re: Another newbie question

2005-12-08 Thread Kent Johnson
Steven D'Aprano wrote: > On Wed, 07 Dec 2005 23:58:02 -0500, Mike Meyer wrote: >>>1) The stmt "board.Blist[10].DrawQueen(board.Blist[10].b1)" seems >>>awkward. Is there another way (cleaner, more intuitive) to get the >>>same thing done? >> >>Yes. Reaching through objects to do things is usually a

Re: Dynamically add Class to Modules

2005-12-08 Thread Mike Meyer
[EMAIL PROTECTED] writes: > So: Does anyone know how dynamically generate a class, and add it to a > "module" that is already in memory? How about adding a step: generate your class to a file import the file as a module. bind a name in "module" to the class in the imported module.

Re: Another newbie question

2005-12-08 Thread Mike Meyer
Steven D'Aprano <[EMAIL PROTECTED]> writes: > On Wed, 07 Dec 2005 23:58:02 -0500, Mike Meyer wrote: >> "solaris_1234" <[EMAIL PROTECTED]> writes: >>> 1) The stmt "board.Blist[10].DrawQueen(board.Blist[10].b1)" seems >>> awkward. Is there another way (cleaner, more intuitive) to get the >>> same th

Re: Another newbie question

2005-12-08 Thread Paul Rubin
Steven D'Aprano <[EMAIL PROTECTED]> writes: > > Yes. Reaching through objects to do things is usually a bad idea. > I don't necessarily disagree, but I don't understand why you say this. Why > it is bad? The traditional OOP spirit is to encapsulate the object's entire behavior in the class defini

hp-ux crash: threading within a c++ module.

2005-12-08 Thread [EMAIL PROTECTED]
[also sent to [EMAIL PROTECTED] Hi Python Experts, I am developing a Python interface to an existing (multithreaded) c++ api. I have it working on several platforms (linux, solaris, irix, windoze) but I am having a few problems with threading on hp-ux and aix platforms. Here is one of the prob

Re: Documentation suggestions

2005-12-08 Thread Mike Meyer
"BartlebyScrivener" <[EMAIL PROTECTED]> writes: > Too bad there > isn't something like what Ruby does with the "Try Ruby In Your Browser" > thing, which is a very effective marketing tool (although obviously I > chose Python). > > http://tryruby.hobix.com/ I've seen things like this for other lang

Re: Python-list Digest, Vol 27, Issue 123

2005-12-08 Thread Michael Williams
Thanks, Heiko, I'll give this a try.  In the meantime, I'll try to explain what exactly I mean.Basically, I want the ability to reference a variable just as I am able to set a variable (or attribute) on the fly.  For instance, say the user has the following list in a text file: [butter, cream, eggs

Re: Documentation suggestions

2005-12-08 Thread Aahz
In article <[EMAIL PROTECTED]>, Mike Meyer <[EMAIL PROTECTED]> wrote: >"BartlebyScrivener" <[EMAIL PROTECTED]> writes: >> >> Too bad there >> isn't something like what Ruby does with the "Try Ruby In Your Browser" >> thing, which is a very effective marketing tool (although obviously I >> chose Py

Re: Another newbie question

2005-12-08 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : > > I'm off to study the code. (Hmm.. how does python parse ("green", > "red")[(i * 8 + j) % 2] command ... ("green", "red")[0] == "green" ("green", "red")[1] == "red" (i * 8 + j) is somewhat trivial (just take care of precedence order), and will return an integer

Re: Another newbie question

2005-12-08 Thread Steven D'Aprano
Paul Rubin wrote: > Steven D'Aprano <[EMAIL PROTECTED]> writes: > >>>Yes. Reaching through objects to do things is usually a bad idea. >> >>I don't necessarily disagree, but I don't understand why you say this. Why >>it is bad? > > > The traditional OOP spirit is to encapsulate the object's en

subset permutations

2005-12-08 Thread me you
Hello all,   I'm a beginner with programming. Trying to teach myself with that excellent rat book. Unfortunately I just can't seem to figure out a simple problem that has come up at my work (biology lab): let's say I have a list ['A','C','D','E','F','G','H','I','K','L','M','N','P','Q','R','S','T','

Re: Documentation suggestions

2005-12-08 Thread Trent Mick
[Mike Meyer wrote] > "BartlebyScrivener" <[EMAIL PROTECTED]> writes: > > Too bad there > > isn't something like what Ruby does with the "Try Ruby In Your Browser" > > thing, which is a very effective marketing tool (although obviously I > > chose Python). > > > > http://tryruby.hobix.com/ > > I've

Re: Documentation suggestions

2005-12-08 Thread skip
Mike> The question is how do you keep the system that the Python code is Mike> actually running on safe? Ruby may have a real bastion mode, but Mike> Python doesn't. User Mode Linux? chroot? Skip -- http://mail.python.org/mailman/listinfo/python-list

Re: Dynamically add Class to Modules

2005-12-08 Thread callmebill
Hi Michael... It didn't seem to take. Here is some of the actual code: [[ from the runner ] print "+++" print "::Dir before exec:",dir(testModule) import CodeGenBase

Re: hi i have some doubts on a volume and the file system

2005-12-08 Thread muttu2244
Hi Tim, Thanks for that help, that code is indeed working fine thanks a ton for that regards yogi Tim Golden wrote: > [EMAIL PROTECTED] > > > i want to check the position of a volume in a particular > > drive. say for example in a disk i have 3 different drives: > > C:\ , D:\ and E:\. > > Now

Re: Documentation suggestions

2005-12-08 Thread skip
Trent> Nah, the Try Ruby thing is mostly faking it (I believe) rather Trent> than running an actually Ruby interactive session ("bastion'ed" Trent> or not). I don't think so. I tried typing some stuff at the prompt that it wasn't asking for, like "x = [1,2,3]" followed by "x * 5" whe

installer question

2005-12-08 Thread Guy Robinson
Target audience is little or no programming experience. I have a win32 only library I need to write an installer for. As part of the installation it must: 1.. find where a program is installed 2.. copy a file to the directory 3.. add the directory to the pythonpath and change a ini file. 4.. add

Re: Dynamically add Class to Modules

2005-12-08 Thread callmebill
Oh! I see what I missed. I didn't supply the namespace into which the new class was going to be added (correct that statement, please, if it is incorrect). So by using this slight modification, thinks seemed to work: exec testModule.TheTestCode %(testModule.TheTestName, testModule.TheTestName )

Re: Unexpected behavior of read only attributes and super

2005-12-08 Thread Samuel M. Smith
> >> Then why wasn't __class__ added to c.__dict__ ? Looks like namespace >> searching to me. > > No, as you conclude later, __class__ is special, so you can still > assign > to __class__ even when __slots__ is defined because it's not > considered > a normal attribute. But note that __class__

Re: Documentation suggestions

2005-12-08 Thread Terry Hancock
On Thu, 08 Dec 2005 18:43:56 -0500 Mike Meyer <[EMAIL PROTECTED]> wrote: > "BartlebyScrivener" <[EMAIL PROTECTED]> writes: > > Too bad there > > isn't something like what Ruby does with the "Try Ruby > > In Your Browser" thing, which is a very effective > > marketing tool (although obviously I cho

Re: Dynamically add Class to Modules

2005-12-08 Thread Michael Spencer
[EMAIL PROTECTED] wrote: ... > exec testModule.TheTestCode %(testModule.TheTestName, testModule.TheTestName ) ... Try changing that to exec ~ in testModule.__dict__ otherwise, your class statement gets executed in the current scope Michael -- http://mail.python.org/mailman/listinfo/python-lis

Using printf in a C Extension

2005-12-08 Thread user
Hi, I am extending python with C and trying to debug with printf. The code below succssfully returns the string "hello" when compiled and called, but the "can print from in here phrase" does not reach python stdout. Is there something screwy with my environment or is there some trick to thi

Re: Another newbie question

2005-12-08 Thread Mike Meyer
Steven D'Aprano <[EMAIL PROTECTED]> writes: > Paul Rubin wrote: >> Steven D'Aprano <[EMAIL PROTECTED]> writes: Yes. Reaching through objects to do things is usually a bad idea. >>>I don't necessarily disagree, but I don't understand why you say this. Why >>>it is bad? >> The traditional OOP sp

Re: subset permutations

2005-12-08 Thread Jay Parlar
On Dec 8, 2005, at 5:29 PM, [EMAIL PROTECTED] wrote: > > Hello all, >   > I'm a beginner with programming. Trying to teach myself with that > excellent rat book. Unfortunately I just can't seem to figure out a > simple problem that has come up at my work (biology lab): > let's say I have a lis

small inconsistency in ElementTree (1.2.6)

2005-12-08 Thread Damjan
Attached is the smallest test case, that shows that ElementTree returns a string object if the text in the tree is only ascii, but returns a unicode object otherwise. This would make sense if the sting object and unicode object were interchangeable... but they are not - one example, the translate

Re: Dr. Dobb's Python-URL! - weekly Python news and links (Dec 7)

2005-12-08 Thread David Isaac
"Cameron Laird" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Jibes against the lambda-clingers lead eventually to serious > questions of style in regard to variable namespacing, > lifespan, cleanup, and so on: > http://groups.google.com/group/comp.lang.python/browse_th

Re: Using printf in a C Extension

2005-12-08 Thread Scott David Daniels
[EMAIL PROTECTED] wrote: > I am extending python with C and trying to debug with printf. The code > below succssfully returns the string "hello" when compiled and called, > but the "can print from in here phrase" does not reach python stdout. Is > there something screwy with my environment or

Re: Another newbie question

2005-12-08 Thread Alex Martelli
Mike Meyer <[EMAIL PROTECTED]> wrote: > My standard object interface is modeled after Meyer's presentation in > OOSC: an objects state is manipulated with methods and examined with > attributes; manipulating attributes doesn't change the internal state > of the object. This makes it possible to ch

Re: subset permutations

2005-12-08 Thread Rick Wotnaz
Jay Parlar <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > http://www.bigbold.com/snippets/posts/show/753 A string is also iterable, so whether s is the string (as shown) or list('ACDEFGHIKLMNPQRSTVWY'), as you have it above, this should generate the 16 permutations, as a list of 4-

Re: Documentation suggestions

2005-12-08 Thread BartlebyScrivener
You guys are all wizards from mars. If it's easy to do I can tell you that it would very seductive to a prospective Pythoner, and you avoid the problem of making them download before they can try out a tutorial. Thanks for looking at it. rd -- http://mail.python.org/mailman/listinfo/python-list

Re: ANN: pygene - genetic algorithms package

2005-12-08 Thread Erik Max Francis
malv wrote: > How is your package different from a nn package? Is this an addon for > genetic programming or does it include the standard nn components as > well, such as backprop etc? > Not being very familiar with genetic programming, forgive me my naive > question, I could not immediately find

Re: Another newbie question

2005-12-08 Thread Mike Meyer
[EMAIL PROTECTED] (Alex Martelli) writes: > Mike Meyer <[EMAIL PROTECTED]> wrote: >> My standard object interface is modeled after Meyer's presentation in >> OOSC: an objects state is manipulated with methods and examined with >> attributes; manipulating attributes doesn't change the internal state

Re: subset permutations

2005-12-08 Thread Ben Finney
Jay Parlar <[EMAIL PROTECTED]> wrote: > For instance, say you have the list ['A','B',C','D'], and you want > all possible TWO letter permutations. $ dict permutation From The Collaborative International Dictionary of English v.0.48 [gcide]: Permutation \Per`mu*ta"tion\ (p[~e]r`m[-u

Re: sql escaping module - Frank Millman Followup

2005-12-08 Thread Frank Millman
David Bear wrote: > > The statement above can cause relief or pain. Letting the DBAPI handle > proper string escapes, formating, etc., is a big relief. However, I am > still wondering what happens under the covers. If I have a string '1\n' > that I've read from some source and I really intend on i

Re: ANN: pygene - genetic algorithms package

2005-12-08 Thread malv
Thank you kindly, Erik. malv -- http://mail.python.org/mailman/listinfo/python-list

Re: ANN: pygene - genetic algorithms package

2005-12-08 Thread Erik Max Francis
malv wrote: > Thank you kindly, Erik. Sure thing. -- Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/ San Jose, CA, USA && 37 20 N 121 53 W && AIM erikmaxfrancis It is only the poor who are forbidden to beg. -- Anatole France -- http://mail.python.org/mailman/listinfo

Re: small inconsistency in ElementTree (1.2.6)

2005-12-08 Thread Fredrik Lundh
Damjan wrote: > Attached is the smallest test case, that shows that ElementTree returns > a string object if the text in the tree is only ascii, but returns a unicode > object otherwise. > > This would make sense if the sting object and unicode object were > interchangeable... but they are not - o

Re: Python-list Digest, Vol 27, Issue 123

2005-12-08 Thread Fredrik Lundh
Michael Williams wrote: > Thanks, Heiko, I'll give this a try. In the meantime, I'll try to > explain what exactly I mean. > > Basically, I want the ability to reference a variable just as I am > able to set a variable (or attribute) on the fly. For instance, say > the user has the following lis

<    1   2