"Andrew Durdin" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> In general, I find triple-quoted strings to be very handy,
> particularly for standalone scripts. However, the fact that they have
> to be written in the left-hand column to avoid leading whitespace
> really grates, par
"Andrew Durdin" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> In general, I find triple-quoted strings to be very handy,
> particularly for standalone scripts. However, the fact that they have
> to be written in the left-hand column to avoid leading whitespace
> really grates, par
On 7/5/05, Andrew Durdin <[EMAIL PROTECTED]> wrote:
> print """Usage: dostuff
>
> Options:
> -c - blah blah
> -f - do stuff with file "filename"
> -s - more blah"""
Isn't the standard idiom for this already:
import textwrap
...
print textwrap.dedent("""\
Usage: dos
In general, I find triple-quoted strings to be very handy,
particularly for standalone scripts. However, the fact that they have
to be written in the left-hand column to avoid leading whitespace
really grates, particularly when they're nested within a block or two
-- it's a wart:
try:
Patch / Bug Summary
___
Patches : 348 open ( +4) / 2879 closed ( +4) / 3227 total ( +8)
Bugs: 898 open ( +1) / 5103 closed ( +9) / 6001 total (+10)
RFE : 193 open ( +2) / 170 closed ( +0) / 363 total ( +2)
New / Reopened Patches
__
tarfile.p
""Martin v. Löwis"" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Aahz wrote:
>> Hrm. I thought we told people to start with comp.lang.python for
>> porting questions, but I'm happy to be corrected.
>
> I'm unaware of such a policy, but I may have missed the relevant
> discussion
Fred L. Drake, Jr. wrote:
> Oh, I like this one. "Context manager" / "context protocol" work well for me.
And it means we get to say "decimal.context supports the context
protocol", which sounds perfectly sensible, even obvious. :-)
--
Greg Ewing, Computer Science Dept, +--
Arthur wrote:
> If the thought is that hiding "copy", or relying on idioms for a
> construct as fundamental as the list - is a favor to the beginner,
> I very much am not.
I don't think anyone believes that. It's more a feeling that
Python shouldn't be cluttered up with things that are *only*
Aahz wrote:
> Hrm. I thought we told people to start with comp.lang.python for
> porting questions, but I'm happy to be corrected.
I'm unaware of such a policy, but I may have missed the relevant
discussion. I could understand that questions of the kind "I tried
to build Python on X, and the comp
Gary Robinson wrote:
> Are the docs wrong or am I misreading them? Or are you wrong?
It turns out that I am wrong. The NOARGS functions are indeed called
with an additional NULL argument; it's just that many functions with
NOARGS in Python itself are declared without the additional argument.
Rega
On Tue, Jul 05, 2005, "Martin v. L?wis" wrote:
> Aahz wrote:
>>Martin removed the attribution here:
>>>
>>>I was trying to compile a python plugin (for gimp) using the MSYS
>>>shell and the MINGW compiler.
>>
>> python-dev is the wrong place for this question
>
> Actually, it isn't - he is really
Sorry all,
It seems that the list mods have finally released a duplicate
message that I wrote last week when I wasn't subscribed to the list.
Please ignore the message below if you have read the previous copy
already.
D
On Thu, 2005-06-30 at 09:43 +1200, Darryl Dixon wrote:
> Hi,
>
> I
> You are doing something wrong. As getSumChiSquare is a METH_NOARGS
> method, it shouldn't have a PyObject*args argument.
While I am aware enough of your general expertise to be surprised if
you were in error in your statement below about VAR_NOARGS, your
statement obove does seem to contradict
"Darryl Dixon" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>I'm sorry, I don't seem to have done a very good job at explaining
> the situation. I'll try again:
Actually, I think you did fine the first time, and the second time, and I
see nothing new here. You, like thousan
Gary Robinson wrote:
> #include
> static double gfSumChiSquare = 123.0;
>
> static PyObject *
> getSumChiSquare(PyObject *self, PyObject *args){
> return Py_BuildValue("d", gfSumChiSquare);
> }
>
> static PyMethodDef SimMethods[] = {
> {"getSumChiSquare"
lode leroy wrote:
> maybe someone could extend os.path to do this in the standard distribution:
> implement an msyspath.py, which calls ntpath for each function, and does a
> replace at the end of the evaluation.
The chances are good that nobody else will work on this - so it is
likely that it is
Aahz wrote:
>>I was trying to compile a python plugin (for gimp) using the MSYS
>>shell and the MINGW compiler.
>
>
> python-dev is the wrong place for this question
Actually, it isn't - he is really asking what the best way of
porting Python to MSYS is.
Regards,
Martin
Whatever it is that you need 'getch' to do, can't you incorporate it
first in an extension module you bundle with your application or
library, rather than using the (broken?) wrapper in the msvcrt module?
Jeff
pgpArc0XfxgA7.pgp
Description: PGP signature
_
>* and because Guido believes beginners tend to copy too much
> (that is one reason why copy.copy is not a builtin) and that
> the language should encourage correct behavior.
OTOH, beginners tend to copy not enough - when for example iterating over a
list being acting upon.
Though my real arg
Hi,
I'm sorry, I don't seem to have done a very good job at explaining
the situation. I'll try again:
'getch()' is a low-level function provided on Windows to capture a
single character of input from a user, /without echoing it to the
screen/. As far as I can tell there's no other way of doi
On Tuesday 05 July 2005 02:57, Greg Ewing wrote:
> I'm thinking about something like "context manager",
> or at least something with "context" in it.
Oh, I like this one. "Context manager" / "context protocol" work well for me.
-Fred
--
Fred L. Drake, Jr.
__
Raymond Hettinger wrote:
> This is much improved. I think we're getting close. So far, I like
> Nick's most recent version the best, but this is in the ballpark.
I like some of Phillip's suggestions, particularly the 'context' term.
I'll put some thought into combining the two over the next cou
Raymond Hettinger wrote:
>>"""
>>With Statements and Suite Management
>
>
>
> This is nicely done :-)
>
> Nit: Replace "e.g." with "such as".
>
> BTW, do you support changing __exit__ to __leave__? I think it provides
> a small but useful gain in usability.
I was initially -0 on the idea, a
Phillip J. Eby wrote:
> At 11:48 PM 7/3/2005 -0400, Raymond Hettinger wrote:
> with context_expression as variable:
> # perform actions within a context
>
> The "with" statement establishes a context in which some operations are to
> be performed.
I like this.
> The object produced by 'co
Michael Hudson wrote:
> (I think Raymond has identified the problem I have with resource
> manager more clearly then I did; I certainly don't think I'd realise
> what "decimal.Context() is a resource manager" meant at first
> reading).
I'm also worried that "resource manager" is too narrow
a term
25 matches
Mail list logo