, but at a
creation cost I personally am unwilling to pay.
I'm actually OK with the creation cost, but not the maintenance cost.
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
to see.
x = memoryview(b12345)
x.format
'B'
x.shape
(5,)
x == b12345
True
My guess is you're getting format I from psycopg2. Hopefully
there's a way to coerce your desired B format interpretation of
the raw data using psycopg2's API.
--
Neil Cerutti
--
http://mail.python.org/mailman
with csv
module) instead.
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
On 2013-07-31, Grant Edwards invalid@invalid.invalid wrote:
On 2013-07-31, Neil Cerutti ne...@norwich.edu 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 just
meddling.
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
On 2013-07-31, Grant Edwards invalid@invalid.invalid wrote:
On 2013-07-31, Neil Cerutti ne...@norwich.edu wrote:
On 2013-07-31, Grant Edwards invalid@invalid.invalid wrote:
On 2013-07-31, Neil Cerutti ne...@norwich.edu wrote:
Besides, after studying The Pragmatic Programmer I removed
nearly
is irrelevant, though I do like receiving
an exception when Admissions tries to sneak in a new attribute
without telling me.
If I instead had a function that handled only the interesting
attributes it might be pretty small. I'll have to think on this.
--
Neil Cerutti
--
http://mail.python.org/mailman
, but maybe I'll
want to someday.
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
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
to and reading 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
?irradiated?.
Hope 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
of byte strings, e.g., u
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
://twistedmatrix.com/trac/
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
not the same traceback you get. Furthermore, port
isn't defined either.
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
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
= dict()
if condition:
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
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 INBUILT FUNCTION BE USED.
Impossible. I think.
--
Neil Cerutti
--
http
On 2013-08-26, Joshua Landau jos...@landau.ws wrote:
On 26 August 2013 14:49, Neil Cerutti ne...@norwich.edu wrote:
On 2013-08-25, sahil301...@gmail.com sahil301...@gmail.com wrote:
eg. my input is ['1', ' ', 'asdasd231231', '1213asasd', '43242']
I want it to be interpreted as:
[1, [None
understand how this savant at anti-killfile-fu can't
otherwise manage his server.
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
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
)))
['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
at the end.
I wondered that.
Good point. My little parser fails on that, too. It'll miss *all*
final fields. My parser needs if s: yield s[b:] at the end, to
operate like str.split, where the empty string is special.
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
On 2013-08-30, david.d...@gmail.com 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
.__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
', '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 ne...@norwich.edu 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', 'w'))
It ain't
referring to things like scope, pass-by-value,
references, probably the call stack, etc., but it is written
extremely poorly. Translation please? Thanks!
I don't think that's a fair criticism, but it might be too
technical for a language tutorial.
--
Neil Cerutti
--
https://mail.python.org
not compile like that. There may be indentation errors,
but I don't want to make assumptions when the indentation is
definitely not what your real code says. Can you cut and paste
your code directly instead of retyping it?
--
Neil Cerutti
--
https://mail.python.org/mailman/listinfo/python-list
?
--
Neil Cerutti
--
https://mail.python.org/mailman/listinfo/python-list
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
= 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
:
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
)(7, 7.0)
True
--
Neil Cerutti
--
https://mail.python.org/mailman/listinfo/python-list
but I thought that was
over a long time ago.
To strip NULs off the end of the string use s.rstrip('\0')
Hm, that gives me a Type str doesn't support the buffer API
message.
Type mismatch. Try:
s.rstrip(b\0)
--
Neil Cerutti
--
https://mail.python.org/mailman/listinfo/python-list
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
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 ros...@gmail.com wrote:
On Thu, Sep 19, 2013 at 12:57 AM, Neil Cerutti ne...@norwich.edu 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 with C code
On 2013-09-18, wxjmfa...@gmail.com 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
or a screenshot
or what.
--
Neil Cerutti
--
https://mail.python.org/mailman/listinfo/python-list
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 ne...@norwich.edu 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
looking
will take some digging in the source, probably
looking at doctest.testmod. I don't see an example in the docs.
Hope these examples helped to understand better what my problem
is.
Yes, I think it's well-defined now.
--
Neil Cerutti
--
https://mail.python.org/mailman/listinfo/python-list
, 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
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
. 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 ne...@norwich.edu 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
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
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 ne...@norwich.edu wrote:
On 2013-09-27, somesh g somes...@gmail.com 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 to read the combo box
,
but I just want to shove the food directly into my stomach.
--
Neil Cerutti
--
https://mail.python.org/mailman/listinfo/python-list
?
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
of a mosquito. B! BzZ!
--
Neil Cerutti
--
https://mail.python.org/mailman/listinfo/python-list
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 steve+comp.lang.pyt...@pearwood.info wrote:
On Mon, 30 Sep 2013 18:36:28 +, 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
you might
killfile them. But actual *plonks* are, I think, manifestation of
spotlight syndrome.
--
Neil Cerutti
--
https://mail.python.org/mailman/listinfo/python-list
[k] = round(v, 2)
return
Bare returns are not usual at the end of Python functions. Just
let the function end; it returns None either way. Only return
when you've got an interesting value to return, or when you need
to end execution of the function early.
--
Neil Cerutti
--
https
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
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
+
(?Phttpcode\d{3})\s+
(?Psize\d+)\s+
(?Preferrer\\)\s+
(?Pagent\((.*?)\)), re.VERBOSE)
--
Neil Cerutti
--
https://mail.python.org/mailman/listinfo/python-list
, 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 ne...@norwich.edu 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
testing.
--
Neil Cerutti
, pay no attention to the person whalopping that dead horse.
--
Neil Cerutti
--
https://mail.python.org/mailman/listinfo/python-list
of the earliest things that turned me on to Python was
when I discovered that it uses j as the imaginary unit, not i.
All right-thinking people will agree with me on this.
On top of the engineering origin, j is more noticeable.
--
Neil Cerutti
--
https://mail.python.org/mailman/listinfo/python-list
On 2013-10-10, MRAB pyt...@mrabarnett.plus.com 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!)).
r == c is equivalent to r == abs(c), which returns
On 2013-10-10, Ian Kelly ian.g.ke...@gmail.com wrote:
On Thu, Oct 10, 2013 at 11:48 AM, Neil Cerutti ne...@norwich.edu 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 oscar.j.benja...@gmail.com wrote:
On 10 October 2013 18:48, Neil Cerutti ne...@norwich.edu 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
If the above is genuine
On 2013-10-11, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote:
On Thu, 10 Oct 2013 17:48:16 +, 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 my Python term and my
judgment.
https://mail.python.org/pipermail/python-list/
--
Neil Cerutti
--
https://mail.python.org/mailman/listinfo/python-list
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
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
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
) 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
with garbage?
Fish(enc)ey.
--
Neil Cerutti
--
https
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 p...@vanoostrum.org wrote:
Neil Cerutti ne...@norwich.edu 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. I thought
On 2013-10-22, Mark Lawrence breamore...@yahoo.co.uk wrote:
On 22/10/2013 20:27, Neil Cerutti wrote:
On 2013-10-22, Piet van Oostrum p...@vanoostrum.org wrote:
Neil Cerutti ne...@norwich.edu writes:
Context-sensitive grammars can be parse, too.
That's not English. Do you mean parsed
guys dead?
--
Neil Cerutti
--
https://mail.python.org/mailman/listinfo/python-list
.
--
Neil Cerutti
--
https://mail.python.org/mailman/listinfo/python-list
. 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
pseudo
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
On 2013-10-29, Steven D'Aprano st...@pearwood.info wrote:
On Mon, 28 Oct 2013 13:20:17 +, Neil Cerutti wrote:
On 2013-10-27, Ben Finney ben+pyt...@benfinney.id.au wrote:
I have no particular objection to you responding to those
instances of bad behaviour that I've omitted.
So you
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, even in Python.
--
Neil Cerutti
--
https://mail.python.org
programming.
--
Neil Cerutti
--
https://mail.python.org/mailman/listinfo/python-list
--
Neil Cerutti
--
https://mail.python.org/mailman/listinfo/python-list
is not needed. All
functions return None if they fall off the end.
--
Neil Cerutti
--
https://mail.python.org/mailman/listinfo/python-list
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
respect than
that characterization accords.
--
Neil Cerutti
--
https://mail.python.org/mailman/listinfo/python-list
On 2013-10-31, rusi rustompm...@gmail.com wrote:
On Thursday, October 31, 2013 8:50:27 PM UTC+5:30, Neil Cerutti wrote:
wrote:
This suggests that Pascal went against established practice.
This is false. FORTRAN used = and that was a mistake caused by
the language being hacked together
On 2013-11-01, wxj0...@gmail.com wrote:
hello every expert,
When I use telnetlib to send a command, I meet some troubles, I
have read some documents about telnetlib and modify many times,
but the script doesn't work all the time.
What goes wrong?
--
Neil Cerutti
--
https
' is (hopefully) decoded already, but the encoding of 'x' is
unknown.
--
Neil Cerutti
--
https://mail.python.org/mailman/listinfo/python-list
:-)
Well, maybe the issue is MOOt.
Ugh, if only these puns were like CALF-way funny...
*dives for cover*
Phew! I can't stomach stomach stomach this digression.
--
Neil Cerutti
--
https://mail.python.org/mailman/listinfo/python-list
people and UAs
will ignore text after it.)
It's '-- ', with a space after, to be precise.
But I like it the way he's doing it! His messages are greatly
improved from where I'm sitting..
--
Neil Cerutti
--
https://mail.python.org/mailman/listinfo/python-list
by
storing the data this way, you are promising yourself that you'll
never need to write that query, or at least, you won't need to do
it very often.
I still don't know why you push me to create an extra table
instead.
Because it's usually the right thing to do.
--
Neil Cerutti
--
https
On 2013-11-08, ru...@yahoo.com ru...@yahoo.com wrote:
Just wanted to let you know that not everybody here is an
asshole. It is just that assholes, by their nature, are the
loudest.
Hey man, pass that over!
--
Neil Cerutti
--
https://mail.python.org/mailman/listinfo/python-list
the real value of a switch is that it seems to
be a more natural way of thinking about execution. The caveat to
that is most *actual* switch implementations are a mess.
--
Neil Cerutti
--
https://mail.python.org/mailman/listinfo/python-list
.
Since I have to create the data file manually, race conditions
seem unlikely.
--
Neil Cerutti
--
https://mail.python.org/mailman/listinfo/python-list
in range(0,5)]
service_num_list = list(range(5))
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
On 2012-09-14, Chris Angelico ros...@gmail.com wrote:
But then again, who actually ever needs fibonacci numbers?
If it should happen that your question is not facetious:
http://en.wikipedia.org/wiki/Fibonacci_number#Applications
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo
: sum() can't sum strings [use ''.join(seq) instead]
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
().
Are iterables and sequences different enough to warrant posting a
bug report?
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
)
...
(0, 0)
(0, 1)
(0, 2)
(1, 0)
(1, 1)
(1, 2)
(2, 0)
(2, 1)
(2, 2)
--
Neil Cerutti
--
http://mail.python.org/mailman/listinfo/python-list
701 - 800 of 1188 matches
Mail list logo