Roger L. Cauvin wrote:
Good suggestion. Here are some test cases:
xyz123aaabbab accept
xyz123aabbaab reject
xayz123aaabab accept
xaaayz123abab reject
xaaayz123aaabab accept
$ more test.py
import re
print gotexpected
print --
testsuite = (
(xyz123aaabbab, accept),
I think I find what I need:
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/355319
Bo
--
http://mail.python.org/mailman/listinfo/python-list
Dear list,
This may sound strange but I need to start a python shell from python.
The motivation is that I have a bunch of (numeric) python functions to
provide to a user. The best way I can think of is packing my python
module using py2exe, and because it is easiest to let him run the
Farshid Lashkari [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
The problem is that PyObject_CallObject always returns NULL. Is this the
correct return value for simply executing a script, as there is no
function
return value involved?
The documentation for PyObject_CallObject
On Thu, 26 Jan 2006 16:26:57 GMT in comp.lang.python, Roger L.
Cauvin [EMAIL PROTECTED] wrote:
Christos Georgiou [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
[...]
Is this what you mean?
^[^a]*(a{3})(?:[^a].*)?$
Close, but the pattern should allow arbitrary sequence of
On Thu, 19 Jan 2006 10:47:35 GMT, rumours say that Giovanni Bajo
[EMAIL PROTECTED] might have written:
I have a generic solution for this (never submitted to the cookbook... should
I?)
This is by Andrew Durdin:
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/303439
This is by me:
Alex Martelli a écrit :
Fredrik Lundh [EMAIL PROTECTED] wrote:
...
the obvious solution is
item = list(s)[0]
but that seems to be nearly twice as slow as [x for x in s][0]
under 2.4. hmm.
Funny, and true on my laptop too:
helen:~ alex$ python -mtimeit -s's=set([23])'
Fredrik Lundh [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Roger L. Cauvin wrote:
Good suggestion. Here are some test cases:
xyz123aaabbab accept
xyz123aabbaab reject
xayz123aaabab accept
xaaayz123abab reject
xaaayz123aaabab accept
$ more test.py
import re
print got
On Thu, 26 Jan 2006 18:01:07 +0100, rumours say that Fredrik Lundh
[EMAIL PROTECTED] might have written:
Roger L. Cauvin wrote:
Good suggestion. Here are some test cases:
xyz123aaabbab accept
xyz123aabbaab reject
xayz123aaabab accept
xaaayz123abab reject
xaaayz123aaabab accept
$ more
Christos Georgiou [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
On Thu, 26 Jan 2006 16:41:08 GMT, rumours say that Roger L. Cauvin
[EMAIL PROTECTED] might have written:
Good suggestion. Here are some test cases:
xyz123aaabbab accept
xyz123aabbaab reject
xayz123aaabab accept
Christos Georgiou [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
On Thu, 26 Jan 2006 16:26:57 GMT, rumours say that Roger L. Cauvin
[EMAIL PROTECTED] might have written:
Christos Georgiou [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
On Thu, 26 Jan 2006 14:09:54 GMT,
Steve Holden [EMAIL PROTECTED] writes:
Well you are just as capable ...
Yes, I guess you are right. Done.
Couldn't find how to suggest an addition to the Python Cookbook (other
than some generic O'Reilly email), so I've put a submission to:
http://aspn.activestate.com/ASPN/Cookbook/Python/
--
On Thu, 26 Jan 2006 17:09:18 GMT, rumours say that Roger L. Cauvin
[EMAIL PROTECTED] might have written:
Thanks, but the second test case I listed contained a typo. It should have
contained a sequence of three of the letter 'a'. The test cases should be:
xyz123aaabbab accept
xyz123aabbaaab
Bo Peng a écrit :
Travis E. Oliphant wrote:
On Linux you can use oprofile (which is pretty nice and easy to use
--- no recompiling. Just start the profiler, run your code, and stop
the profiler).
Thank you very much for the tip. This is a great tool.
The source of the problem has
In an article about the Royal Bank of Scotland working with Zope there
is this quote from Gary Barnett, a research director at analyst firm
Ovum:
A lot of banks are using applications like Apache and Perl, but
it's interesting to see they're using Python and Zope as it's
moderately hardcore
Christos Georgiou [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
On Thu, 26 Jan 2006 18:01:07 +0100, rumours say that Fredrik Lundh
[EMAIL PROTECTED] might have written:
Roger L. Cauvin wrote:
Good suggestion. Here are some test cases:
xyz123aaabbab accept
xyz123aabbaab reject
Roger L. Cauvin wrote:
$ python test.py
gotexpected
---
accept accept
reject reject
accept accept
reject reject
accept accept
Thanks, but the second test case I listed contained a typo. It should have
contained a sequence of three of the letter 'a'. The test
Christos Georgiou [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
On Thu, 26 Jan 2006 17:09:18 GMT, rumours say that Roger L. Cauvin
[EMAIL PROTECTED] might have written:
Thanks, but the second test case I listed contained a typo. It should
have
contained a sequence of three of the
when POSTing a date from an mod_python psp page to another the date is
sent as a string. I'm using form.has_key to pull the POST. I can cut
the string up,turn the strings into integers and then use
datetime.datetime(y,m,d,hr,mn,se) to create a proper datetime. Is
there a simpler way of doing
Magnus Lycka informs:
[in response to my comment]:
I see how I missed this. Neither disable_.. or enable_.. have document
strings. And neither seem to described in the optparser section (6.21)
of the Python Library (http://docs.python.org/lib/module-optparse.html).
gregarican wrote:
I have a Python UDP listener socket that waits for incoming data. The
socket runs as an endless loop. I would like to pop the incoming data
into an existing Tkinter app that I have created. What's the
easiest/most efficient way of handling this? Would I create a separate
Fredrik Lundh [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Roger L. Cauvin wrote:
$ python test.py
gotexpected
---
accept accept
reject reject
accept accept
reject reject
accept accept
Thanks, but the second test case I listed contained a typo. It
On 1/26/06, Terry Hancock [EMAIL PROTECTED] wrote:
On Thu, 26 Jan 2006 01:12:10 -0600
Runsun Pan [EMAIL PROTECTED] wrote:
Error) in python. I'd love to see if I can use han char
for all those keywords like import, but it doesn't work.
Yeah, I'm pretty sure we're talking about the future
On 26 Jan 2006 08:46:11 -0800, gregarican [EMAIL PROTECTED] wrote:
I have a Python UDP listener socket that waits for incoming data. The
socket runs as an endless loop. I would like to pop the incoming data
into an existing Tkinter app that I have created. What's the
easiest/most efficient way of
I have a dll that contains all kinds of services (input, audio, video,
etc..), and I would like to export these to Python as separate modules.
Now, if I call Py_InitModule with a name that's different than the dll
name, I get an error. So what can I do?
Thanks,
Andras
--
I've been working on an external C module for Python in order to use
some of the functionality from Ethereal. Right now I'm getting
segfaults originating from within the Ethereal source code, but the
same code works fine when used normally (i.e. through Ethereal or
Tethereal). I'm wondering if
The below seems to pass all the tests you threw at it (taking the
modified 2nd test into consideration)
One other test that occurs to me would be
xyz123aaabbaaabab
where you have aaab in there twice.
-tkc
import re
tests = [
(xyz123aaabbab,True),
(xyz123aabbaaab, False),
Hi all,
I've read some thread about isinstance(), why it is considered harmful
and how you can achieve the same results using a coding style that
doesn't break polymorphism etc... Since I'm trying to improve my Python
knowledge, and I'm going to design a class hierarchy from scratch, I'd
like to
On 2006-01-26, Steve Holden [EMAIL PROTECTED] wrote:
gregarican wrote:
I have a Python UDP listener socket that waits for incoming data. The
socket runs as an endless loop. I would like to pop the incoming data
into an existing Tkinter app that I have created. What's the
easiest/most
How does
http://beta.python.org/about/beginners/
look?
regards
Steve
--
Steve Holden +44 150 684 7255 +1 800 494 3119
Holden Web LLC www.holdenweb.com
PyCon TX 2006 www.python.org/pycon/
--
http://mail.python.org/mailman/listinfo/python-list
On Thu, 26 Jan 2006, Pete Forman wrote:
In an article about the Royal Bank of Scotland working with Zope there
is this quote from Gary Barnett, a research director at analyst firm
Ovum:
A lot of banks are using applications like Apache and Perl, but
it's interesting to see they're using
Farshid Lashkari [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
The problem is that PyObject_CallObject always returns NULL. Is this the
correct return value for simply executing a script, as there is no
function
return value involved?
The documentation for PyObject_CallObject
[EMAIL PROTECTED] wrote:
I've been working on an external C module for Python in order to use
some of the functionality from Ethereal. Right now I'm getting
segfaults originating from within the Ethereal source code, but the
same code works fine when used normally (i.e. through Ethereal or
Mr.Rech:
Now, avoiding isinstace() I've written the following code:
class foo(object):
...
def __eq__(self, other):
try:
return self.an_attribute == other.an_attribute
except AttributeError:
return False
This may give unexpected results when you compare a foo
Hi there,
I want to ask how to use Fit and Fitnesse together to use testcases
programmed in Jython. Resently I discussed with John Roth how PyFit
would have to be changed to work together with Jython. This seems to be
a lot of work and comes maybee with version 0.9 in mid 2006 if at all.
I think
Grant Edwards wrote:
Unless tk.createfilehandler isn't supported no Wni32
platforms??
Unfortunately that's the case. As of Python 2.3.4 under Windows XP the
createfilehandler method isn't available. It's only for UNIX as Mac
platforms AFAIK. Shame, as it would be relatively easy to implement.
Roger L. Cauvin wrote:
Fredrik Lundh [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Roger L. Cauvin wrote:
$ python test.py
gotexpected
---
accept accept
reject reject
accept accept
reject reject
accept accept
Thanks, but the second test case I listed
I have a dll that contains all kinds of services (input, audio, video,
etc..), and I would like to export these to Python as separate modules.
Now, if I call Py_InitModule with a name that's different than the dll
name, I get an error. So what can I do?
I believe you can export different
I am not a design professional but since you didn't ask for
professionals but for beginners ;-) ...
- At the left hand side you used abbreviations (like PSF). Using the
full name says more about the option.
- I don't like capitals alot either (as used in the menu).
- The corporate look of the
Mmm... I've not considered such an event... Would you say it is one of
those rare case in which isinstance() can be used? Any other
suggestion?
Thanks,
Andrea
--
http://mail.python.org/mailman/listinfo/python-list
On Thu, 26 Jan 2006, Mr.Rech wrote:
I've read some thread about isinstance(), why it is considered harmful
and how you can achieve the same results using a coding style that
doesn't break polymorphism etc... Since I'm trying to improve my Python
knowledge, and I'm going to design a class
Bo Peng wrote:
I think I find what I need:
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/355319
That's a nice, lightweight one. Note that if you want to have all the bells
and whistles of ipython (and you have ipython already), then a simple
if __name__ == '__namin__':
from
The project I'm working on is written mainly C/C++, spiced with some
Python scripts. Now, I have several dlls, which work both as a Python
extension modules, exporting functions to Python via initmodule, and
as normal dynamic libraries, to which I link dynamically from within my
C program.
This worked, thanks!
Farshid Lashkari wrote:
I believe you can export different modules from one dll, but you *MUST*
at least export a module that has the same name as the dll.
--
http://mail.python.org/mailman/listinfo/python-list
Michael Spencer [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Roger L. Cauvin wrote:
xyz123aaabbab accept
xyz123aabbaaab reject
xayz123aaabab accept
xaaayz123abab reject
xaaayz123aaabab accept
This passes your tests. I haven't closely followed the thread for other
Tim Chase [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
The below seems to pass all the tests you threw at it (taking the modified
2nd test into consideration)
One other test that occurs to me would be
xyz123aaabbaaabab
where you have aaab in there twice.
Good suggestion.
xyz123aaabbaaabab
where you have aaab in there twice.
Good suggestion.
I assumed that this would be a valid case. If not, the
expression would need tweaking.
^([^b]|((?!a)b))*aaab+[ab]*$
Looks good, although I've been unable to find a good
explanation of the negative lookbehind
def extract(text,s1,s2):
''' Extract strings wrapped between s1 and s2.
t=this is a spantest/span for spanextract()/span
that spandoes multiple extract/span
extract(t,'span','/span')
['test', 'extract()', 'does multiple extract']
'''
Dave Benjamin wrote:
On Thu, 26 Jan 2006, Mr.Rech wrote:
Suppose I'm writing a base class with an __eq__ special methods, using
isinstance() I would have wrote:
class foo(object):
...
def __eq__(self, other):
return isinstance(other, type(self)) and self.an_attribute ==
yawgmoth7 wrote:
Hello, I am currently writing a script that requires a few different
files to be opened, and examined. What I need to be able to do is use
something like:
filelist = os.system(ls)
Some way to open the file list and read each file one by one here
I cannot think of a way
Ken Starks wrote:
yawgmoth7 wrote:
Hello, I am currently writing a script that requires a few different
files to be opened, and examined. What I need to be able to do is use
something like:
filelist = os.system(ls)
Some way to open the file list and read each file one by one here
I have made one confirmation. The only identifiable difference that I
have seen is that one runs on python 2.4.2, and the other 2.4.1. Oddly
enough, it's the first one that's the one that is having more problems
than the second... Why that is, I don't know. It still could be
something else, but...
Steve Holden wrote:
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/82965
Thanks. I tried a variation of this Queue posting/Flag checking method
and it worked to a tee. The problem was that my UDP socket query was
blocking things so that thread was hanging everything up. So I used a
Carl J. Van Arsdall wrote:
os.walk is your friend. Its has wonderful functionality.
Don't you mean os.path.walk ?
os.walk is a generator-based version of os.path.walk. instead of putting
the logic in a callback function, you put it in a for loop:
for root, dirs, files in os.walk(top):
Steve Holden schrieb:
How does
http://beta.python.org/about/beginners/
look?
I like it :) Some minor points:
- The logo does indeed resemble a cross. How about rotating it at 45 deg
to make it look like an x? Or give it a circular shape? Please note
that there are no religious
Steve Holden schreef:
How does
http://beta.python.org/about/beginners/
look?
I think it's OK, apart from the fact that the font size of the text
overrides my browser's default. It looks and reads much better without
the font-size: 75%.
--
If I have been able to see further, it was
On Thu, 26 Jan 2006, Rocco Moretti wrote:
You were better off with what you had before. Equality in this case is left
completely open-ended, and as a result, there is no way that you can
guarantee that a == b is the same as b == a if a is a foo and b
is of unknown type. This can lead to
On Thu, 26 Jan 2006, Dave Benjamin wrote:
On Thu, 26 Jan 2006, Rocco Moretti wrote:
You were better off with what you had before. Equality in this case is
left completely open-ended, and as a result, there is no way that you can
guarantee that a == b is the same as b == a if a is a foo and
I find it much better than the current site, thank you!
Whilst reading, http://beta.python.org/about/ I had some slight
niggles.
What do you think about the following changes?
About Python
Python is an agile programming language often compared to Tcl, Perl,
Ruby, Scheme or Java. While it has
All in all it seems that the implementation that uses isinstance() is
better in this case...
Thanks for your comments,
Andrea.
--
http://mail.python.org/mailman/listinfo/python-list
- The logo does indeed resemble a cross. How about rotating it at
45 deg
to make it look like an x? Or give it a circular shape? Please note
that there are no religious motives in this remark :)
-1. Then what are the motives? A rotated cross looks a lot less
clean. Take a look at
Paul McGuire [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
I have some places in pyparsing where I've found that the most
straightforward way to adjust an instance's behavior is to change its
class.
I do this by assigning to self.__class__, and things all work fine.
(Converting
Hello again,
I am now trying to make something to change some encrypted text into
some plain text, here is the code I have so far:
text = '@[EMAIL PROTECTED]@[EMAIL PROTECTED]' // some text
num = '213654' // Number
s1 = '700'
s2 = '770'
s4 = '707' // it adds these later on.
t = text.split('@')
Roger L. Cauvin wrote:
Michael Spencer [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Roger L. Cauvin wrote:
xyz123aaabbab accept
xyz123aabbaaab reject
xayz123aaabab accept
xaaayz123abab reject
xaaayz123aaabab accept
This passes your tests. I haven't closely followed the thread
I have an executable (e.g. myprog.exe) which takes some set number of
arguments.
This command works ok:
os.system(rc:\tmp\myprog.exe arg1 arg2 arg3)
The problem is that the path to the program and the arguments are
variable at runtime so I need to pass them as arguments.
Thanks
--
lblr33 wrote:
I have an executable (e.g. myprog.exe) which takes some set number of
arguments.
This command works ok:
os.system(rc:\tmp\myprog.exe arg1 arg2 arg3)
The problem is that the path to the program and the arguments are
variable at runtime so I need to pass them as arguments.
Danny wrote:
Hello again,
I am now trying to make something to change some encrypted text into
some plain text, here is the code I have so far:
text = '@[EMAIL PROTECTED]@[EMAIL PROTECTED]' // some text
num = '213654' // Number
s1 = '700'
s2 = '770'
s4 = '707' // it adds these later
Hello again - rather a newbie here...
I want to work on a sudoku brute-forcer, just for fun.
I am considering different strategies, but first I need to decide on the
data-structure to use for the progress/solution grid.
This being a square, I would have used a 9x9 2-dimensional array in my
lblr33 wrote:
I have an executable (e.g. myprog.exe) which takes some set number of
arguments.
This command works ok:
os.system(rc:\tmp\myprog.exe arg1 arg2 arg3)
The problem is that the path to the program and the arguments are
variable at runtime so I need to pass them as arguments.
anthonyberet wrote:
Hello again - rather a newbie here...
I want to work on a sudoku brute-forcer, just for fun.
I am considering different strategies, but first I need to decide on the
data-structure to use for the progress/solution grid.
This being a square, I would have used a 9x9
Ok there's a couple things going on here.
t = text.split('@') // splits the digits/blocks apart from each other
this will give you a list:
['', '7706', '7002', '7075', '7704']
You may want to change the line to skip the first empty value:
t = text.split('@')[1:]
Next your loop.
something = 1
anthonyberet wrote:
Hello again - rather a newbie here...
I want to work on a sudoku brute-forcer, just for fun.
I know what you mean. I wrote one just for fun too.
I am considering different strategies, but first I need to decide on the
data-structure to use for the progress/solution
anthonyberet wrote:
Hello again - rather a newbie here...
I want to work on a sudoku brute-forcer, just for fun.
I am considering different strategies, but first I need to decide on the
data-structure to use for the progress/solution grid.
This being a square, I would have used a 9x9
I want to work on a sudoku brute-forcer, just for fun.
Well, as everybody seems to be doing these (self included...),
the sudoku solver may become the hello world of the new world :)
What is the equivalent way to store data in python? - It isn't obvious
to me how to do it with lists.
R. Bernstein wrote:
Magnus Lycka informs:
[in response to my comment]:
I see how I missed this. Neither disable_.. or enable_.. have document
strings. And neither seem to described in the optparser section (6.21)
of the Python Library (http://docs.python.org/lib/module-optparse.html).
Tony Meyer schrieb:
- The logo does indeed resemble a cross. How about rotating it at 45 deg
to make it look like an x? Or give it a circular shape? Please note
that there are no religious motives in this remark :)
-1. Then what are the motives?
I don't like the shape. Snakes and
Fuzzyman [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Simon Brunning wrote:
On 1/24/06, Cyril Bazin [EMAIL PROTECTED] wrote:
Does someone ever tried (and succeed) to make an address like
www.website.py.
I found that the .py extension is given to the paraguay.
I found
Peter Maas wrote:
- The logo does indeed resemble a cross. How about rotating it at 45 deg
to make it look like an x? Or give it a circular shape? Please note
that there are no religious motives in this remark :)
It looks like a plus sign to me. Do you also advocate renaming C++ to
Cxx
anthonyberet wrote:
Hello again - rather a newbie here...
I want to work on a sudoku brute-forcer, just for fun.
I am considering different strategies, but first I need to decide on the
data-structure to use for the progress/solution grid.
This being a square, I would have used a 9x9
Sorry if this is a FAQ but Google returns a *lot* of results for Python
Logging :-)
I am looking for a tool that will automatically add logging to existing
code e.g. Function Entries and Exits, Return values etc.
Thanks,
Davy Mitchell
Mood News
- BBC News Headlines Auto-Classified as Good,
Peter Hansen [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Roger L. Cauvin wrote:
Michael Spencer [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Roger L. Cauvin wrote:
xyz123aaabbab accept
xyz123aabbaaab reject
xayz123aaabab accept
xaaayz123abab reject
xaaayz123aaabab
I would like to execute a windows program from python and wait for it
to finish before returning to the python script.
The script I want to run has a set number of arguments.
The following does work fine:
os.system(rc:\tmp\myprog.exe arg1 arg2 arg3)
The problem I have is that the path to
I would like to connect to an Oracle database. In python version 2.1 I
used the following code and it worked fine. When I run the code in
version 2.4 it says that the odbc moduled does not exist. How do you
connect to an Oracle database in v2.4?
oradb=odbc.odbc('oracle/scott/tiger')
I posted this earlier on yahoo groups and then realized that the most
recent post was 2003. What I didn't realize is that it posted to this
group so I posted it again.
The other post is:
In [EMAIL PROTECTED], Tuvas wrote:
The modified version of my code is now as follows: (Note, a few small
changes have been made to simplify things, however, these things don't
apply to a full-scale picture, so the shouldn't slow anything down in
the slightest.)
def
On Thu, 26 Jan 2006 19:04:13 +0100, Rene Pijlman wrote:
Mr.Rech:
Now, avoiding isinstace() I've written the following code:
class foo(object):
...
def __eq__(self, other):
try:
return self.an_attribute == other.an_attribute
except AttributeError:
return False
Fredrik Lundh wrote:
[EMAIL PROTECTED] wrote:
I've been working on an external C module for Python in order to use
some of the functionality from Ethereal. Right now I'm getting
segfaults originating from within the Ethereal source code, but the
same code works fine when used normally
Mr.Rech wrote:
All in all it seems that the implementation that uses isinstance() is
better in this case...
Well what's better depends on what you want to happen when you compare
an unrelated class that also defines 'an_attribute'. Unlike in
statically typed languages, certain things are made
Peter Maas wrote:
Tony Meyer schrieb:
- The logo does indeed resemble a cross. How about rotating it at 45 deg
to make it look like an x? Or give it a circular shape? Please note
that there are no religious motives in this remark :)
-1. Then what are the motives?
I don't like
Paddy wrote:
I find it much better than the current site, thank you!
Whilst reading, http://beta.python.org/about/ I had some slight
niggles.
What do you think about the following changes?
About Python
Python is an agile programming language often compared to Tcl, Perl,
Ruby, Scheme
Rocco Moretti wrote:
(Not that I like the logo, mind you...)
Does anyone? There has to be a better logo! I thought the previous
requirement as established by the BDFL was no snakes. These are snakes,
and they have no personality to boot.
--
http://mail.python.org/mailman/listinfo/python-list
Claudio Grondi wrote:
Speaking maybe only for myself:
I don't like implicit rules, so I don't like also any precedence
hierarchy being in action, so for safety reasons I always write even
8+6*2 (==20) as 8+(6*2) to be sure all will go the way I expect it.
But for people who often use
Claudio Grondi wrote:
It looks very
commercial and has not the _fun_ and _ease_ in it I get used to face
when dealing with Python related icons.
The whole site is just as any other more or less commercial site and
even if it is sure much better than the old one, I will probably miss
the
Is it possible to have method names of a class generated somehow dynamically?
More precisely, at the time of writing a program that contains a class
definition I don't know what the names of its callable methods should
be. I have entries stored in a database that are changing from time to
time
followup to comp.lang.perl.misc
[I will read the other groups, too]
-
The following suggestions result out of an one-day website review of
Active State [1].
-
http://lazaridis.com/samples/com/ActiveState/
*Suggestions:*
Near Future:
*Open* Source the Komodo IDE.
Immediately:
*Free*
In Python, dictionaries can have any hashable value as a string. In
particular I can say
d = {}
d[(1,2)] = Right
d[(1,2)] = Wrong
d[key] = test
In order to print test using % substitution I can say
print %(key)s % d
Is there a way to print Right using % substitution?
print %((1,2))s % d
Is it possible to have method names of a class generated somehow dynamically?
If you don't know the name of the method ahead of time, how do you write
the code for it? Do you use some dummy name? If so, once you have the
name determined then you could use setattr to set the method name.
[EMAIL PROTECTED] wrote:
Sorry if this is a FAQ but Google returns a *lot* of results for Python
Logging :-)
I am looking for a tool that will automatically add logging to existing
code e.g. Function Entries and Exits, Return values etc.
Perhaps you are looking for nothing more than this
import inspect
x = ABC() # create an instance of class ABC
print inspect.getmembers(x,inspect.ismethod)
Most of any introspection stuff can be done using the module inspect.
--
http://mail.python.org/mailman/listinfo/python-list
Daniel Nogradi wrote:
Is it possible to have method names of a class generated somehow dynamically?
More precisely, at the time of writing a program that contains a class
definition I don't know what the names of its callable methods should
be. I have entries stored in a database that are
101 - 200 of 235 matches
Mail list logo