On Sun, Mar 16, 2014 at 5:19 PM, Mark H Harris wrote:
> On 3/16/14 12:41 AM, Chris Angelico wrote:
>> To be quite frank, yes I do think it's a nutty idea. Like most nutty
>> things, there's a kernel of something good in it, but that's not
>> enough to build a system on :)
>
>
>Thanks for your
On 3/16/14 12:41 AM, Chris Angelico wrote:
Good stuff Chris, and thanks for the footnotes, I appreciate it.
If getline() is doing nothing that the primitive doesn't, and
getnumline is just enumerate, then they're not achieving anything
beyond shielding you from the primitives.
Yes.
On Sun, Mar 16, 2014 at 3:47 PM, Mark H Harris wrote:
> On 3/15/14 10:48 PM, Chris Angelico wrote:
>>
>> There's a cost to refactoring. Suddenly there's a new primitive on the
>> board - a new piece of language . . . Splitting out all sorts of things
>> into
>>
>> generators when you could use wel
On 3/15/14 10:48 PM, Chris Angelico wrote:
There's a cost to refactoring. Suddenly there's a new primitive on the
board - a new piece of language . . . Splitting out all sorts of things into
generators when you could use well-known primitives like enumerate
gets expensive fast {snip}
[1] https:
On Sun, Mar 16, 2014 at 2:34 PM, Mark H Harris wrote:
> And you are right about another thing, I just want to use this thing over
> and over.
>
> for line in getnumline(filename):
> {whatever}
>
>There does seem to be just one way of doing this (file reads) but there
> are actually many w
On 3/15/14 8:48 PM, Travis Griggs wrote:
On Mar 15, 2014, at 14:24, Mark H Harris wrote:
test
Pass
Thanks Travis. I hated doing that.
I have been having a fit with gg, and its taken just a little time to
get a real news-reader client for posting. What a fit. Google does
really well wi
On 3/15/14 9:01 PM, Steven D'Aprano wrote:
Reading from files is already pretty simple. I would expect that it will
be harder to learn the specific details of custom, specialised, file
readers that *almost*, but not quite, do what you want, than to just
write a couple of lines of code to do what
The current (2.7; maybe 3.x?) logging module doesn't have any sort of
"clear out all the current handlers" method. I can hack it by doing
log = logging.getLogger() # get the root logger
del log.handlers[:]# reach inside and nuke 'em
log.addHandler(...)# install the one(s) I
On 3/15/14 8:32 PM, Mark Lawrence wrote:
Start here
http://docs.python.org/3/library/stdtypes.html#context-manager-types
Thanks Mark. I have three books open, and that doc, and wading through.
You might like to know (as an aside) that I'm done with gg. Got back up
here with a real news read
On Sat, 15 Mar 2014 16:38:18 -0500, Mark H Harris wrote:
> hi folks, I am posting to share a File Reader Generator which I have
> been playing with, that simplifies reading of text files on-demand: like
> log files, config files, small record flat data-bases, &c.
Reading from files is already pre
> On Mar 15, 2014, at 14:24, Mark H Harris wrote:
>
> test
Pass
--
https://mail.python.org/mailman/listinfo/python-list
On 16/03/2014 01:06, Mark H Harris wrote:
On 3/15/14 4:56 PM, MRAB wrote:
You can also shorten it somewhat:
Thanks, I like it... I shortened the fnName() also:
#-
# fn2Name(filename) generator: file reader iterable
#-
On 3/15/14 4:56 PM, MRAB wrote:
You can also shorten it somewhat:
Thanks, I like it... I shortened the fnName() also:
#-
# fn2Name(filename) generator: file reader iterable
#-
de
On 3/15/14 4:56 PM, MRAB wrote:
def fName(filename):
try:
with open(filename, 'r') as fh:
for linein in fh:
yield linein.strip('\n')
except FileNotFoundError as err_code:
print(err_code)
[snip]
The "with" confuses me because I am not sure s
On 3/15/14 4:56 PM, MRAB wrote:
I don't like how it always swallows the exception, so you can't tell
whether the file doesn't exist or exists but is empty, and no way to
specify the file's encoding.
Yes, the error handling needs more robustness/ and instead of printing
the errcode, my actual m
On 2014-03-15 21:38, Mark H Harris wrote:
hi folks, I am posting to share a File Reader Generator which I have
been playing with, that simplifies reading of text files on-demand:
like log files, config files, small record flat data-bases, &c.
I have two generators to share, one with & one withou
test
--
https://mail.python.org/mailman/listinfo/python-list
hi folks, I am posting to share a File Reader Generator which I have
been playing with, that simplifies reading of text files on-demand:
like log files, config files, small record flat data-bases, &c.
I have two generators to share, one with & one without "policy".
The idea is to have the generat
In article ,
mauro wrote:
> Dictionaries and sets share a few properties:
>- Dictionaries keys are unique as well as sets items
>- Dictionaries and sets are both unordered
>- Dictionaries and sets are both accessed by key
>- Dictionaries and sets are both mutables
>
>So I wonder why operations su
Hi everyone!
This is regarding the inbuilt 'complex' function. The python docs say:
"Note: When converting from a string, the string must not contain whitespace
around the central + or - operator. For example, complex('1+2j') is fine, but
complex('1 + 2j') raises ValueError."
Why is this so? Wh
On 15/03/2014 01:13, Joshua Landau wrote:
On 8 March 2014 20:37, Mark Lawrence wrote:
I've found this link useful http://kmike.ru/python-data-structures/
I also don't want all sorts of data structures added to the Python library.
I believe that there are advantages to leaving specialist data s
==
>BREAKING HOGWASH!
==
>
TALK.ORIGINS RECENTLY ANNOUNCED THAT HUMANS HAVE ORIGINS IN THE DEVONIAN.
>
THIS RECENT RECOGNITION OF THE GREATEST FACT IN EARTH'S HISTORY IS
PROFOUND TO http://www.talkorigins.org/ CREDIBILITY. (Also see
http://www.ediacara.org/)
>
DA
22 matches
Mail list logo