syntax. Should the example be
changed to make that clear?
Alan Isaac
--
http://mail.python.org/mailman/listinfo/python-list
On 1/29/2009 10:50 PM Terry Reedy apparently wrote:
http://bugs.python.org/issue5106
Thanks!
Alan
--
http://mail.python.org/mailman/listinfo/python-list
On 2/1/2009 2:42 AM mcheun...@hotmail.com apparently wrote:
Hi all
what IDE is the best to write python?
http://blog.sontek.net/2008/05/11/python-with-a-modular-ide-vim/
Alan Isaac
PS Also maybe see:
http://vim.sourceforge.net/scripts/script.php?script_id=30
http://www.builderau.com.au
-formatting
As for the last: "values must be a tuple with exactly the number
of items specified by the format string, or a single mapping
object (for example, a dictionary)" unless you need only a
single argument in your format string.
hth,
Alan Isaac
--
http://mail.python.org/mailma
e property object.
But this will not work if the property is inherited.
Thanks,
Alan Isaac
--
http://mail.python.org/mailman/listinfo/python-list
On 2/18/2009 6:15 PM Gabriel Genellina apparently wrote:
type(a).x
OK, that's good. I'd like to sometimes lock attribute creation on
instances of a class but still allow properties to function
correctly. Will something like below be satisfactory?
Thanks,
Alan
def __setattr__(
if hasattr(self, attr): #update val
self.__dict__[attr] = val
On 2/19/2009 3:54 AM Gabriel Genellina apparently wrote:
In particular, your code prevents using class attributes as a default
value for instance attributes
Doesn't the above allow that?
Thanks,
Alan
--
On 2/19/2009 3:47 AM Bruno Desthuilliers apparently wrote:
if not hasattr(self, attr) and getattr(self, '_attrlock', False):
raise AttributeError(yadda yadda)
# NB: assume newstyle class
super(YourClass, self).__setattr__(attr, val)
Thanks.
Alan
PS Thanks a
., the new `print` function).
Presumably many would find this a repulsive
redundancy and a needless maintenance headache.
Alan Isaac
--
http://mail.python.org/mailman/listinfo/python-list
d to using e.g., LaTeX or
reStructuredText).
Anyway, congrats on the book!
I've asked my library to order it.
Alan Isaac
--
http://mail.python.org/mailman/listinfo/python-list
s is a test #with a comment", comments=True)
['this', 'is', 'a', 'test']
>>> split("this is a '#gnarlier' test #with a comment", comments=True)
['this', 'is', 'a', '#gnarlier', 'test']
http://docs.python.org/library/shlex.html
It would be nice to have this example
included in the module docs...
Alan Isaac
--
http://mail.python.org/mailman/listinfo/python-list
d why anyone would object
to this perfectly cogent complaint of Warren's.
Even if the deprecation warnings had not been
invisible, the complaint would be valid.
Alan Isaac
--
http://mail.python.org/mailman/listinfo/python-list
Mike Driscoll wrote:
I have yet to read a Python book that only focuses on the OOP part,
http://www.amazon.com/Scripting-Objects-Comparative-Presentation-Object-Oriented/dp/047039725X
fwiw,
Alan Isaac
--
http://mail.python.org/mailman/listinfo/python-list
,
Alan Isaac
--
http://mail.python.org/mailman/listinfo/python-list
On 10/15/2008 3:13 PM Tim Chase apparently wrote:
http://mail.python.org/pipermail/python-list/2007-December/469320.html
Ask and ye shall receive...
Thank you!
Alan Isaac
--
http://mail.python.org/mailman/listinfo/python-list
ation-Object-Oriented/dp/B00179EUEA/ref=sr_1_2?ie=UTF8&s=books&qid=1224105582&sr=1-2>
and found it very good. (However, I am not in CS, so caveat emptor.)
Alan Isaac
--
http://mail.python.org/mailman/listinfo/python-list
If I have a sequence, I can get every other or every fifth
element by slicing. Is there an equivalent for iterators?
More specifically, I want every fifth line of a big file.
What is the most efficient way to get them?
Thanks,
Alan Isaac
--
http://mail.python.org/mailman/listinfo/python-list
Alan G Isaac <[EMAIL PROTECTED]> writes:
If I have a sequence, I can get every other or every fifth
element by slicing. Is there an equivalent for iterators?
On 10/15/2008 11:12 PM Paul Rubin apparently wrote:
itertools.islice
Oh, of course.
I'm a bit embarrassed not to have
with PyParsing?
Thanks,
Alan Isaac
--
http://mail.python.org/mailman/listinfo/python-list
ately.
Thanks!
Alan
--
http://mail.python.org/mailman/listinfo/python-list
On 10/25/2008 4:14 PM I. Soumpasis apparently wrote:
http://blog.deductivethinking.com/?p=29
This is cool.
But I do not see a license.
May I hope this is released under the new BSD license,
like the packages it depends on?
Thanks,
Alan Isaac
--
http://mail.python.org/mailman/listinfo/python
license s/he prefers.
But a GPL license means that some people will avoid
your code, so you make wish to make sure you thought
the licensing issue for this code carefully.
As a point of comparison,
note that all your package dependencies have
a new BSD license.
Alan Isaac
--
http://mail.pytho
s
['a', 'bc', 'bd', 'bcb', 'ba', 'ab']
>>> maxlen = max(len(si) for si in s)
>>> def k(si): return si+'z'*(maxlen-len(si))
...
>>> sorted(s,key=k)
['ab', 'a', 'ba', 'bcb', 'bc', 'bd']
Cheers,
Alan Isaac
--
http://mail.python.org/mailman/listinfo/python-list
Great idea, but if you do it again, a bit
more lead time would be helpful.
Cheers,
Alan Isaac
--
http://mail.python.org/mailman/listinfo/python-list
unctionalities is it slow, and what evidence
if any is there that Python is causing this?
Thanks,
Alan Isaac
--
http://mail.python.org/mailman/listinfo/python-list
This reminds me: the SimpleParse developers ran into
some troubles porting to Python 2.6. It would be
great if someone could give them a hand.
Alan Isaac
--
http://mail.python.org/mailman/listinfo/python-list
2.6 is quite unfortunate.
Alan
--
http://mail.python.org/mailman/listinfo/python-list
http://code.google.com/p/econpy/source/browse/trunk/utilities/text.py
--
http://mail.python.org/mailman/listinfo/python-list
ak
is the most efficient way to get one result.
Is this right? (It seems nearly the same.)
Alan Isaac
--
http://mail.python.org/mailman/listinfo/python-list
yntax.
Alan Isaac
--
http://mail.python.org/mailman/listinfo/python-list
On 3/21/2009 9:26 AM Esmail apparently wrote:
I also write out some gnuplot scripts
that later get executed to generate .jpg images.
See Gnuplot.py
Alan Isaac
--
http://mail.python.org/mailman/listinfo/python-list
would not be a standard way of making that distinction.
Alan Isaac
(*not* a CS type)
--
http://mail.python.org/mailman/listinfo/python-list
alue? More generally,
why does a StringVar not behave more like a string?
Thanks for any insights,
Alan Isaac
--
http://mail.python.org/mailman/listinfo/python-list
On Mar 28, 2:15 pm, Alan G Isaac
wrote:
I'm a complete newbie to GUI.
I have a couple questions about tkinter.
1. Where is the list of changes
in Python 3's tkinter?
2. What exactly is the role of the root object,
traditionally created as ``root=tk.Tk()``?
What is
ot deny the answers might well be in there somewhere.
Let's try just these two:
- Why does a Variable need a master?
- If s is a StringVar instance, why is
str(s) its name rather than its value?
Thank you,
Alan Isaac
--
http://mail.python.org/mailman/listinfo/python-list
t some active
user had made a list of changes, which I had overlooked, but
that someone on this list would be aware of.
Thanks,
Alan Isaac
--
http://mail.python.org/mailman/listinfo/python-list
Alan asked:
- Why does a Variable need a master?
- If s is a StringVar instance, why is
str(s) its name rather than its value?
On 3/29/2009 2:46 PM Scott David Daniels apparently wrote:
The answer to that, grasshopper, lies in the answer to the question,
"What are StringVars designed
ohn has since used it: as suggesting
something not obvious (to me) was taking place. I had no
intent to communicate indignation with this term and indeed
am startled that it could be so construed. Is this nuance
really universal on this list?
Cheers,
Alan Isaac
--
http://mail.python.org/mailman/listinfo/python-list
7;m inclined to treat
you as a "no" vote.
Thanks,
Alan Isaac
--
http://mail.python.org/mailman/listinfo/python-list
iscussion. Your willingness to converse
with someone whose initial "tone" irritated you has helped
me to improve my understanding, and hopefully some future
user will find this thread of some use.
Cheers,
Alan Isaac
--
http://mail.python.org/mailman/listinfo/python-list
On Mon, 30 Mar 2009 00:13:46 +0100, Alan G Isaac
wrote:
Since you did not address my question about
the nuance of "magic", I'm inclined to treat
you as a "no" vote.
On 3/29/2009 7:19 PM Rhodri James apparently wrote:
And you'd be wrong.
So seriously, you
://docs.python.org/library/smtplib.html
http://docs.python.org/library/email.html
Also see:
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/67083
Alan Isaac
--
http://mail.python.org/mailman/listinfo/python-list
;s just a guess.
Yes, I am making that same guess.
Thanks!
Alan Isaac
--
http://mail.python.org/mailman/listinfo/python-list
This is a helpful answer: it "feels" right and can be
explored further.
Thanks,
Alan
--
http://mail.python.org/mailman/listinfo/python-list
Why do I get the ImportError below?
What is the right way to do this?
Thanks,
Alan Isaac
Python 2.5.4 (r254:67916, Dec 23 2008, 15:10:54) [MSC v.1310 32 bit (Intel)] on
win32
Type "help", "copyright", "credits" or "license" for more information.
On Apr 13, 11:26 am, Alan G Isaac
wrote:
Why do I get the ImportError below?
What is the right way to do this?
Thanks,
Alan Isaac
Python 2.5.4 (r254:67916, Dec 23 2008, 15:10:54) [MSC
v.1310 32 bit (Intel)] on win32 Type "help", "copyright",
"credits" or
, 3), (2, 3)]
hth,
Alan Isaac
--
http://mail.python.org/mailman/listinfo/python-list
More info:
http://sourceforge.net/mailarchive/forum.php?thread_name=A46CBF978138744AAC019E6FF055EAB70F30AE%40apatlelsmail08.elsys.gtri.org&forum_name=tortoisehg-develop>
Alan Isaac
--
http://mail.python.org/mailman/listinfo/python-list
. Is there anything like a Python build tool? (Or do I
even need something like that? I haven't worked with any large Python
systems, just little things here and there.)
http://www.scons.org/wiki/SconsVsOtherBuildTools
Alan Isaac
--
http://mail.python.org/mailman/listinfo/python-list
I'm a tkinter novice.
If I want to propagate changes to a font,
I can just use a named font.
What if I want to propagate color changes?
(E.g., a change in background color for
a number of widgets.)
Thanks,
Alan Isaac
--
http://mail.python.org/mailman/listinfo/python-list
On Apr 20, 12:35 pm, Alan G Isaac wrote:
If I want to propagate changes to a font,
I can just use a named font.
What if I want to propagate color changes?
(E.g., a change in background color for
a number of widgets.)
On 4/20/2009 1:59 PM Mike Driscoll apparently wrote:
One way would be to
on a canvas.
Other?
Are there obvious considerations in the choice?
(Right now I do not need to interact with the squares,
but in the future I may need to.)
Thanks,
Alan Isaac
--
http://mail.python.org/mailman/listinfo/python-list
eeing into
what the trade-offs are. That's my question: what's
the basis of your choice?
Thanks,
Alan
PS Am I right that Tkinter does not offer the ability to
draw many rectangles in one go (along the lines of the
PostScript rectfill operator)?
--
http://mail.python.org/mailman/listinfo/python-list
implications of this is that
your memory usage increases with the more items you draw.
Great summary, and you clued me into a bunch of
methods I had not explored.
Thanks!
Alan
--
http://mail.python.org/mailman/listinfo/python-list
On Apr 20, 5:29 pm, Alan G Isaac wrote:
I need to display many (e.e., 2000) small squares whose colors are udpated
each time a computation is complete.
One approach is to put rectangles on a single canvas.
Another approach is to put many canvases in a single frame.
Another approach is to
Christian Heimes wrote:
https://cybernetics.hudora.biz/projects/wiki/huBarcode
Cool.
I have to mention a pure PostScript writer as well:
http://www.terryburton.co.uk/barcodewriter/
Alan Isaac
--
http://mail.python.org/mailman/listinfo/python-list
/macros/latex/contrib/listings/
The listings package is great and highly configurable.
Note that you can also input entire files of Python code
or pieces of them based on markers. Really quite great.
Cheers,
Alan Isaac
--
http://mail.python.org/mailman/listinfo/python-list
t for
an iterator, and if you want one in that case, you should build it.
Alan Isaac
--
http://mail.python.org/mailman/listinfo/python-list
on.org/3.0/reference/simple_stmts.html#the-yield-statement
Cheers,
Alan Isaac
--
http://mail.python.org/mailman/listinfo/python-list
On Fri, 22 May 2009 16:38:40 GMT, Alan G Isaac
wrote:
I believe the glossary
http://wiki.python.org/moin/PythonGlossary
is missing the definition for 'generator'
and has used instead the definition for 'generator function',
which term is missing from the glossary.
On 5/22/2009 1:44 PM s...@pobox.com apparently wrote:
Note that the glossary page is on the wiki. Feel free to make corrections.
Well, ok, I've done so:
http://wiki.python.org/moin/PythonGlossary
But I'm just a user. Someone should check it.
Thanks,
Alan Isaac
--
http://mail.
e this would be against a determined attack is another matter.
Alan
On May 15, 11:31 am, [EMAIL PROTECTED] (R. Bernstein) wrote:
> The next release of pydb will have the ability to go into ipython from
> inside the debugger. Sort of like how in ruby-debug you can go into
> irb :-)
>
> For
Alan Isaac <[EMAIL PROTECTED]> writes:
I take it from this thread that in Python 3 the following are
equivalent:
class Test: pass
class Test(object): pass
Arnaud Delobelle wrote:
I don't know where it is stated, but how could they *not* be
equivalent?
The m
ded to the __main__.__dict__, just grab it and send it to
this function. Make sure that you send the object and not just its
name because the name is only a string.
Sorry if this is not what you were after.
Alan
On May 29, 2:47 pm, [EMAIL PROTECTED] wrote:
> Hi!
>
> I'm currently
ith the interpreter to
catch element-wise reassignments (possible, but I'd rather avoid), can
anyone suggest a way to do this?
Alan
--
http://mail.python.org/mailman/listinfo/python-list
= 99
which comes up with:
setting one element only
At getx
rebinding the attribute
At setx
Does anyone know why it works like this? I would guess that to "set"
one element, the attribute needs to be retrieved which means the get
method is called. I also guess that only rebinding calls the
OWrapper instance
Thank you,
Alan Isaac
--
http://mail.python.org/mailman/listinfo/python-list
Benjamin wrote:
http://www.python.org/dev/peps/pep-3116/.
Thanks.
Can you give me an example of using the returned value?
Alan
--
http://mail.python.org/mailman/listinfo/python-list
; a = range(3)
>>> b = a + range(3)
>>> b
[0, 1, 2, 0, 1, 2]
>>> a
[0, 1, 2]
>>> a.extend(range(3))
>>> a
[0, 1, 2, 0, 1, 2]
hth,
Alan Isaac
--
http://mail.python.org/mailman/listinfo/python-list
http://docs.python.org/lib/module-csv.html
--
http://mail.python.org/mailman/listinfo/python-list
with Gosper's
modification of Stirling's formula)?
Alan Isaac
--
http://mail.python.org/mailman/listinfo/python-list
h the
allusion?
It is pretty common geek speek:
http://en.wikipedia.org/wiki/Color_of_the_bikeshed
Cheers,
Alan Isaac
--
http://mail.python.org/mailman/listinfo/python-list
less the use of nobreak spaces,
since any decent editor can reveal them.
Alan Isaac
--
http://mail.python.org/mailman/listinfo/python-list
On 9/7/2008 12:22 PM SimonPalmer apparently wrote:
anyone recommend a way of formatting floats with comma separators?
http://code.activestate.com/recipes/498181/
Alan Isaac
--
http://mail.python.org/mailman/listinfo/python-list
meant to be more general.
Alan Isaac
--
http://mail.python.org/mailman/listinfo/python-list
tting the raw string via a function produces a different
result than providing it directly. If this is really the
way things ought to be, I'd appreciate a clear explanation
of why.
Alan Isaac
--
http://mail.python.org/mailman/listinfo/python-list
51, in sub
return _compile(pattern, 0).sub(repl, string, count)
File "C:\Python26\lib\re.py", line 273, in _subx
template = _compile_repl(template, pattern)
File "C:\Python26\lib\re.py", line 260, in _compile_repl
raise error, v # invalid expression
sre_constants.error: bogus escape (end of line)
Why is this the proper handling of what one might think would be an
obvious substitution?
Thanks,
Alan Isaac
--
http://mail.python.org/mailman/listinfo/python-list
Alan G Isaac wrote:
>>> re.sub('abc', r'a\nb\n.c\a','123abcdefg') == re.sub('abc',
'a\\nb\\n.c\\a','123abcdefg') == re.sub('abc', 'a\nb\n.c\a','123abcdefg')
True
Why are the
wing?
A string replacement is not just "converted"
as described in the documentation, essentially
it is compiled?
But that cannot quite be right. E.g., \b will be a back
space not a word boundary. So then the question arises
again, why isn't '\\' a backslash? Just becau
;\' flags an escape which
combined with 'n' produces the newline character (0x0a), and 'c' passes
through as is.
I got that from MRAB's posts. (Thanks.)
What I'm not getting is why the replacement string
gets this particular interpretation. What is the payoff?
(Contrast e.g. Vim's substitution syntax.)
Thanks,
Alan
--
http://mail.python.org/mailman/listinfo/python-list
ons handle this fine without the
odd (to non perlers) handling of backslashes in replacement.
Alan Isaac
--
http://mail.python.org/mailman/listinfo/python-list
P)
Also, regarding PyConfig.h - is this read every time I start Python.exe?
Many thanks,
Alan Harris-Reid
--
http://mail.python.org/mailman/listinfo/python-list
Marco Salden wrote:
On Dec 30, 8:13 pm, Alan Harris-Reid wrote:
Hi there,
In my sys.path (interpreter only, no application loaded), I have the
following strange entries...
'C:\\WINDOWS\\system32\\python31.zip'. This file does not exist
anywhere (although python31.dll doe
Gabriel Genellina wrote:
En Thu, 31 Dec 2009 04:31:06 -0300, Marco
Salden escribió:
On Dec 30, 8:13 pm, Alan Harris-Reid wrote:
Hi there,
In my sys.path (interpreter only, no application loaded), I have the
following strange entries...
'C:\\WINDOWS\\system32\\python31.zip'.
On 12/31/2009 7:30 PM, Steven D'Aprano wrote:
The message attribute is deprecated from
Python 2.6 and will print a warning if you try to use it.
http://bugs.python.org/issue6844
fwiw,
Alan Isaac
--
http://mail.python.org/mailman/listinfo/python-list
x27;t mind writing my own classes (it will be good practice for me),
but I don't want to re-invent the wheel if it can be avoided.
TIA,
Alan Harris-Reid
--
http://mail.python.org/mailman/listinfo/python-list
alex23 wrote:
On Jan 12, 1:26 pm, Alan Harris-Reid
wrote:
Does anyone know where I can find any decent dynamically-constructed
HTML control classes (dropdown list, table, input field, checkbox, etc.)
written in Python.
There's pyWeb[1], which seems pretty close to what you'
Pierre Quentel wrote:
On 12 jan, 04:26, Alan Harris-Reid wrote:
Hi,
Does anyone know where I can find any decent dynamically-constructed
HTML control classes (dropdown list, table, input field, checkbox, etc.)
written in Python. For example, for a HTML table I would like something
like
Aahz wrote:
In article ,
Alan Harris-Reid wrote:
Does anyone know where I can find any decent dynamically-constructed
HTML control classes (dropdown list, table, input field, checkbox, etc.)
written in Python. For example, for a HTML table I would like something
like...
You might
no serious problems (yet).
I would be interested to hear how other people are using Python 3, and
with what compatible packages.
Regards,
Alan Harris-Reid
--
http://mail.python.org/mailman/listinfo/python-list
should I forget that idea completely?)
3. When a method returns to the calling method, is the connection
automatically closed (assuming the object is local, of course) or does
it have to be done explicitly using connection.close()?
TIA,
Alan Harris-Reid
--
http://mail.python.org/mailman/listinfo/python-list
same thing?
The suggestions to return result
or if needed tuple(result) are good,
if a sequence is expected.
But perhaps better if each element has separate meaning:
return a defaultdict;
document the keys.
http://docs.python.org/library/collections.html#collections.defaultdict
Cheers,
Alan
ould work, should it not? Naturally,
'' + 'ab' + 'cd'
'abcd'
Why doesn't duck typing apply to `sum`?
Thanks,
Alan Isaac
--
http://mail.python.org/mailman/listinfo/python-list
Alan G Isaac schrieb:
I expected this to be fixed in Python 3:
sum(['ab','cd'],'')
Traceback (most recent call last):
File "", line 1, in
TypeError: sum() can't sum strings [use ''.join(seq) instead]
Of course it is not a good
On 10/16/2009 3:40 PM, Tim Chase wrote:
What's always wrong is giving me an *error* when the semantics are
perfectly valid.
Exactly.
Which is why I expected this to be fixed in Python 3.
Alan Isaac
--
http://mail.python.org/mailman/listinfo/python-list
is a wart: an error is raised
despite correct semantics. Ugly!
Alan Isaac
--
http://mail.python.org/mailman/listinfo/python-list
language like Python.
(As Tim and Peter make clear.)
Alan
--
http://mail.python.org/mailman/listinfo/python-list
Alan G Isaac gmail.com> writes:
So of course join is better, as originally noted,
but that does not constitute a reason to intentionally
violate duck typing.
On 10/16/2009 1:03 PM, Benjamin Peterson wrote:
As Stephen pointed out, duck typing is not an absolute.
I do not recall any
is useful to
to combine them: sum(pathlst,path()).
Alan Isaac
--
http://mail.python.org/mailman/listinfo/python-list
On 10/16/2009 8:16 PM, Terry Reedy wrote:
The fact that two or three people who agree on something agree on the
thing that they agree on confirms nothing.
On 10/17/2009 7:03 PM, Terry Reedy wrote:
If you disagree with this, I think *you* are being silly.
Well, ...
Alan G Isaac wrote:
Of
901 - 1000 of 1267 matches
Mail list logo