Hi,
Many thanks for everyone's explanations and pointers!
thanks!
Wilbert Berendsen
--
http://www.wilbertberendsen.nl/
"You must be the change you wish to see in the world."
-- Mahatma Gandhi
--
http://mail.python.org/mailman/listinfo/python-list
self.func = func
def __missing__(self, key):
res = self[key] = self.func(key)
return res
Are there other peoply using things like this? Is there a solution like this
in the standard lib that I'm overlooking? Of course 'except KeyError'
everywhere is not re
not this weekend...)
Great that you found the cause of the bug!
I looked for hours in the install.c but I didn't find it :-)
Looking forward to a fix, which will make bdist_wininst much more usable!
thanks!
Wilbert Berendsen
--
http://www.wilbertberendsen.nl/
"You must be the ch
all script is not run?
with best regards,
Wilbert Berendsen
--
http://www.wilbertberendsen.nl/
"You must be the change you wish to see in the world."
-- Mahatma Gandhi
--
http://mail.python.org/mailman/listinfo/python-list
Solved: the problem was right there in the packagelist() function, it
replaced '/' with dots instead of using os.sep ...
I'm very sorry for the noise, although it's surprising everything else
works without dots in the packages names :-)
with regard,
Wilbert
package_dir incantation, but it doesn't help on Windows and
on Linux it worked perfectly without.
Does anybody have a clue why Python distutils on Windows ignore the
package_data?
(Note: sdist perfectly works as the data files are also listed in MANIFEST.in)
tia,
Wilbert Berendsen
--
with codecs.open(filename, 'r', 'utf-8') as f:
counted = Counter(f.read())
for c, n in counted:
print(c, n, sep='\t')
with best regards,
Wilbert Berendsen
--
http://www.wilbertberendsen.nl/
--
http://mail.python.org/mailman/listinfo/python-list
Op donderdag 21 januari 2010 schreef Michele:
> I need a small utility to count the lines of Python code in a
> directory, traversing subdirectories and ignoring comments and
> docstrings.
sloccount can do this.
http://www.dwheeler.com/sloccount/
Met vriendelijke groet,
Wilbert
ns a translator given a mapping. The
translator can be called to perform replacements in a string:
import re
def translator(mapping):
keys = sorted(mapping.keys(), key=len, reverse=True)
rx = re.compile("|".join(keys))
repl = lambda m: mapping[m.group()]
re
rx = re.compile("|".join(keys))
repl = lambda x: mapping[x.group()]
s = "fooxxxbazyyyquuux"
rx.sub(repl, s)
One thing remaining: if the replacement keys could contain non-alphanumeric
characters, they should be escaped using re.escape:
rx = re.compile("|".join
bar()['first'][0] * baz.quux(1, 2)[5:9] +
calculate_number(10, 20) * forbulate(500, 360))
w best regards,
Wilbert Berendsen
--
http://www.wilbertberendsen.nl/
"You must be the change you wish to see in the world."
-- Mahatma Gandhi
--
http://mail.python.org/mailman/listinfo/python-list
You could also copy to a different name on the same disk, and when the copying
has been finished just 'move' (mv) the file to the filename the other
application expects. E.g. QMail works this way, writing incoming mails in
folders.
Met vriendelijke groet,
Wilbert Berendsen
n a decorator?
Thanks for any help,
Wilbert Berendsen
--
http://www.wilbertberendsen.nl/
"You must be the change you wish to see in the world."
-- Mahatma Gandhi
--
http://mail.python.org/mailman/listinfo/python-list
Op zaterdag 12 april 2008, schreef Wilbert Berendsen:
> I'm currently trying to combine subprocess.Popen with pty.openpty ...
which succeeded :-)
http://code.google.com/p/lilykde/source/browse/trunk/runpty.py?r=314
it seems to work :-)
thanks,
Wilbert Berendsen
--
http://www.wilbertbere
e then STDERR is not dup'ed to the pty.
I'm currently trying to combine subprocess.Popen with pty.openpty ...
tx,
Wilbert Berendsen
--
http://www.wilbertberendsen.nl/
"You must be the change you wish to see in the world."
-- Mahatma Gandhi
--
http://mail.python.org/mailman/listinfo/python-list
Hi,
using pty.spawn() it seems that stderr output of the spawned process is
directed to stdout. Is there a way to keep stderr separate and only direct
stdin and stdout to the pty?
TIA,
w best regards,
Wilbert Berendsen
--
http://www.wilbertberendsen.nl/
"You must be the change you wi
If i do
>>> import os
>>> os.path.abspath("bla")
'/home/wilbert/bla'
>>>
it seems that just import os also makes available al os.path functions.
But is that always true?
Thanks,
Wilbert
--
http://www.wilbertberendsen.nl/
"You must be the change you wish to see in the world."
-- Mahatm
Thanks for all the elaborate answers and help! It helped me deepening my
understanding of Python.
Sincere,
Wilbert Berendsen
--
http://www.wilbertberendsen.nl/
"You must be the change you wish to see in the world."
-- Mahatma Gandhi
--
http://mail.python.org/mailman/listi
ing to the correct method from within the
next() method. But that gives an extra call...
Met vriendelijke groet,
Wilbert Berendsen
--
http://www.wilbertberendsen.nl/
"You must be the change you wish to see in the world."
-- Mahatma Gandi
--
http://mail.python.org/mailman/listinfo/python-list
build' ? I can write python
functions to perform those command, and I found timestamp checking functions
in distutils.dep_util, but just can't find the way to connect such commands
to the build step
w best regards,
Wilbert Berendsen
--
http://www.wilbertberendsen.nl/
"You mu
enator . It needs more testing but
seems to work nice.
LilyKDE is located at http://lilykde.googlecode.com/
all the best.
Guido and community: thanks for such a nice programming language,
Wilbert Berendsen
--
http://www.wilbertberendsen.nl/
"You must be the change you wish to see in t
21 matches
Mail list logo