Re: [OT] Usage of U+00B6 PILCROW SIGN

2014-02-06 Thread Robert Kern
g to. It's working for me now. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco -- https://mail.python.org/mailman/listinfo/python-list

Re: Question about figure plot

2015-12-15 Thread Robert Kern
f the examples here (note: "pylab" is the essentially the same as "pyplot" for these purposes): http://matplotlib.org/examples/pylab_examples/index.html -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terr

Re: How can I get/save Pandas DataFrame help content?

2015-12-17 Thread Robert Kern
page this: In [1]: pandas.DataFrame? http://ipython.readthedocs.org/en/stable/interactive/reference.html#dynamic-object-information -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it

Re: line_profiler: what am I doing wrong?

2015-02-11 Thread Robert Kern
line_profiler is written in C, perhaps the author (Robert Kern) doesn't care about supporting Jython or IronPython, but there may be Python implementations (PyPy perhaps?) which can run C code but don't have __builtins__. Indeed, I do not care about any of them. PyPy does not i

Re: line_profiler: what am I doing wrong?

2015-02-11 Thread Robert Kern
s way? Does a trivial module work? I.e. """ @profile def run(): pass run() """ -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco -- https://mail.python.org/mailman/listinfo/python-list

Re: line_profiler: what am I doing wrong?

2015-02-16 Thread Robert Kern
On 2015-02-13 13:35, Neal Becker wrote: Robert Kern wrote: @profile def run(): pass run() No, this doesn't work either. Same failure kernprof -l test_prof.py Wrote profile results to test_prof.py.lprof Traceback (most recent call last): File "/home/nbecker/.local/bin/kernpro

Re: Bug in timsort!?

2015-02-25 Thread Robert Kern
_at(ms, n) < 0) return -1; } else break; } return 0; } Or does "Python function" mean something else in this context? "Corrected merge_collapse function [from the Python implementation of TimSort]" as opposed t

Re: singleton ... again

2014-02-13 Thread Robert Kern
7;, but since that optimization isn't guaranteed, neither is that code pattern. We don't use `is None` instead of `== None` for the speed. We use it for robustness. We don't want arbitrary __eq__()s to interfere with our sentinel tests. If None weren't a singleton that we could

Re: An example of Python in action!

2014-02-25 Thread Robert Kern
software from AutoDesk. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco -- https://mail.python.org/mailman/listinfo/python-list

Re: pip and distutils2-1.0a4

2014-03-03 Thread Robert Kern
If you want us to help, you need to show us what you tried, tell us what results you expected, and copy-paste the output that you got. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it

Re: pip and distutils2-1.0a4

2014-03-03 Thread Robert Kern
On 2014-03-03 21:37, Mark H. Harris wrote: On Monday, March 3, 2014 3:32:43 PM UTC-6, Robert Kern wrote: Probably. If you want us to help, you need to show us what you tried, tell us what results you expected, and copy-paste the output that you got. Robert Kern hi Robert, well, I finally

Re: Examples of modern GUI python programms

2014-04-03 Thread Robert Kern
On 2014-04-02 12:52, Sturla Molden wrote: Wolfgang Keller wrote: Judging from the example screenshots on their website, Kivy might be adequate. Kivy depends on PyGame which is GPL, and can only be used to build GPL software. It is not. http://www.pygame.org/LGPL -- Robert Kern "I

Re: Simple question

2014-04-15 Thread Robert Kern
rt Decimal' you can get a much closer result i.e. 'Decimal('0.0')' What I'm wondering is why the first calculation that arrives at '5.55111...' is so far out? The `...` elides the exponent: >>> 0.1 + 0.1 + 0.1 - 0.3 5.551115123125783e-17 If you c

Re: First attempt at a Python prog (Chess)

2014-04-30 Thread Robert Kern
tening to. He is to be killfiled and ignored. Chris, I'm sorry you ran into him on your first introduction to this community. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it a

Re: Everything you did not want to know about Unicode in Python 3

2014-05-17 Thread Robert Kern
public domain. The author has no choice in the matter. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco -- https://mail.python.org/mailman/listinfo/python-list

Re: Everything you did not want to know about Unicode in Python 3

2014-05-17 Thread Robert Kern
Note how they distinguish the CC0 Waiver from their Public Domain Mark: the Public Domain Mark is just a label for things that are known to be free of copyright worldwide but does not make a work so. The CC0 *does* have an operative effect that is substantially similar to the work being in the

Re: Everything you did not want to know about Unicode in Python 3

2014-05-17 Thread Robert Kern
On 2014-05-17 15:15, Steven D'Aprano wrote: On Sat, 17 May 2014 10:29:00 +0100, Robert Kern wrote: One can state many things, but that doesn't mean they have legal effect. The US Code has provisions for how works become copyrighted automatically, how they leave copyright automatica

Re: Everything you did not want to know about Unicode in Python 3

2014-05-17 Thread Robert Kern
On 2014-05-17 13:07, Steven D'Aprano wrote: On Sat, 17 May 2014 09:57:06 +0100, Robert Kern wrote: On 2014-05-17 02:07, Steven D'Aprano wrote: On Fri, 16 May 2014 14:46:23 +, Grant Edwards wrote: At least in the US, there doesn't seem to be such a thing as "pla

Re: Python and Math

2014-05-18 Thread Robert Kern
;math"). Many mathematicians would disagree. http://sagemath.org/ -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto E

Re: Python and Math

2014-05-21 Thread Robert Kern
/ Can do heaps of stuff, too. For free. And with Python! http://sagemath.org/ -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- U

Re: Python and Math

2014-05-21 Thread Robert Kern
But all easily available with well-established open source packages. Just because it's not in the standard library doesn't mean that Python isn't a suitable language for doing this stuff. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless

Re: Parallel python in the cloud

2014-05-24 Thread Robert Kern
s your client code (i.e. what you wrote above) is concerned, it's just another library. E.g. https://github.com/ipython/ipython/blob/master/examples/Parallel%20Computing/nwmerge.py https://github.com/ipython/ipython/blob/master/examples/Parallel%20Computing/itermapresult.py etc. -- Robert Ker

Re: Numpy Array of Sets

2014-05-24 Thread Robert Kern
ts like so: [[]]*3 https://docs.python.org/2/faq/programming.html#how-do-i-create-a-multidimensional-list -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth

Re: Am I not seeing the Error?

2013-08-13 Thread Robert Kern
ately coding in this style to troll. http://en.wikipedia.org/wiki/Troll_(Internet) For me, this style is easier to read. I have tried the "typical" style, but I find this one to be easier. Consider the topic of this thread as evidence against that proposition. -- Robert Kern &qu

Re: Simplex Algorithm

2013-09-02 Thread Robert Kern
OP wants is for solving a linear programming problem (minimize a linear combination of variables subject to linear inequality constraints). The simplex algorithm that scipy implements is more properly termed "the Nelder-Mead simplex algorithm" for unconstrained local nonlinear mini

Re: Simplex Algorithm

2013-09-02 Thread Robert Kern
ather than a solver, but the sources do contain compiled binaries for the CoinMP solver so it will work out-of-box on popular platforms, like Windows. https://projects.coin-or.org/CoinMP -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that i

Re: Simplex Algorithm

2013-09-02 Thread Robert Kern
On 2013-09-02 16:06, Tommy Vee wrote: On 9/2/2013 5:55 AM, Robert Kern wrote: On 2013-09-02 02:26, Tommy Vee wrote: Anyone know where I can get an easy to use Python class or algorithm for the Simplex optimization algorithm? I've tried the one in the link below, but I can't figur

Re: Python GUI?

2013-09-12 Thread Robert Kern
ing forcing you to use the GUI designers if you don't want to. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco -- https://mail.python.org/mailman/listinfo/python-list

Re: Tryign to send mail via a python script by using the local MTA

2013-09-17 Thread Robert Kern
d the standard SMTP library. http://docs.python.org/2/library/smtplib -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umbert

Re: Having both if() and for() statements in one liner

2013-09-17 Thread Robert Kern
ahve both if and for in a one liner? Not in Python, no. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco -- https://mail.python.org/mailman/listinfo/python-list

Re: Tryign to send mail via a python script by using the local MTA

2013-09-20 Thread Robert Kern
Python list. Please don't valorize my message. I did neither Nikos nor the group any favors. I can only plead dizziness from the whooshing of Tim's sarcasm flying over Nikos' head. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma t

Re: What minimum should a person know before saying "I know Python"

2013-09-20 Thread Robert Kern
#x27;?" At what point in your Python career did you feel comfortable claiming that? -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth."

Re: Python GUI?

2013-09-20 Thread Robert Kern
*driven by* contributions from the community. http://qt-project.org/contribute http://qt-project.org/wiki/PySideContributors -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as

Re: Possibilities of Building "Stacked Neural Networks"

2013-09-25 Thread Robert Kern
one will probably take a couple of days of computation (for the final run, *after* you have debugged your code and done the initial experiments to find all of the right hyperparameters for your problem). Good luck! -- Robert Kern "I have come to believe that the whole world is an enigma,

Re: Referrer key missing form os.environ dictionary?

2013-09-25 Thread Robert Kern
line, you have probably left off a closing bracket or something similar in a previous line. Look back a few lines. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an u

Re: Referrer key missing form os.environ dictionary?

2013-09-26 Thread Robert Kern
HTTP request, headers and body, through stdin and just make the program parse them apart. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth."

Re: Handling 3 operands in an expression without raising an exception

2013-09-28 Thread Robert Kern
explanation. I studied it briefly in class in 1970, and have no idea if there are current implementations. You are in luck! GNU APL 1.0 was just released! http://www.gnu.org/software/apl/ -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made ter

Re: Sexism in the Ruby community: how does the Python community manage it?

2013-10-18 Thread Robert Kern
ral term applied to things with a pointed tip. The fish name is a shortening of "pike-fish", so it's obviously not the source of the word. The weapon only really comes into fashion a couple of centuries after the fish's name is first recorded, so it's not the source either.

Re: Sexism in the Ruby community: how does the Python community manage it?

2013-10-18 Thread Robert Kern
e and axe on the end. Just 'cos that would be cooler than naming it after the fish. I don't know which it was named after (could also be a road, eg turnpike), but the language's logo is the fish. Our logo is a snake, so that's obviously not a good guide. :-) -- Robert Kern

Re: strange array size problem

2013-10-18 Thread Robert Kern
example (with data) that demonstrates the problem. Use pastebin.com or a similar service if necessary. http://www.scipy.org/scipylib/mailing-lists.html -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attem

Re: skipping __init__ and using exploiting a class member instead

2013-10-19 Thread Robert Kern
a default for an instance attribute is accepted practice, and one that gets touted as a positive feature of Python's namespace model when compared against other languages. That said, I have seen it more often in the past. [1] In the general "unchanging" sense rather than the C++ "sta

Re: Basic Python Questions - Oct. 31, 2013

2013-10-31 Thread Robert Kern
ays, then only the arrays need to be unboxed once, then the rest of the arithmetic happens in C. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth

Re: Basic Python Questions - Oct. 31, 2013

2013-10-31 Thread Robert Kern
On 2013-10-31 14:49, Chris Angelico wrote: On Fri, Nov 1, 2013 at 1:41 AM, Robert Kern wrote: On 2013-10-31 14:05, Chris Angelico wrote: On Fri, Nov 1, 2013 at 12:17 AM, Alain Ketterlin wrote: "E.D.G." writes: The calculation speed question just involves relatively s

Re: datetime question

2013-11-08 Thread Robert Kern
forum. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco -- https://mail.python.org/mailman/listinfo/python-list

Re: Adding 'download' column to existing 'visitors' table (as requested)

2013-11-09 Thread Robert Kern
e that. Just a majority of Greeks? How comforting. Please don't. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco

Re: Code with random module faster on the vm than the vm host...

2013-11-10 Thread Robert Kern
. os.urandom() gets called in the initial default seeding, but not for each value. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -

Re: New user's initial thoughts / criticisms of Python

2013-11-11 Thread Robert Kern
draw from the random tables on Abulafia[2] which have nearly the same structure. It scales up reasonably well beyond d100s. It's certainly not a technique I would pull out to replace one-off if-elif chains that you literally write, but it works well when you write the generic code once to a

Re: Question about python package numpy

2015-03-02 Thread Robert Kern
e of these examples come prepackaged in any distribution I am aware of. You are intended to copy-and-paste them from the wiki if you want to use them. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to

Re: Use à Python 2 module with Python 3

2015-03-11 Thread Robert Kern
optional style guide. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco -- https://mail.python.org/mailman/listinfo/python-list

Re: Use à Python 2 module with Python 3

2015-03-11 Thread Robert Kern
by the initial development team due to a lack of funding, so right now the destiny of the bugs such as this is in hands of those who understand how to debug them." (Quoted from https://bugreports.qt.io/browse/PYSIDE-164) Anatoly was wrong. -- Robert Kern "I have come to believe t

Re: PiCxx

2015-03-29 Thread Robert Kern
current license. http://opensource.org/licenses -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco -- https://mail.python.or

Re: Code critique please

2015-04-08 Thread Robert Kern
compatible. https://pillow.readthedocs.org/porting-pil-to-pillow.html -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco -- h

Re: [SciPy-User] Is there existing code to log-with-bells-on for runtime algorithm diagnostics?

2015-04-21 Thread Robert Kern
ured logging". http://www.structlog.org/en/stable/ http://eliot.readthedocs.org/en/stable/ https://twiggy.readthedocs.org/en/latest/logging.html#structured-logging http://netlogger.lbl.gov/ -- Robert Kern -- https://mail.python.org/mailman/listinfo/python-list

Re: Tit for tat

2015-04-28 Thread Robert Kern
ed for it, using two different search engines, and neither come up with any references for "Toot For Tail" strategies. I do believe he is trying to make a crude joke. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made

Re: enhancement request: make py3 read/write py2 pickle format

2015-06-10 Thread Robert Kern
ent module, or did one of your third-party dependencies do this? Poof! Your pickle files no longer work. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an u

Re: enhancement request: make py3 read/write py2 pickle format

2015-06-10 Thread Robert Kern
On 2015-06-10 13:08, Marko Rauhamaa wrote: Robert Kern : By the very nature of the stated problem: serializing all language objects. Being able to construct any object, including instances of arbitrary classes, means that arbitrary code can be executed. All I have to do is make a pickle file

Re: Pure Python Data Mangling or Encrypting

2015-06-27 Thread Robert Kern
Mersenne Twister is not a cryptographically secure pseudorandom number generator. If I can get some small number of values from the Twister (by memory, something of the order of 100 such values) then I can predict the rest for ever. 634. -- Robert Kern "I have come to believe that the whole world is an e

Re: Pure Python Data Mangling or Encrypting

2015-06-27 Thread Robert Kern
On 2015-06-27 08:58, Robert Kern wrote: On 2015-06-27 04:38, Steven D'Aprano wrote: Maybe you use Python's standard library and the Mersenne Twister. The period of that is huge, possibly bigger than 256! (or not, I forget, and I'm too lazy to look it up). So you think that'

Re: enumerate XML tags (keys that will become headers) along with text (values) and write to CSV in one row (as opposed to "stacked" values with one header)

2015-06-29 Thread Robert Kern
.w3.org/TR/xml-infoset/#infoitem.element If it didn't, then XHTML would have a hell of a time with ordered constructs like this: First item Second item Third item -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is

Re: enumerate XML tags (keys that will become headers) along with text (values) and write to CSV in one row (as opposed to "stacked" values with one header)

2015-06-30 Thread Robert Kern
always has the same number of children, etc.), then it probably does represent an ordered collection. If it's variable, then putting it into a table structure probably doesn't make any sense regardless of ordering issues. -- Robert Kern "I have come to believe that the whole world

Re: calculating entropy of image or alternative?

2015-07-03 Thread Robert Kern
uantity that your code is computing will be exactly the same because the pixels contribute to the histogram in the same way. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it

Re: (side-)effects and ...

2015-07-05 Thread Robert Kern
ppend(self, x) which will give you different results depending on the number of times you call it, even if the arguments are the same. Functions that don't change state at all are naturally idempotent, but many idempotent functions do change state. -- Robert Kern "I have come to beli

Re: don't understand matrix-multiplication should be reversed in python?

2015-11-12 Thread Robert Kern
put. There is no "reversed definition of rows and columns". He simply instantiated the two vectors as row-vectors instead of column-vectors, which he could have easily done, so he had to flip the matrix expression. -- Robert Kern "I have come to believe that the whole world is an

Re: Python's re module and genealogy problem

2014-06-11 Thread Robert Kern
egex. This will help you QA your regexes, too, to be sure that they match what you expect them to and not match non-names. https://github.com/asciimoo/exrex -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad

Re: Single underscore in interactive mode

2014-06-25 Thread Robert Kern
ode ? See the documentation on `sys.displayhook()`, which is the function that makes the assignment: https://docs.python.org/3/library/sys.html#sys.displayhook -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own

Re: PEP8 and 4 spaces

2014-07-05 Thread Robert Kern
g form feeds to separate sections of code. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco -- https://mail.python.org/mailman/listinfo/python-list

Re: Module name does not match file name

2014-07-07 Thread Robert Kern
[~] |1> import imp [~] |2> imp.get_suffixes() [('.so', 'rb', 3), ('module.so', 'rb', 3), ('.py', 'U', 1), ('.pyc', 'rb', 2)] -- Robert Kern "I have come to believe that the whole world is an enigma, a har

Re: Module name does not match file name

2014-07-07 Thread Robert Kern
On 2014-07-07 12:56, Steven D'Aprano wrote: On Mon, 07 Jul 2014 12:15:51 +0100, Robert Kern wrote: On 2014-07-07 09:57, Steven D'Aprano wrote: What I don't understand is how "import pg" gets turned into "run pgmodule.so"? This has been standard Python b

Re: Proposal: === and !=== operators

2014-07-09 Thread Robert Kern
] |2> x == 3 array([False, False, False, True, False], dtype=bool) You can blame Numeric/numpy for that feature getting in. :-) Now certainly, many uses of __eq__, like containment comparisons, do assume that the result is a bool(able). -- Robert Kern "I have come to believe that the w

Re: Getting a list of all modules

2014-07-30 Thread Robert Kern
es that cannot be imported because their names are not Python identifiers: e.g. check-newconfigs.py. Those are easy to filter out, fortunately. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to

Re: Getting a list of all modules

2014-08-01 Thread Robert Kern
http://code.google.com/p/tabhistory/source/browse/tabhistory.py where I have indenting, code completion, filename completion, and module completion all working to some degree or another. Take a look at what has already been implemented in IPython: https://github.com/ipython/ipython/blob/master/IPyth

Re: Bug with help (was Re: Getting a list of all modules)

2014-08-02 Thread Robert Kern
sh is in the 3rd party modules, Python could (and maybe Python 3 does) import each module in a separate subprocess and collect the information that way. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad

Re: how to get the ordinal number in list

2014-08-11 Thread Robert Kern
ation? Using [x] for subscripts: x[n+1] = x[n] + 1 we have a perfectly good mathematical recursive definition. All it needs is an initial value x[0] and we're good to go. Or a different operator for assignment (to distinguish it more clearly from equality, which it isn't). x <- x

Re: 'is not' or '!='

2014-08-20 Thread Robert Kern
h the committer's name/id. I use it all the time at $DAYJOB. I've managed to avoid CVS, so I can't speak to that. cvs annotate http://compbio.soe.ucsc.edu/cvsdoc/cvs-manual/cvs_74.html -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma t

Re: Python vs C++

2014-08-24 Thread Robert Kern
esire to learn it. Trouble is, I don't have any project that calls for it - there's nothing I'm desperately wanting to do that involves both Python and C/C++. Anyone got any suggestions? :) Class-based, Python 3-compatible bindings for libtcod? http://doryen.eptalys.net/libtcod/

Re: [OT] Question about Git branches

2014-09-16 Thread Robert Kern
orrectly, the way to begin an experimental branch is to use hg clone. Yes, but this is due to different design decisions of git and Mercurial. git prioritized the multiple branches in a single clone use case; Mercurial prioritized re-cloning. It's natural to do this kind of branching in gi

Re: [OT] Question about Git branches

2014-09-16 Thread Robert Kern
On 2014-09-16 17:25, Chris Angelico wrote: On Wed, Sep 17, 2014 at 2:08 AM, Robert Kern wrote: Yes, but this is due to different design decisions of git and Mercurial. git prioritized the multiple branches in a single clone use case; Mercurial prioritized re-cloning. It's natural to do

Re: optionparse: how to add a line break to the help text

2011-09-10 Thread Robert Kern
tions. You can use """ for multiple line texts: >>> text = \ ... """fsdfsfsdfsdf ... sfsdfsfsdf ... sdfsdf s ... ... """ >>> text 'fsdfsfsdfsdf\n sfsdfsfsdf\nsdfsdf s\n\n' That's not the problem. OptionParser remove

Re: optionparse: how to add a line break to the help text

2011-09-11 Thread Robert Kern
.py can be simply dropped into your codebase, if you want. That's about as minimal of fuss as you can ask for. http://pypi.python.org/pypi/argparse -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attemp

Re: Numpy.array with dtype works on list of tuples not on list of lists?

2011-09-18 Thread Robert Kern
al fields as above) pose a new problem in that its individual elements are sequences themselves. In order to help it decide whether it should recurse down into a sequence to find its elements or decide that the sequence *is* an element in its own right, we settled on the convention that tuples

Re: Wrote a new library - Comments and suggestions please!

2011-09-27 Thread Robert Kern
t you drop what you are doing in Python and start working with SAS. He is suggesting that you look at the similar procedures that exist in the SAS standard library for inspiration. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made ter

Re: QA Engineering/ Python/ Contract/ Austin, TX

2011-09-27 Thread Robert Kern
the Subject line also helps. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco -- http://mail.python.org/mailman/listinfo/python-list

Re: atexit handlers - getting the return code

2011-09-27 Thread Robert Kern
it can read every bit of text that gets printed. Timing is probably also best recorded by the runner script to record the startup overhead of the Python interpreter. Continue to use the SimulationDecorator to record the traceback information, though. -- Robert Kern "I have come to believe

Re: Chaco for real-time plot of PySerial data

2011-11-03 Thread Robert Kern
ates it with new data: https://github.com/enthought/chaco/tree/master/examples/demo/updating_plot I can't help much with the PySerial part, I'm afraid. Integrating that with the GUI event loop is probably going to be the trickiest bit. -- Robert Kern "I have come to believe that th

Re: else in try/except

2011-11-15 Thread Robert Kern
isError or ThatError # exceptions that should not be caught by the above except: blocks. # Other code that runs regardless if a caught-and-continued exception # was raised or not -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terr

Re: cmd.Cmd asking questions?

2011-11-28 Thread Robert Kern
ly *less* uniform to have some questions requiring an enter and some not. It can be unpleasantly surprising to the user, too. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though i

Re: cmd.Cmd asking questions?

2011-11-30 Thread Robert Kern
On 11/30/11 3:30 AM, Cameron Simpson wrote: On 29Nov2011 13:37, Tim Chase wrote: | On 11/28/11 06:27, Robert Kern wrote: [...] |>I actually have a preference for needing to press enter for |>Y/N answers, too. It's distinctly *less* uniform to have some |>questions requiring an

Re: why is bytearray treated so inefficiently by pickle?

2011-12-06 Thread Robert Kern
pickling protocol let numpy use raw binary data in the pickle. However, for backwards compatibility, the default protocol is the one Python started out with. If you explicitly use the most recent protocol, then you will get the efficiency benefits. -- Robert Kern "I have come to believe

Re: Misleading error message of the day

2011-12-08 Thread Robert Kern
e to want to unpack a string. Maybe the message should changed to "too {many, few} values to unpack (are you sure you wanted to unpack a string?)" if the RHS is a basestring? Would including the respective numbers help your thought processes? ValueError: too many values to unpack (expected

Re: Misleading error message of the day

2011-12-08 Thread Robert Kern
at the end of the process. unpack_iterable() has the original object available to it, not just the iterator. It could opportunistically check for __len__() and fall back to the less informative message when it is absent. -- Robert Kern "I have come to believe that the whole world is an enigma, a

Re: Numpy ndarray to C array

2011-12-08 Thread Robert Kern
like to avoid using boost, swig, etc. You will find it better to ask numpy questions on the numpy mailing list: http://www.scipy.org/Mailing_Lists In this case, you are looking for the PyArray_AsCArray() function: http://docs.scipy.org/doc/numpy/reference/c-api.array.html#PyArray_AsCArray

Re: I love the decorator in Python!!!

2011-12-09 Thread Robert Kern
ttp://docs.python.org/library/functools#functools.update_wrapper -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco -- http://

Re: I love the decorator in Python!!!

2011-12-12 Thread Robert Kern
On 12/12/11 3:36 AM, alex23 wrote: On Dec 9, 8:08 pm, Robert Kern wrote: On 12/9/11 5:02 AM, alex23 wrote: The 3rd party 'decorator' module takes care of issues like docstrings &function signatures. I'd really like to see some of that functionality in the stdlib thou

Re: What happened to module.__file__?

2011-12-12 Thread Robert Kern
ilds typically have math and several other stdlib "extension" modules built into the PythonXY.dll . Unix builds typically, but apparently not always, leave mathmodule.so and others as separate extension modules. -- Robert Kern "I have come to believe that the whole world is an enigm

Re: % is not an operator [was Re: Verbose and flexible args and kwargs syntax]

2011-12-15 Thread Robert Kern
but not quite, the same thing. They aren't saying that you couldn't *define* such an operator; they would just prefer that we didn't abuse the name. But really, it's their fault for using notation that looks like an operator. -- Robert Kern "I have come to believe that th

Re: Grammar for classes

2011-12-20 Thread Robert Kern
So what is this clause for? I suspect that it's harder to make a grammar rule that allows every kind of expression except for generator expressions than it is just to reuse the "testlist" rule and let the runtime reject the generator object when it goes to construct the class.

Re: Grammar for classes

2011-12-20 Thread Robert Kern
On 12/20/11 5:05 PM, Joshua Landau wrote: On 20 December 2011 10:55, Robert Kern mailto:robert.k...@gmail.com>> wrote: On 12/20/11 1:34 AM, Joshua Landau wrote: In reading thorough the syntax defined in the reference <http://docs.python.org/py3k/__

Re: Elementwise -//- first release -//- Element-wise (vectorized) function, method and operator support for iterables in python.

2011-12-21 Thread Robert Kern
pe. In order to handle old-style classes, it checks for the type using .__class__ first. ElementProxy's __getattribute__() gets in the way here by returning a generator instead of the ElementProxy class. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless

Re: Elementwise -//- first release -//- Element-wise (vectorized) function, method and operator support for iterables in python.

2011-12-22 Thread Robert Kern
able experience. You can point out the flaws of Elementwise's implementation and compare it to the virtues of PEP 225 without being so demanding. He doesn't "need to tell" you a damn thing. -- Robert Kern "I have come to believe that the whole world is an enigma,

Re: Elementwise -//- first release -//- Element-wise (vectorized) function, method and operator support for iterables in python.

2011-12-22 Thread Robert Kern
On 12/21/11 5:07 PM, Paul Dubois wrote: You're reinventing Numeric Python. Actually, he's not. The numerical operators certainly overlap, but Elementwise supports quite a bit more generic operations than we ever bothered to implement with object arrays. -- Robert Kern "

<    4   5   6   7   8   9   10   11   12   13   >