New submission from Phillip Feldman phillip.m.feld...@gmail.com:
The first example below works; the second one produces output containing
garbage characters. (This came up while I was creating a set of examples for a
tutorial on regular expressions).
import re
text= The cat ate the rat
New submission from Phillip Feldman phillip.m.feld...@gmail.com:
I tried switching from `optparse` to `argparse`, but ended up reverting back
because `argparse` does not respect double quotes. For example, `optparse`
correctly parses the following, while `argparse` does not:
python
New submission from Phillip Feldman phillip.m.feld...@gmail.com:
When I try to run a Python script that contains curvy quotes inside comments,
the interpreter gets upset:
SyntaxError: Non-ASCII character '\x92' in file ... on line 20198, but no
encoding declared; see http://www.python.org
Changes by Phillip Feldman phillip.m.feld...@gmail.com:
--
versions: +Python 2.7
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13185
Phillip Feldman phillip.m.feld...@gmail.com added the comment:
Raymond-
I think that you may have overestimated the complexity of the problem. In
about 5 hours, I coded, debugged, and documented a set of generator functions
to solve the general formulation (including box limits) for three
Phillip Feldman phillip.m.feld...@gmail.com added the comment:
Mark: I disagree with your claim that in its basic form, this is covered by
itertools.combinations. If you open the attached text on elementary
combinatorics and go to page 11, you will see a table that lays out six of the
eight
Phillip Feldman phillip.m.feld...@gmail.com added the comment:
Ideally, I'd like to see support for all combinations of the following
occupancy problem features:
- Labeled and unlabeled boxes
- Labeled and unlabeled balls
- Empty boxes allowed and empty boxes forbidden
- Boxes with no capacity
Phillip Feldman phillip.m.feld...@gmail.com added the comment:
With the exception of the empty boxes forbidden category, I've come across
all of these at one time or another, many in the context of error control
coding (data communications). Much of the early work on occupancy problems
Phillip Feldman phillip.m.feld...@gmail.com added the comment:
The itertools module should only have a few of the most generally useful,
especially in combination with other tools.
Balls-in-boxes _is_ one of the most basic of the canonical combinatorial
problems. You can verify
New submission from Phillip Feldman phillip.m.feld...@gmail.com:
The current set of combinatorial functions in `itertools` does not include
unlabelled balls in labeled boxes and unlabelled balls in unlabelled boxes. If
the boxes have no capacity limits (i.e., can store an unlimited number
New submission from Phillip Feldman phillip.m.feld...@gmail.com:
The error message OSError: [Errno 2] No such file or directory would be far
more helpful if it specified the name of the file or directory that cannot be
found.
--
messages: 124108
nosy: Phillip.M.Feldman
priority
11 matches
Mail list logo