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
[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
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
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
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
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
[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.
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
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
[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
"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
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
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
[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
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
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','
[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
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
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
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
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
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
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 )
>
>> 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__
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
[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
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
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
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
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
"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
[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
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
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-
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
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
[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
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
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
Thank you kindly, Erik.
malv
--
http://mail.python.org/mailman/listinfo/python-list
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
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
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
101 - 143 of 143 matches
Mail list logo