Message208604
Isn't this something you could do yourself?
import pathlib
def pathread(self, binary=False):
with self.open('br'if binary else 'r') as fread:
return fread.read()
def pathwrite(self, data, mode='w'):
with self.open(mode) as fwrite:
fwrite.write(data)
pathlib.Path.read = pathread
pathlib.Path.write = pathwrite
p = pathlib.Path('/mydir/example.txt')
p.read()
# 'Content from path.\n'
p.write('I am appending.\n', mode='a')
p.read()
# 'Content from path.\nI am appending.\n'
...and what about:
"There should be one-- and preferably only one --obvious way to do it." |
|
Date |
User |
Action |
Args |
2014-01-21 02:16:46 | cjwelborn | set | recipients:
+ cjwelborn, cool-RR |
2014-01-21 02:16:46 | cjwelborn | set | messageid: <1390270606.9.0.696572043385.issue20218@psf.upfronthosting.co.za> |
2014-01-21 02:16:46 | cjwelborn | link | issue20218 messages |
2014-01-21 02:16:46 | cjwelborn | create | |
|