DOS, Windows, and Linux
> computers for years:
>
> disable the caps-lock key
I really liked rebinding it to Left-CTRL. I only stopped doing
that because it screwed up my work flow when not at a keyboard I
could remap.
--
Neil Cerutti
--
https://mail.python.org/mailman/listinfo/python-list
ust the beginning, but it's a pretty good place.
--
Neil Cerutti
--
https://mail.python.org/mailman/listinfo/python-list
.
There will be an exception only if it is zero-length. But good
point! That's a pretty sneaky way to avoid checking for a
zero-length string. Is it a popular idiom?
--
Neil Cerutti
--
https://mail.python.org/mailman/listinfo/python-list
the fastest after all?
I think the following would occur to someone first:
if key[0] == '<' and key[-1] == '>':
...
It is wrong to avoid the obvious. Needlessly ornate or clever
code will only irritate the person who has to read it later; most
likely yourself.
--
Neil Cerutti
--
https://mail.python.org/mailman/listinfo/python-list
ll catch that with your unit tests ;)
It's easy to forget exactly why startswith and endswith even exist.
--
Neil Cerutti
--
https://mail.python.org/mailman/listinfo/python-list
<' and key[-1] == '>'"
> Traceback (most recent call last):
> File "P:\Python34\lib\timeit.py", line 292, in main
> x = t.timeit(number)
> File "P:\Python34\lib\timeit.py", line 178, in timeit
> timing = self.inner(it, self.timer)
> File "", line 6, in inner
> key[0] == '<' and key[-1] == '>'
> IndexError: string index out of range
The corrected version
key and key[0] == '<' and key[-1] == '>'
probably still wins the Pretty Unimportant Olympics.
--
Neil Cerutti
--
https://mail.python.org/mailman/listinfo/python-list
a followup to
that mind-bending experience.
http://www.eecs.berkeley.edu/~bh/ss-toc2.html
I wouldn't recommend trying to learn anything at the same time as
learning Haskell. ;)
--
Neil Cerutti
--
https://mail.python.org/mailman/listinfo/python-list
enough features to
bother with its implemention.
Check out Go's switch statement for an example of what it might
look like in Python. Except you'd get it without labeled break or
the fallthrough statement. Would you still want to use it?
--
Neil Cerutti
--
https://mail.python.org/mailman/listinfo/python-list
riables in the local symbol table of
the called function.
Am I oversimplifying?
--
Neil Cerutti
--
https://mail.python.org/mailman/listinfo/python-list
let you, gulp, add more.
Well, that or lisp's designers severely underestimated how much
we like to use our programming languages as non-RPN calculators.
--
Neil Cerutti
--
https://mail.python.org/mailman/listinfo/python-list
gt; NameError: global name 'x' is not defined.
>
> In the snippet, x is neither local to __init__() nor global to
> the module. It is in the class scope. You can refer to it in
> one of two ways:
>
>Test.x
>
> or:
>
>self.x
The latter will work only to
mbined with duck typing and simple distribution
of applications is a draw. Go's tools are pretty awesome, and are
scheduled for improvements.
If you can get by with its built in types (or simple aggregates
of them) it feels quite expressive.
--
Neil Cerutti
--
https://mail.python.org/mailman/listinfo/python-list
ry less manageable that the ones I
> used in Python ...
C could provide more friendly general purpose containers in its
library, but doesn't. There are some good free ones: glib, for
example.
Cython provides a really nice in-between level.
--
Neil Cerutti
--
https://mail.python.org/mailman/listinfo/python-list
xprience, too.
Besides, after studying The Pragmatic Programmer I removed nearly
all the tables from my code and reference them (usually with csv
module) instead.
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
On 2013-07-31, Grant Edwards wrote:
> On 2013-07-31, Neil Cerutti wrote:
>> Besides, after studying The Pragmatic Programmer I removed
>> nearly all the tables from my code and reference them (usually
>> with csv module) instead.
>
> I don't understand. That jus
(for example when I want to add instructions to your assembler).
>>
>> My guess is it would be more foolproof to edit that stuff with a
>> spreadsheet.
>
> There's nothing foolproof about using a spreadsheet!
I edit csv files using Excel all the time. But I don'
On 2013-07-31, Grant Edwards wrote:
> On 2013-07-31, Neil Cerutti wrote:
>> On 2013-07-31, Grant Edwards wrote:
>>> On 2013-07-31, Neil Cerutti wrote:
>>>> Besides, after studying The Pragmatic Programmer I removed
>>>> nearly all the tables from my
mined by a person
we have to literally query to discover.
I think I can see the potential problems. Two special codes for
amount is managable, but the more special cases I end up creating
the more of a mess I get. Plus, I haven't really documented the
file.
Most of the information is
maybe I'll
want to someday.
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
wasted my time, of
course.
As I said, I disagree that the speed of using an interpreter is
the main issue. Changing certain things, even big things, in a
Python program is often much easier than changing something in ,
say, a C program, due to Duck-Typing and dynamic typing. So
experimentation is easier thanks to more maleable code.
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
ng from a temp file.
You'll have to create the temp file and manage attaching
processes to it yourself.
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
e the game goes well :-)
>
> It's actually a reimplementation of a game from 1993, so I'm
> somewhat stuck with the terminology.
I haven't played MOO1 for at least a month. :)
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
string with no Umlaut it uses 3 characters, but for an
> Umlaut it uses only 2 characters.
>
> I guess it has to to with unicode.
> How do I get it right?
You guessed it!
Use unicode strings instead of byte strings, e.g., u"...".
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
thon.org/dev/peps/pep-3156/
There's also Twisted: http://twistedmatrix.com/trac/
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
ameError: name 's' is not defined
I bet that's not the same traceback you get. Furthermore, port
isn't defined either.
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
turn out to be
> quite high, but it's not an unreasonable question.
I use the compiled html/windows help and the integrated with the
interpreter html version of the Python docs, both downloaded and
installed for easy access.
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
tring', anothervar='anotherstring')
> anotherdict = dict()
> if :
> anotherdict[akey] = adict['var']
anotherdict[akey] = adict[str(var)]
Will actually work, though you might prefer:
anotherdict[akey] = adict[''.join(var)]
Try them out and see.
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
st it into int and Accept.
> Else, I would like to skip that input.
>
> eg. my input is ['1', ' ', 'asdasd231231', '1213asasd', '43242']
> I want it to be interpreted as:
> [1, [None], [None], [None], 43242]
>
> NOTE: NO INB
On 2013-08-26, Joshua Landau wrote:
> On 26 August 2013 14:49, Neil Cerutti wrote:
>> On 2013-08-25, sahil301...@gmail.com wrote:
>>>
>>> eg. my input is ['1', ' ', 'asdasd231231', '1213asasd', '43242']
>>> I
can't understand how this savant at anti-killfile-fu can't
otherwise manage his server.
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
PLEASE stop baiting Nikos with snide remarks. It makes
> this a very unpleasant environment, and sets the tone of the
> community, badly.
I limit myself to one snide remark every time he escapes my
killfile. 'Cause I wish he would stop.
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
in_brackets = True
elif c == ':':
yield s[b:i]
b = i+1
elif c == "]":
in_brackets = False
>>> print(list(dns_split(s)))
['foo.[DOM]', '', '[IP6::4361:6368:6574]', '600', '']
It'll gag on nested brackets (fixable with a counter) and has no
error handling (requires thought), but it's a start.
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
,s)
>> ['foo.[DOM]', '', '[IP6::4361:6368:6574]', '600', '', '']
>>
>> I'm not sure why _your_ list only has one empty string at the end.
>
> I wondered that.
Good point. My little parser fails on that, too. I
On 2013-08-30, david.d...@gmail.com wrote:
> Hi, im looking for someone who can make a script that gathers
> all file links from an url into a textfile, like this :
> http://pastebin.com/jfD31r1x
Michael Jackson advises you to start with the man in the mirror.
--
Neil Cerutti
t happens, ContentHandler.__init__ isn't empty, so the above
code could fail if the parser isn't prepared for _locator to be
undefined.
Is the above code is an acceptable idiom?
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
t = stack.enter_context(open('another_file', 'w'))
It ain't beautiful, but it unfolds the nesting and gets rid of
the with statement's line-wrap problems.
--
Neil Cerutti
--
https://mail.python.org/mailman/listinfo/python-list
On 2013-09-03, Neil Cerutti wrote:
> 3.2 and above provide contextlib.ExitStack, which I just now
> learned about.
>
> with contextlib.ExitStack() as stack:
> _in = stack.enter_context(open('some_file'))
> _out = stack.enter_context(open('another_file
t more knowledge of what it's referring to.
> However this looks like something that's too important to
> overlook.
It's not ambiguous, self-contradictory or incomplete. But it's
very densely packed with information; perhaps it's too complete.
> I can tell it
which
> means the loop will continue instead of cancelling it.
>
> Thanks in advance for spending your time to answer my question.
Your logic looks OK, but the indentation on your code is screwy.
It should not compile like that. There may be indentation errors,
but I don't want to ma
, then requiring external
> the line-renumbering utilities that AppleSoft BASIC required
> :-S
Though its graphics and sound were far inferior, as a C64 user I
was really jealous of the speed of the built-in Apple disk
drives. The only programming I did on them was typing in some of
the program
to begin.
We can help better if you show some of your code; a minimal
cut-down version that exhibits the error is ideal.
Are you literally getting a RuntimeError? That would be weird.
--
Neil Cerutti
--
https://mail.python.org/mailman/listinfo/python-list
assert len(elts) == 0
> elt = elts[0]
I'm confused. Your rewrite looks like an assertion error or an
IndexError.
--
Neil Cerutti
--
https://mail.python.org/mailman/listinfo/python-list
gt; I have one more:
>
> Dictionaries should iterate over their items instead of their keys.
>
> Looking forward to contrary opinions.
Consider the 'in' operator.
--
Neil Cerutti
--
https://mail.python.org/mailman/listinfo/python-list
return fn(x,y)
> ... return do_stuff
>
> I understand that python is not a functional language, but it
> frustrates me at times.
>>> import operator
>>> equal = get_do_stuff(operator.eq)(7, 7.0)
True
--
Neil Cerutti
--
https://mail.python.org/mailman/listinfo/python-list
clipboard allocation to the next
64K. There used to be good reasons for trying to leave some extra room
on the clipboard and avoid reallocating the block but I thought that was
over a long time ago.
To strip NULs off the end of the string use s.rstrip('\0')
Neil
--
https://ma
On 2013-09-13, stephen.bou...@gmail.com wrote:
> On Thursday, September 12, 2013 10:43:46 PM UTC-5, Neil Hodgson wrote:
>> Stephen Boulet:
>>
>>
>>
>> > From the clipboard contents copied from the spreadsheet, the characters
>> > s[:80684] were
is keyboard,
Till is fingers were bloody stumps,
And the very last words that were entered in his .blog were:
GUI Builders are for chumps, Lord, Lord!
Those GUI builders are for chumps.
--
Neil Cerutti
--
https://mail.python.org/mailman/listinfo/python-list
ot indentation - so we're
> talking more like REXX than Python. In fact, it's not uncommon
> for poetry to be laid out on a single line with slashes to
> divide lines:
There's lots of poetry with significant indentation, though.
Imbuing the shape of the text on the page with significance is a
thing.
--
Neil Cerutti
--
https://mail.python.org/mailman/listinfo/python-list
On 2013-09-18, Chris Angelico wrote:
> On Thu, Sep 19, 2013 at 12:57 AM, Neil Cerutti wrote:
>> There's lots of poetry with significant indentation, though.
>> Imbuing the shape of the text on the page with significance is a
>> thing.
>
> And you can do that wit
On 2013-09-18, wxjmfa...@gmail.com wrote:
>>>> 1and 0
> 0
>>>> 'a'or 1
> 'a'
>>>> 5if True else 999
> 5
Curse you, FSR!
Oh, wait...
--
Neil Cerutti
--
https://mail.python.org/mailman/listinfo/python-list
correctly. win32clipboard is low-level
direct access to the Win32 clipboard API. A higher level API which is
more easily used from Python could be defined on top of this if anyone
was motivated.
Neil
--
https://mail.python.org/mailman/listinfo/python-list
On 2013-09-18, Dave Angel wrote:
> On 18/9/2013 17:40, Neil Hodgson wrote:
>
>> Dave Angel:
>>
>>> So is the bug in Excel, in Windows, or in the Python library? Somebody
>>> is falling down on the job; if Windows defines the string as ending at
>>&
cumenation any more but nothing stops you
from examining the result in the next doctest and making yourself
happy about it.
>>> x = input("indeterminate:")
>>> result = "'{}'".format(x))
>>> result.startswith("'") and result.endswith("'")
True
--
Neil Cerutti
--
https://mail.python.org/mailman/listinfo/python-list
On 2013-09-23, Neil Cerutti wrote:
> Perhaps try the "advanced API" and define your oen
> OutputChecker to add the feature that you need.
>
> Figuring out how to best invoke doctest with your modified
> OutputChecker will take some digging in the source, probably
> l
t; x = input("indeterminate:")
>>
>> >>> result = "'{}'".format(x))
>>
>> >>> result.startswith("'") and result.endswith("'")
>>
>> True
>>
>
> Hi Neil, thanks for the hint, bu
at least 1000 rows, an example:
>
> 0,0,KGD,0,DME,0,,0,0
>
> The values I want to extract are KGD and DME (columns 3 and 5).
Use the csv module.
http://docs.python.org/2/library/csv.html
--
Neil Cerutti
--
https://mail.python.org/mailman/listinfo/python-list
too ambiguous.
Some IDEs allow you to help them understand the context by adding
type information. Here's some documentation for Wing IDE that uses an
isinstance assertion:
http://www.wingware.com/doc/edit/helping-wing-analyze-code
Neil
--
https://mail.python.org/mailman/listinfo/python-list
erated in general; they may
be lost or converted to delimiters on some systems, and
hence must not be relied on.
So putting a raw CR in a binary chunk maybe be intolerable, and
you need to use a different encoder. But I'm out of my element.
--
Neil Cerutti
--
https://mail.python.org/mailman/listinfo/python-list
ll flatten on itself, as in the
recursive version, because the stack frames do all the
bookkeeping for you. CPython has a limited number of stack frames
though, so the version above might be preferable for certain
levels of nesting.
[1] http://en.wiktionary.org/wiki/bikeshed
--
Neil Cerutti
--
https://mail.python.org/mailman/listinfo/python-list
On 2013-09-26, Neil Cerutti wrote:
> def flatten(seq):
>
> [1] http://en.wiktionary.org/wiki/bikeshed
In that spirit, it occurs to me that given current Python
nomenclature, 'flattened' would be a better name.
--
Neil Cerutti
--
https://mail.python.org/mailman/listinfo/python-list
hat excel file and save that excel file
Show more code, please. And please describe the error more fully.
What did you hope to happen, and what happened instead? What have
you tried so far?
--
Neil Cerutti
--
https://mail.python.org/mailman/listinfo/python-list
no multi-select, etc.), and
so it's possible a Visual Basic widget was used instead. That
would leave the cell contents blank when read, as above.
You will need to retrieve the value from the combo-box object
directly somehow.
--
Neil Cerutti
--
https://mail.python.org/mailman/listinfo/python-list
On 2013-09-27, Neil Cerutti wrote:
> On 2013-09-27, somesh g wrote:
>> Hi..there
>>
>> I want to read the combo box in excel by using "xlrd" but in
>> the output it is showing empty message, its not reading the
>> combo box can u guys help me how
just want to shove the food directly into my stomach.
--
Neil Cerutti
--
https://mail.python.org/mailman/listinfo/python-list
poker, yes?
>
> I'm going to go out on a limb and suggest that such a suggestion is
> outside what people generally consider acceptable on this list.
It's reassuring that even a guy like Nikos has his White Knights.
--
Neil Cerutti
--
https://mail.python.org/mailman/listinfo/python-list
nd
> the frustration that leads people to want him to suffer great
> pain.
I don't want him to suffer great pain, but it would please me if
it were possible to annoy him in some way. Like maybe with the
sound of a mosquito. B! BzZ!
--
Neil Cerutti
--
https://mail.python.org/mailman/listinfo/python-list
ry of callbacks, with the
simple functions defined in-line and the more complex functions
defined just before that and referenced instead.
--
Neil Cerutti
--
https://mail.python.org/mailman/listinfo/python-list
On 2013-10-01, Steven D'Aprano wrote:
> On Mon, 30 Sep 2013 18:36:28 +0000, Neil Cerutti quoted:
>
>> Why can??t lambda forms contain statements?
>
> Gah! Please fix your news client! (I see you're using slrn.)
> The \x92 bytes found in your message are ap
me value in telling someone why you might
killfile them. But actual *plonks* are, I think, manifestation of
spotlight syndrome.
--
Neil Cerutti
--
https://mail.python.org/mailman/listinfo/python-list
gt; v = ceil(v*100)/100.0
[*] You're binding v to a new float object here, but not
modifying y. Thus, this code will have no effect on y.
You need to assign to y[k] here instead.
for k, v in d.items():
y[k] = round(v, 2)
> return
Bare returns are not u
lso it means code for this modified Python wouldn't run on
> other non-modified interpreters, but it is at least
> theoretically possible without breaking Python's assumptions.
In any case it's so easy to implement yourself I'm not sure
there's any point.
--
Neil Cerutti
--
https://mail.python.org/mailman/listinfo/python-list
c": 10.0, "d": 10.0}, {"a": 90.0, "b": 0.0, "c": 0.0, "d":
> 10.0}]
>
> However, at the URL, the values show up as 90.43278694123
You'll need to convert them to strings yourself before submitting
them, by using % formatting or str.format.
--
Neil Cerutti
--
https://mail.python.org/mailman/listinfo/python-list
= re.compile(
r"""(?P\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})\s+
(?P\-)\s+
(?P\-)\s+
(?P\[(.*?)\])\s+# You can even insert comments.
(?P\"(.*?)\")\s+
(?P\d{3})\s+
(?P\d+)\s+
(?P\"\")\s+
(?P\((.*?)\))""", re.VERBOSE)
--
Neil Cerutti
--
https://mail.python.org/mailman/listinfo/python-list
to store unchecked
UTF-16 such as Windows filenames as UTF-8. It is also
incompatible with CESU encoding (described below).
So Python's interpretation is conformant, though not without some
disadvantages.
In any case, "\ud800\udc01" isn't a valid unicode string. In a
perfect world it would automatically get converted to
'\u00010001' without intervention.
--
Neil Cerutti
--
https://mail.python.org/mailman/listinfo/python-list
On 2013-10-08, Neil Cerutti wrote:
> In any case, "\ud800\udc01" isn't a valid unicode string. In a
> perfect world it would automatically get converted to
> '\u00010001' without intervention.
This last paragraph is erroneous. I must have had a typo in my
te
clusive way"?
Ned, pay no attention to the person whalopping that dead horse.
--
Neil Cerutti
--
https://mail.python.org/mailman/listinfo/python-list
type (except in
the case of complex numbers (Ha!)).
r == c is equivalent to r == abs(c), which returns the magintude
of the complex number.
I wonder why it was deemed reasonable to do that but not for the
float constructor to do the same, or even int.
> BTW, one of the earliest things tha
On 2013-10-10, MRAB wrote:
> On 10/10/2013 16:57, Rotwang wrote:
>> On 10/10/2013 16:51, Neil Cerutti wrote:
>>> [...]
>>>
>>> Mixed arithmetic always promotes to the wider type (except in
>>> the case of complex numbers (Ha!)).
>>>
>
On 2013-10-10, Ian Kelly wrote:
> On Thu, Oct 10, 2013 at 11:48 AM, Neil Cerutti wrote:
>> Woah. I thought I was going by what the docs say:
>>
>> Python fully supports mixed arithmetic: when a binary
>> arithmetic operator has operands of different numeric types
On 2013-10-10, Oscar Benjamin wrote:
> On 10 October 2013 18:48, Neil Cerutti wrote:
>> I guess the "if appropriate" part eluded my eye. When *is* it
>> appropriate? Apparently not during an equal test.
>>
>>>>> 5.0 == abs(3 + 4j)
>> False
>
On 2013-10-11, Steven D'Aprano wrote:
> On Thu, 10 Oct 2013 17:48:16 +0000, Neil Cerutti wrote:
>
>> >>> 5.0 == abs(3 + 4j)
>> False
>
> Did you maybe accidentally rebind abs? If not, what version of
> Python are you using?
Honestly, I think I got m
dgment.
https://mail.python.org/pipermail/python-list/
--
Neil Cerutti
--
https://mail.python.org/mailman/listinfo/python-list
and template specialization, for
example; you get a generic interface with a decoupled
implementation which can be optimized for specific types at need.
--
Neil Cerutti
--
https://mail.python.org/mailman/listinfo/python-list
Python Language Reference 8.7 Class definitions.
Here's a link to the 3.3 version of those docs:
http://docs.python.org/3.3/reference/compound_stmts.html#class-definitions
--
Neil Cerutti
--
https://mail.python.org/mailman/listinfo/python-list
s, not simply to
all-bits zero as (I think) C does.
This isn't as great a feature as it seems, since the zero value
for some built in types, e.g., map, is unusable without manual
construction. In addition, you can't define a zero value for your
own types.
--
Neil Cerutti
--
https://mail.python.org/mailman/listinfo/python-list
>> global) and you'll see the difference.
>
> Ah, that makes sense. Thanks to everyone who corrected my
> misunderstanding.
>
> Well, actually, no it doesn't. I wonder why C specifies such
> behaviour? Why would you want non-global arrays to be filled
> wit
GCC into an executable.
What executable would GCC compile from a program that matched
this grammar?
spamgram = spam1, { ', ', more_spam }, '.'
spam1 = 'Spam'
more_spam = spam, { ', ', spam }
spam = 'spam'
--
Neil Cerutti
--
https://mail.python.org/mailman/listinfo/python-list
On 2013-10-22, Piet van Oostrum wrote:
> Neil Cerutti writes:
>> Context-sensitive grammars can be parse, too.
>
> That's not English. Do you mean "parsed"?
Thanks, yes, I meant parsed.
> But context-sentitive grammars cannot be specified by BNF.
Yes
On 2013-10-22, Mark Lawrence wrote:
> On 22/10/2013 20:27, Neil Cerutti wrote:
>> On 2013-10-22, Piet van Oostrum wrote:
>>> Neil Cerutti writes:
>>>> Context-sensitive grammars can be parse, too.
>>>
>>> That's not English. Do you mean &q
On 2013-10-23, David wrote:
> On 23 October 2013 22:57, wrote:
>>
>> a LARGE number of Python programmers has not even bothered learning version
>> 3.x.
>
> OMG. Please provide their names. We'll send Doug & Dinsdale.
I can send Mr. Wendt and Mr. Kid
second class OS? Ducks and runs for cover :)
They usually don't. Users of most distributions have an awesome
device called a package manager.
--
Neil Cerutti
--
https://mail.python.org/mailman/listinfo/python-list
ll. Yours is not to reason
why, Jamison. You've left out the body of the letter!
...
Fine. Send it that way, and tell them the body will follow.
--
Neil Cerutti
--
https://mail.python.org/mailman/listinfo/python-list
o
>>> babel.
>>
>> I think you do him a disservice. I'm pretty sure it's genuine,
>> bona-fide, 24K, dyed-in-the-wool, 99 and 44/100 pure babble.
>
> I think it's even better than that... maybe even 28.8K!
>From my own bailiwick I'd say it's Grade A Medium Amber.
--
Neil Cerutti
--
https://mail.python.org/mailman/listinfo/python-list
On 2013-10-29, Steven D'Aprano wrote:
> On Mon, 28 Oct 2013 13:20:17 +0000, Neil Cerutti wrote:
>
>> On 2013-10-27, Ben Finney wrote:
>>> I have no particular objection to you responding to those
>>> instances of bad behaviour that I've omitted.
>>
ed about performance that you're
> willing to trade clarity for it, you shouldn't be using Python
> in the first place.
When you detect a code small, as Wolfgang did, e.g., "I'm
repeating the same exact test condition in several places," you
should not simply ignore it
houldn't be embroiled in the morass of
interactive programming.
--
Neil Cerutti
--
https://mail.python.org/mailman/listinfo/python-list
factor++;
>square=Math.pow(factor,exponent);
> }
> factor--;
> document.write(factor," ");
> square=Math.pow(factor,exponent);
> number=number-(factor*factor);
> square=1;
> factor=1;
> }
> document.wr
ython operators and identifiers.
> square=1;
> factor=1;
> print("+",number);
> return
A bare return at the end of a Python function is not needed. All
functions return None if they fall off the end.
--
Neil Cerutti
--
https://mail.python.org/mailman/listinfo/python-list
except IOError:
pass
with open(self.full_path, 'b') as infile:
# etc...
shutil.copy(tempname, self.output_csv)
This avoids clobbering output_csv unless new data is succesfully
written. I believe TempDirectory isn't available in Python 2, so
some other way of creating that path will be needed, and I'm too
lazy to look up how. ;)
--
Neil Cerutti
--
https://mail.python.org/mailman/listinfo/python-list
than
that characterization accords.
--
Neil Cerutti
--
https://mail.python.org/mailman/listinfo/python-list
601 - 700 of 2046 matches
Mail list logo