On Sat, Feb 06, 2010 at 14:42 -0500, Terry Reedy wrote:
> On 2/6/2010 2:09 PM, Wolodja Wentland wrote:
> >I think you can use the itertools.groupby(L, lambda el: el[1]) to group
> >elements in your *sorted* list L by the value el[1] (i.e. the
> >identifier) and then iterate
(5, 'c'), (6, 'c')]
>>> next(k_instances)
Traceback (most recent call last):
File "", line 1, in
StopIteration
There are certainly millions of ways to do this and most of them will be
better than my proposal here, but you might like this approach. Anoth
On Sun, Jan 17, 2010 at 15:05 -0800, BarryJOgorman wrote:
[...]
> class Person:
> def _init_(self, name, job=None, pay=0):
^^ --> __init__(self, ...
It's __init__() not _init_()!
Have fun learning Python!
--
.''`. Wolodja Wentland
: :
following slides will help you a lot:
http://www.dabeaz.com/generators/
If you have further questions just ask and have fun playing with
generators in Python ...
--
.''`. Wolodja Wentland
: :' :
`. `'` 4096R/CAF14EFC
`- 081C B7CD FF04 2BA9 9
cessing.Manager()
managed_dict = manager.dict()
...
--
.''`. Wolodja Wentland
: :' :
`. `'` 4096R/CAF14EFC
`- 081C B7CD FF04 2BA9 94EA 36B2 8B7F 7D30 CAF1 4EFC
signature.asc
Description: Digital signature
--
http://mail.python.org/mailman/listinfo/python-list
share_module.share("shared_dictionary",
> creator.create_dictionary)
> while True:
> pass
Have a look at multiprocessing.Manager() it provides (among other
things) proxies for dictionaries that can be used in different threads.
These are even accessible on different hosts i
se any memory in the
pool processes? This is important as I don't always know when a pool is
instanciated and the pool processes should *not* have the same memory
requirements as the parent process.
Am I missing something here?
--
.''`. Wolodja Wentland
: :'
On Fri, Dec 11, 2009 at 07:31 -0800, IngoognI wrote:
> On Dec 11, 11:12 am, Wolodja Wentland
> wrote:
> > Which library would you choose?
>
> looking at the galery at networx, it seems to be all balls 'n sticks,
> how about writing the data to a file POV-Ray can read a
On Fri, Dec 11, 2009 at 08:55 -0500, Neal Becker wrote:
> Bearophile wrote:
> > Wolodja Wentland:
> >> Which library would you choose?
> > This one probably uses low memory, but I don't know if it works still:
> > http://osl.iu.edu/~dgregor/bgl-python/
>
On Fri, Dec 11, 2009 at 03:03 -0800, Bearophile wrote:
> Wolodja Wentland:
> > Which library would you choose?
>
> This one probably uses low memory, but I don't know if it works still:
> http://osl.iu.edu/~dgregor/bgl-python/
That project looks not that maintained and gra
regards
--
.''`. Wolodja Wentland
: :' :
`. `'` 4096R/CAF14EFC
`- 081C B7CD FF04 2BA9 94EA 36B2 8B7F 7D30 CAF1 4EFC
signature.asc
Description: Digital signature
--
http://mail.python.org/mailman/listinfo/python-list
ng
Distribute/setuptools though, ...
[1]
http://packages.python.org/distribute/setuptools.html#automatic-script-creation
--
.''`. Wolodja Wentland
: :' :
`. `'` 4096R/CAF14EFC
`- 081C B7CD FF04 2BA9 94EA 36B2 8B7F 7D30 CAF1 4EFC
signature.a
uot;(1)" is not an integer, but an one-arity tuple ?
The following might clarify the issue:
>>> t = (1)
>>> type(t)
>>> t = (1,)
>>> type(t)
>>> t = 1,
>>> type(t)
It is the ',' not the '(' and ')' ...
On Wed, Dec 02, 2009 at 08:03 -0800, Mark Summerfield wrote:
> On Dec 2, 11:20 am, Wolodja Wentland
> > It would be quite nice if you could mark all the Python 3 idioms that
> > work in Python 2.X as well. This would allow readers that are still using
> > Python 2.X and are
ders that are still using
Python 2.X and are used to the 'old way' to adapt their coding style
accordingly. You could just add a little (2.X) after the idiom for
example.
And thanks for the nice cheat sheet! :-D
--
.''`. Wolodja Wentland
: :' :
gt; with sites like Code Chef...etc...but at this stage that is not the
> right 'venue' for me. I mainly need challenges like the ones they have
> in Learning Perl.
Project Euler has already been pointed out to you, but I enjoyed solving
the riddles at:
http://www.pythonchalleng
package in the stdlib of Python 2.6.
[1] http://www.dabeaz.com/generators/
--
.''`. Wolodja Wentland
: :' :
`. `'` 4096R/CAF14EFC
`- 081C B7CD FF04 2BA9 94EA 36B2 8B7F 7D30 CAF1 4EFC
signature.asc
Description: Digital signature
--
http://mail.python.org/mailman/listinfo/python-list
which mimics "tail -f" perfectly. It comes from a
talk by David Beazley on generators which you can find at [2] and
[3].
Enjoy!
[1] http://www.dabeaz.com/generators/follow.py
[2] http://www.dabeaz.com/generators-uk/
[3] http://www.dabeaz.com/coroutines/
--
.''`. Wolo
On Mon, Nov 16, 2009 at 01:11 +0100, Wolodja Wentland wrote:
> On Sun, Nov 15, 2009 at 09:16 -0800, Phlip wrote:
> > How can I point pip at the repo to install the library?
> > sudo pip -e git+git://github.com/Phlip/Kozmiq.git
> pip -e git+git://github.com/Phlip/Kozmiq.g
ind regards
Wolodja
--
.''`. Wolodja Wentland
: :' :
`. `'` 4096R/CAF14EFC
`- 081C B7CD FF04 2BA9 94EA 36B2 8B7F 7D30 CAF1 4EFC
signature.asc
Description: Digital signature
--
http://mail.python.org/mailman/listinfo/python-list
On Tue, Nov 10, 2009 at 20:25 -0800, Phlip wrote:
> On Nov 10, 3:11 pm, Wolodja Wentland
> wrote:
>
> > The pip requirement file would contain the following line:
> > -e git+git://example.com/repo.git#egg=rep
> Let me ask it like this. What happens when a user types..
requirement file would contain the following line:
-e git+git://example.com/repo.git#egg=rep
I hope this answers your questions :-D
--
.''`. Wolodja Wentland
: :' :
`. `'` 4096R/CAF14EFC
`- 081C B7CD FF04 2BA9 94EA 36B2 8B7F 7D30 CAF1 4EFC
On Tue, Nov 10, 2009 at 06:30 -0800, Phlip wrote:
> On Nov 10, 1:54 am, Wolodja Wentland
> wrote:
>
> > http://docs.python.org/library/distutils.html#module-distutils
> > http://packages.python.org/distribute/
>
> ktx... now some utterly retarded questions to p
On Mon, Nov 09, 2009 at 19:48 -0800, Phlip wrote:
> I have a single file that I need my crew to pip install.
Where do you plan to host this file? Will it be available on PiPy?
> When I Google for "how to create a pip package" I don't hit anything.
> Of course that info is out there; I can't seem
On Sat, Oct 31, 2009 at 18:29 -0500, Peng Yu wrote:
> On Sat, Oct 31, 2009 at 5:45 PM, Wolodja Wentland
> wrote:
> > On Sat, Oct 31, 2009 at 16:53 -0500, Peng Yu wrote:
> > Are you serious? Do you *really* put each function in its own file? How
> > exactly does this en
On Sat, Oct 31, 2009 at 16:53 -0500, Peng Yu wrote:
> On Sat, Oct 31, 2009 at 4:14 PM, Robert Kern wrote:
[ snip ]
> I know that multiple classes or functions are typically defined in one
> file (i.e. module in python). However, I feel this make the code not
> easy to read. Therefore, I insist o
...
else:
raise ImportError, 'no os specific module found'
sys.modules['os.path'] = path
--- snip ---
If you really want to understand how a module is working then have a
look at its source code. Python is open source --> Use that privilige!
kind regards
Wolodja Wentland
signature.asc
Description: Digital signature
--
http://mail.python.org/mailman/listinfo/python-list
On Wed, Oct 28, 2009 at 10:27 +, Vinay Sajip wrote:
> I've updated PEP 391 (Dictionary-Based Configuration for Logging):
> http://svn.python.org/view/peps/trunk/pep-0391.txt?r1=75599&r2=75918
+1
> All feedback gratefully received!
The PEP does not seem to specify how handler are retrieved by
On Sun, Oct 25, 2009 at 10:48 +, Vinay Sajip wrote:
> Wolodja Wentland cl.uni-heidelberg.de> writes:
[ HTMLHandler, multiple configuration files ]
OK! I agree that these parts are hard to standardise and do not really
belong in the *logging* module.
Maybe a kind soul implem
On Sun, Oct 25, 2009 at 00:41 +0900, Hyunchul Kim wrote:
> [0;37m How to run multiple processes with sequential input of a thousand
> of data
> [0;37m in a script run?
>
> [0;37m I have a python script and 1,000 independent
On Sat, Oct 24, 2009 at 07:54 +, Vinay Sajip wrote:
> Wolodja Wentland cl.uni-heidelberg.de> writes:
[snip]
> > foo
> > |__bar
> > |__baz
> > |__newt
> > |___witch
> >
> > I set every loggers log level to DEBUG and u
command
line have been parsed and does not change (often) afterwards.
My main idea is to see the configuration files not as the final
configuration of the logging system but rather as a definition of the
building blocks that can be plucked together easily programmatically if
the developer sees t
On Thu, Oct 22, 2009 at 13:59 +0200, Lele Gaifax wrote:
> "Gabriel Genellina" writes:
>> unittest, or ultimately, this bug: http://bugs.python.org/issue4947
> http://bugs.python.org/issue4947#msg87637 as the best fit, I think
You might also want to have a look at:
http://bugs.python.org/iss
On Mon, Oct 19, 2009 at 05:44 -0700, khany wrote:
> i am relatively new to python and i am trying to convert a php app i
> have over to it using googleapps.
Welcome!
> anyway here is the problem. i poll ebay API which has in its XML " xml version="1.0" encoding="utf-8"?> xmlns="http://www.ebay.co
On Fri, Sep 25, 2009 at 02:24 -0300, Gabriel Genellina wrote:
> En Thu, 24 Sep 2009 08:21:59 -0300, Wolodja Wentland
> >How do *you* deal with application data in your programs? Is there a way
> >that works on as many platforms as possible?
> On linux, using a configurat
On Thu, Sep 24, 2009 at 12:51 +0100, Tim Golden wrote:
> Wolodja Wentland wrote:
> >Is CSIDL_COMMON_APPDATA and environment variable set on all Windows
> >flavours?
>
> Certainly all those which Python currently supports. There are
> some small subtleties which have c
On Thu, Sep 24, 2009 at 04:07 -0300, Gabriel Genellina wrote:
> >I do not intentionally focus on UNIX type systems, but I have grown up
> >with *nix and I rather follow one scheme than none at all. But the
> >proposed way works on Windows as well, although the users might find
> >previously unseen
On Wed, Sep 23, 2009 at 22:38 +0200, Wolodja Wentland wrote:
> --- Debian example ---
> $ apt-file search /usr/bin/pg_config
> libpq-dev: /usr/bin/pg_config
> --- snip ---
Just wanted to note that libpq-dev is a dependency of
postgresql-server-dev-8.4 on squeeze. So you *might* want
On Wed, Sep 23, 2009 at 12:24 -0700, devaru wrote:
> I'm trying to install psycopg2 on my system. I followed the
> instruction in INSTALL file and gave the command
> python setup.py build
> running build
> running build_py
> running build_ext
> error: No such file or directory
I ran into this some
On Tue, Sep 22, 2009 at 07:42 -0700, Aahz wrote:
> >I want to:
> >
> >1. Give administrators the freedom to install the data wherever they
> > want
> >2. Adhere to the FHS (installing data within modules breaks it)
> >3. Be able to find that data again regardless of the installati
On Mon, Sep 21, 2009 at 23:52 -0300, Gabriel Genellina wrote:
> En Sat, 19 Sep 2009 12:03:52 -0300, Wolodja Wentland
> escribió:
>
> >reliably finding distribution data from your program seems to be an
> >unsolved issue for programs packaged with distutils.
[...]
>
?
Yes.
> $ ls
> bin include lib share
^^^ here
with kind regards
Wolodja Wentland
signature.asc
Description: Digital signature
--
http://mail.python.org/mailman/listinfo/python-list
e a complicated API that relies on externally managed information or
__file__ hacks.
Before you copy this i should note that i plan to use string templates
within 'build_info' and just substitute the wanted information and not
generate the whole file from scratch.
The module detection lo
43 matches
Mail list logo