Re: Python recursive tree, linked list thingy

2012-03-08 Thread Robert Kern
t for this: http://mentat.za.net/source/connected_components.tar.bz2 http://mentat.za.net/cgi-bin/hgwebdir.cgi/ccomp -- 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

Re: Raise X or Raise X()?

2012-03-12 Thread Robert Kern
so prefer to always raise instances of exceptions rather than bare exception classes. It simplifies the mental model. -- 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

Re: concatenate function

2012-03-13 Thread Robert Kern
pletion of other jobs. You will need to read the documentation of your job queue to figure out how to do this. Once you figure out the right arguments to give to qsub, your Python code is already more or less correct. -- Robert Kern "I have come to believe that the whole world is an enigma

Re: concatenate function

2012-03-13 Thread Robert Kern
On 3/13/12 3:59 PM, ferreirafm wrote: Hi Robert, Thanks for you kind replay and I'm sorry for my semantic mistakes. Indeed, that's what I'm doing: qsub-ing different cshell scripts. Certainly, that's not the best approach and the only problem. It's not a problem to wr

Re: concatenate function

2012-03-13 Thread Robert Kern
On 3/13/12 6:01 PM, ferreirafm wrote: Robert Kern-2 wrote When you report a problem, you should copy-and-paste the output that you got and also state the output that you expected. I have no idea what you mean when you say "subprocess.Popen seems not accept to run "qsub" over a

Re: Enchancement suggestion for argparse: intuit type from default

2012-03-15 Thread Robert Kern
es. Not all type(default) types can be called with a string to produce a valid value. Note that "type=" is really a misnomer. argparse doesn't really want a type object there; it wants a converter function that takes a string to an object. -- Robert Kern "I have come to beli

Re: Python is readable

2012-03-15 Thread Robert Kern
of Python's indentation-based ancestors, ABC. Those studies found, empirically, that having the colons helped people read and understand the code faster. -- 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 atte

Re: Python is readable

2012-03-15 Thread Robert Kern
's an unintended side effect. The (automated) syntax highlighting was added to the FAQ much, much later than that entry was written. The syntax highlighting tool does not recognize the first example as Python, so it does not apply Python syntax highlighting to it. -- Robert Kern "I have come

Re: Why not use juxtaposition to indicate function application

2012-03-16 Thread Robert Kern
al language. We just don't do partial function application all that frequently to make it a language feature. Leaving out an argument is a common enough mistake, though, and using curry-by-default would postpone the error and make for even more inscrutable error messages. -- Robert K

Re: avoid import short-circuiting

2012-03-16 Thread Robert Kern
ion myself, but that should not be too hard.. You want to monkeypatch __builtin__.__import__() instead. It always gets called. -- 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 th

Re: avoid import short-circuiting

2012-03-16 Thread Robert Kern
On 3/16/12 10:04 PM, Andrea Crotti wrote: On 03/16/2012 05:19 PM, Robert Kern wrote: On 3/16/12 4:49 PM, Andrea Crotti wrote: I started the following small project: https://github.com/AndreaCrotti/import-tree because I would like to find out what exactly depends on what at run-time, using an

Re: avoid import short-circuiting

2012-03-16 Thread Robert Kern
.orig(). By the way, you really should follow my example of getting the .__name__ from the module object instead of the argument in order to properly account for relative imports inside packages. __import__() will be passed the relative name, not the fully-qualified name. -- Robert Kern "I ha

Re: Python is readable

2012-03-19 Thread Robert Kern
to accord (descriptively) with the uses the "look good" and "look bad" to me: don't use a colon to separate a transitive verb from its objects. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our o

Re: Distribution

2012-03-20 Thread Robert Kern
on, and it doesn't match the rest of your use case. So what do you mean by “distribution”? Maybe we can find a less confusing term. Judging from the context, he means a probability distribution. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma t

Re: Distribution

2012-03-20 Thread Robert Kern
hts))] kind_max = kind_cumsum[-1] max_time = 10.0 # sec t = 0.0 # sec events = [] # (t, kind) while t < max_time: dt = prng.expovariate(avg_rate) u = prng.uniform(0.0, kind_max) kind = bisect.bisect_left(kind_cumsum, u) events.append((t, kind)) t += dt -- Robert Kern "

Re: random number

2012-03-26 Thread Robert Kern
of the set of its digits? I would consider that to be a very odd interpretation of that request. But it *is* an extraordinarily vague request. I'm not sure if even the OP knows what he wants. I suspect he really wants something like a hash. -- Robert Kern "I have come to believe that th

Re: random number

2012-03-26 Thread Robert Kern
nd(characters[0]) ... return ''.join(coll_rand) ... >>> id = 5 >>> print (random_number(id)) puMHCr >>> -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our ow

Re: Is there any difference between print 3 and print '3' in Python ?

2012-03-26 Thread Robert Kern
ou can see, the only difference is in the first instruction. Both of these put the object that you specified by the literal onto the stack. The difference is that one is the int object specified by the literal 3 and the other is the str object specified by the literal "3". Both of these ob

Re: Puzzled by FiPy's use of "=="

2012-03-26 Thread Robert Kern
py/browser/trunk/fipy/terms/term.py#L374 -- 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: Question about collections.defaultdict

2012-03-26 Thread Robert Kern
s.defaultdict.__missing__ -- 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: Question about collections.defaultdict

2012-03-26 Thread Robert Kern
On 3/26/12 4:33 PM, Steven W. Orr wrote: On 3/26/2012 9:44 AM, Robert Kern wrote: On 3/26/12 2:33 PM, Steven W. Orr wrote: I created a new class called CaseInsensitiveDict (by stealing from code I found on the web, thank you very much). The new class inherits from dict. It makes it so that if

Re: Threads on google groups not on gmane?

2012-04-02 Thread Robert Kern
kit for Easy GUIs in Python" and "weird behaviour: pygame plays in shell but not in script". Is anyone else seeing the same thing? I also don't see these on GMane. It's possible that they are getting caught in one of GMane's several levels of spam filtering. http:

Re: Python Gotcha's?

2012-04-05 Thread Robert Kern
I'm not sure it deserves to be called a wart. The wart is not that it fails, but that it does not fail atomically. The list inside the tuple gets modified even though an exception is raised for the statement as a whole. -- Robert Kern "I have come to believe that the whole world is

Re: why () is () and [] is [] work in other way?

2012-04-20 Thread Robert Kern
ct 4 2011, 20:03:08) [GCC 4.6.1] ) Is this what it should be or maybe yielding unified result is better? If your code is relying on the difference, or a lack of one, it's buggy. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made

Re: why () is () and [] is [] work in other way?

2012-04-21 Thread Robert Kern
te to True? Where can I read that the result *must* be False? http://docs.python.org/reference/expressions.html#list-displays "A list display yields a new list object." -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made ter

Re: why () is () and [] is [] work in other way?

2012-04-23 Thread Robert Kern
why. Because the language definition should not be what CPython does. It isn't. That's the point of leaving some things like the interning of certain special objects undefined, to make room for other implementations. You seem to be objecting to that for some bizarre reason. -- Rob

Re: why () is () and [] is [] work in other way?

2012-04-23 Thread Robert Kern
behave identically everywhere where you don't directly ask the question of "a is b" or "id(a) == id(b)". Not always. NaNs are an exception - they don't even compare equal to themselves. And hence a very good reason why "is" and == are separate operations. I

Re: why () is () and [] is [] work in other way?

2012-04-26 Thread Robert Kern
do? Return the address modulo 4G? It returns a Python long. Python 2.7.3 (default, Apr 10 2012, 23:24:47) [MSC v.1500 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.m

Re: why () is () and [] is [] work in other way?

2012-04-27 Thread Robert Kern
rnative implementations like Jython and IronPython. There are specific, deliberate, practical consequences of those two implementation-defined behaviors. These are the babies that you would be throwing out. -- Robert Kern "I have come to believe that the whole world is an enigma, a harm

Re: setting an array element with sequence problem problem

2012-04-27 Thread Robert Kern
if self.nout == 1: 1881 _res = array(self.ufunc(*newargs),copy=False, -> 1882 subok=True,dtype=self.otypes[0]) 1883 else: 1884 _res = tuple([array(x,copy=False,subok=True,dtype=c) \ ValueError: setting an array element with a seque

Re: algorithm does python use to compare two strings

2012-04-29 Thread Robert Kern
th == and != (but not the others, naturally). -- 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: numpy (matrix solver) - python vs. matlab

2012-05-01 Thread Robert Kern
edit slash" but this seems to be internal so I cannot see what criteria the warning is based upon... The documentation for that operator is here: http://www.mathworks.co.uk/help/techdoc/ref/mldivide.html -- Robert Kern "I have come to believe that the whole world is an enigma, a harm

Re: Looking for proven Python code for Line Simplication such as Douglas-Peucker

2012-05-08 Thread Robert Kern
On 5/8/12 10:38 AM, David Shi wrote: Dear All, I am looking for proven Python code for Line Simplication such as Douglas-Peucker. https://svn.enthought.com/svn/enthought/EnthoughtBase/trunk/enthought/util/dp.py -- Robert Kern "I have come to believe that the whole world is an enig

Re: How do I find out what file an import is using?

2012-05-09 Thread Robert Kern
mport Level3Utils print Level3Utils.__file__ -- 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/

Re: installing modules in Enthought Python

2012-05-30 Thread Robert Kern
Users\Robert\Downloads\feedparser-5.1.2> python setup.py install You can read more thorough documentation on how to use distutils setup.py scripts in the Python documentation: http://docs.python.org/install/index.html I hope that helps. If not, please send let us know on . Thank you! -

Re: ./configure

2012-06-03 Thread Robert Kern
f-box. You have to install one. You can either install Xcode using the App Store, or register for an Apple ID and download the "Command Line Tools for Xcode" if you don't want the full Xcode IDE: https://developer.apple.com/downloads/index.action -- Robert Kern "I have

Re: Some posts do not show up in Google Groups

2012-06-08 Thread Robert Miles
s are moving toward newsgroups where no one reports the spam. Robert Miles -- http://mail.python.org/mailman/listinfo/python-list

Re: Some posts do not show up in Google Groups

2012-06-08 Thread Robert Miles
they get that contains any HTML. This may be because Google Groups often adds HTML even if you don't ask for it, and those servers want to avoid the poor signal to noise ratio from Google Groups. Robert Miles -- http://mail.python.org/mailman/listinfo/python-list

Re: Create directories and modify files with Python

2012-06-08 Thread Robert Miles
ery slowly - as in 5 minutes after I tell it to post. Robert Miles -- http://mail.python.org/mailman/listinfo/python-list

Sybase module 0.40 released

2012-06-11 Thread Robert Boehne
WHAT IS IT: The Sybase module provides a Python interface to the Sybase relational database system. It supports all of the Python Database API, version 2.0 with extensions. The module is available here: http://downloads.sourceforge.net/python-sybase/python-sybase-0.40.tar.gz The module home p

Re: float("nan") in set or as key

2011-06-02 Thread Robert Kern
mation. >>> inf = 1e300*1e300 >>> nan = inf / inf >>> import cPickle >>> cPickle.loads(cPickle.dumps(nan)) nan >>> cPickle.loads(cPickle.dumps(inf)) inf -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is

Re: Best way to compute length of arbitrary dimension vector?

2011-06-03 Thread Robert Kern
f elements will be large enough to matter, though. -- 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.or

Re: float("nan") in set or as key

2011-06-04 Thread Robert Kern
any more. The decimal module mostly gets it right. It translates the signals into Python exceptions that can be disabled in a particular context. -- 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 inter

Re: float("nan") in set or as key

2011-06-05 Thread Robert Kern
On 6/4/11 9:03 PM, Steven D'Aprano wrote: On Sat, 04 Jun 2011 16:49:40 -0500, Robert Kern wrote: Steven is being a little hyperbolic. Python does not fully conform to all of the details of the IEEE-754 specification, though it does conform to most of them. I'm not sure that "m

Re: Question About Command line arguments

2011-06-10 Thread Robert Kern
pt's standard input. How do I write my script so it picks up argument from the output of commands that pipe input into my script? You may want to just use the appropriate shell syntax instead: $ python myscript `echo fred` -- Robert Kern "I have come to believe that the whole worl

Re: data type and logarithm

2011-06-16 Thread Robert Kern
transpositions. We can't have the underlying memory change out from underneath us. This is one of the worst ways to accumulate values into a numpy array. -- 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

get() attribute for Entry in Tkinter

2011-06-29 Thread Robert Upton
Dear Pythoners, I am in the process of generating a simple GUI that wants to read a string and print it to the terminal after engaging a button. I am running into a problem where Python says it does not understand the get() attribute for Entry. My code is very simple and is shown below. Please

Re: show() in pylab doesn't work if used twice

2011-07-06 Thread Robert Kern
on of matplotlib than 1.0.0. The ability to use show() more than once was only added in 1.0.0: http://matplotlib.sourceforge.net/faq/howto_faq.html#use-show -- 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: Question- Getting Windows 64bits information Python 32bits

2011-07-07 Thread Robert Kern
led for. platform.architecture() gives the latter. -- 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: Python ++ Operator?

2011-07-16 Thread Robert Kern
have to separately learn how they combine. -- 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: a little parsing challenge ☺

2011-07-17 Thread Robert Klemme
On 07/17/2011 11:48 AM, Raymond Hettinger wrote: On Jul 17, 12:47 am, Xah Lee wrote: i hope you'll participate. Just post solution here. Thanks. http://pastebin.com/7hU20NNL Ruby solution: https://gist.github.com/1087583 Kind regards robert -- http://mail.python.org/mailman/lis

Re: a little parsing challenge ☺

2011-07-17 Thread Robert Klemme
On 07/17/2011 03:55 PM, mhenn wrote: Am 17.07.2011 15:20, schrieb Robert Klemme: On 07/17/2011 11:48 AM, Raymond Hettinger wrote: On Jul 17, 12:47 am, Xah Lee wrote: i hope you'll participate. Just post solution here. Thanks. http://pastebin.com/7hU20NNL Ruby solution:

Re: a little parsing challenge ☺

2011-07-17 Thread Robert Klemme
On 07/17/2011 06:01 PM, Robert Klemme wrote: On 07/17/2011 03:55 PM, mhenn wrote: Am 17.07.2011 15:20, schrieb Robert Klemme: On 07/17/2011 11:48 AM, Raymond Hettinger wrote: On Jul 17, 12:47 am, Xah Lee wrote: i hope you'll participate. Just post solution here. Thanks. http://pastebi

Re: a little parsing challenge ☺

2011-07-19 Thread Robert Klemme
oes the recursive parsing -report file if the match is shorter than the file Note: special feature for recursive matching is used which Perl's regexp engine likely can do as well but many others don't. Cheers robert -- remember.guy do |as, often| as.you_can - without en

Re: Strange output from arange()

2011-07-25 Thread Robert Kern
et exactly nSegments segments with exact endpoints, you should use numpy.linspace(0.0, 1.0, nSegments+1). That's a much better API for what you want. Also, you will want to ask numpy questions on the numpy-discussion mailing list, not here. http://www.scipy.org/Mailing_Lists -- Robert Ker

Suggestions on writing a sh <--> python Howto/Tutorial

2011-07-27 Thread Robert Laing
I've been tinkering around learning traditional Unix shell programming and python at the same time. I set myself the following exercise which I found quite educational. I first wrote a shell CGI script to read the man pages on my web hosting service's computer via a browser like so: http:///rtfm.

Re: PyWart: os.path needs immediate attention!

2011-07-30 Thread Robert Kern
suspect this may be an instance of the latter case. -- 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: [ANN] IPython 0.11 is officially out

2011-08-02 Thread Robert Kern
riate lines and put in your values. You are right that the HOWTO migrate documentation is missing. It's an oversight that you can help remedy. -- 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: Replacement for the shelve module?

2011-08-19 Thread Robert Kern
For what you're doing, I would give PyTables a try. For a few gigs of stock price data, this is what I use. Much better than SQLite for that amount of data. -- 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: Replacement for the shelve module?

2011-08-19 Thread Robert Kern
igeur and work much better than decimals (either floating or fixed point). If you are collecting gigs of stock prices, you are much more likely to be doing the latter than the former. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made ter

Re: PC locks up with list operations

2011-08-31 Thread Robert Spanjaard
ill VLC yourself. >>> mylist = [0]*12345678901234 Traceback (most recent call last): File "", line 1, in MemoryError -- Regards, Robert http://www.arumes.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Python fails on math

2011-02-24 Thread Robert Kern
results of an expression in the larger-precision FPU registers. The final result does get shoved back into a 64-bit double when it is at last assigned back to a variable or passed to a function that takes a double. -- Robert Kern "I have come to believe that the whole world is an eni

Re: question about numpy.polyval

2011-02-28 Thread Robert Kern
were expecting to get. Make sure you use variable names consistently. For example, you refer to a "plot of fita", but nothing in your code assigns to "fita". Thanks. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that i

Re: OT: Code Examples

2011-03-01 Thread Robert Kern
from having an example of what you would write de novo, but it might help give you strategies for the process of translating your own FORTRAN and C engineering codes. http://clearclimatecode.org/ -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma t

Re: Numerical representation

2011-03-04 Thread Robert Kern
ering (and honestly doesn't help much when implementing an RK integrator, except as input and output data structures). Python, numpy, and MATLAB all use double-precision floating point numbers by default. -- Robert Kern "I have come to believe that the whole world is an enigma, a harm

Re: Numerical representation

2011-03-04 Thread Robert Kern
point number. This can create the perception that MATLAB is doing things more accurately. -- 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

Re: Numerical representation

2011-03-07 Thread Robert Kern
:1:13 Xtemp2=Xtemp2+ch(l)*k(:,l); end x=xwrk + dt * Xtemp2; t=twrk+dt; You may want to try printing out values in both implementations to see where they start to diverge. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigm

Re: questions about multiprocessing

2011-03-07 Thread Robert Kern
this as well: you can't pass methods to pool.map() or any other such communication channel to your subprocesses. -- 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 ha

Re: argparse, tell if arg was defaulted

2011-03-15 Thread Robert Kern
m warning you that you did not specify a --foo argument.' print 'Using default=bar.' -- 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: argparse, tell if arg was defaulted

2011-03-15 Thread Robert Kern
On 3/15/11 12:46 PM, Neal Becker wrote: Robert Kern wrote: On 3/15/11 9:54 AM, Neal Becker wrote: Is there any way to tell if an arg value was defaulted vs. set on command line? No. If you need to determine that, don't set a default value in the add_argument() method. Then just chec

Re: argparse and filetypes

2011-03-22 Thread Robert Kern
' % string) return super(TxtFile, self).__call__(string) ... parser.add_argument('infile', type=TxtFile('r')) -- 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: May I discuss here issues on Machine Learning?

2011-03-23 Thread Robert Kern
for these models. MetaOptimize is a much better forum for these questions: http://metaoptimize.com/qa/ -- 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

Re: argparse csv + choices

2011-03-30 Thread Robert Kern
- set(self.choices)) if remainder: raise ValueError("invalid choices: %r (choose from %r)" % (remainder, self.choices)) return args parser = argparse.ArgumentParser() parser.add_argument('--cheat', type=ChoiceList(['a','b'

Re: A problem about ipython

2011-04-01 Thread Robert Kern
regular shell is not written in Python, so it has no problem. You will want to ask on the IPython list for future IPython questions. http://mail.scipy.org/mailman/listinfo/ipython-user -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that

Re: a basic bytecode to machine code compiler

2011-04-02 Thread Robert Kern
counts are the primary data structures being protected. IronPython and Jython allow just as much dynamism as CPython, and they have no mechanism for "freezing" the code, but they do not have a GIL. I believe this has been pointed out to you before, but I don't think I'v

Re: Multiprocessing, shared memory vs. pickled copies

2011-04-04 Thread Robert Kern
d to make sure that the shared arrays are allocated before the Pool is started. And this only works on UNIX machines. The shared memory objects that shmarray uses can only be inherited. I believe that's what Sturla was getting at. -- Robert Kern "I have come to believe that the whol

Re: Multiprocessing, shared memory vs. pickled copies

2011-04-05 Thread Robert Kern
On 4/4/11 7:05 PM, Robert Kern wrote: On 4/4/11 3:20 PM, John Ladasky wrote: However, at least in Python 2.7, multiprocessing seems to have a C extension module defining the Connection objects. Unfortunately, it looks like this C extension just imports the regular pickler that is not aware of

Python and DDE

2011-04-06 Thread Robert Upton
win32ui import dde I get: " Traceback (most recent call last): File "", in line 1, in ImportError: This must be an MFC application - try loading with win32ui first" Any insight and help is most welcome. Thankyou, Robert -- http://mail.python.org/mailman/listinfo/python-list

Re: Multiprocessing, shared memory vs. pickled copies

2011-04-07 Thread Robert Kern
On 4/7/11 1:40 AM, John Ladasky wrote: On Apr 5, 10:43 am, Philip Semanchuk wrote: And as Robert Kern pointed out, numpy arrays are also pickle-able. OK, but SUBCLASSES of numpy.ndarray are not, in my hands, pickling as I would expect. I already have lots of code that is based on such

Re: Multiprocessing, shared memory vs. pickled copies

2011-04-07 Thread Robert Kern
On 4/7/11 1:39 PM, John Ladasky wrote: On Apr 7, 10:44 am, Robert Kern wrote: On 4/7/11 1:40 AM, John Ladasky wrote: On Apr 5, 10:43 am, Philip Semanchukwrote: And as Robert Kern pointed out, numpy arrays are also pickle-able. OK, but SUBCLASSES of numpy.ndarray are not, in my hands

Re: Literate Programming

2011-04-07 Thread Robert Kern
-- 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: argparse and default for FileType

2011-04-08 Thread Robert Kern
alize this limitation sooner. Open up a bug report on the Python bug tracker and assign it to the user "bethard", who is the author of argparse. He's usually pretty responsive. http://bugs.python.org/ -- Robert Kern "I have come to believe that the whole world is a

Re: Argument of the bool function

2011-04-09 Thread Robert Kern
't it ? No one is saying that every instance of "foo([arg])" in the docs means that the given argument is named such that it is available for keyword arguments. What people are saying is that for bool(), *that happens to be the case*. -- Robert Kern "I have come to beli

Re: Argument of the bool function

2011-04-09 Thread Robert Kern
n implementation detail. It's not worth the electrons wasted in this thread already. -- 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: Vectors

2011-04-24 Thread Robert Kern
... I will compile if it is unavoidable, but in case of numpy it does not seem a simple matter. Am I badly mistaken? On UNIX machines with compilers and headers properly installed, it's really pretty straightforward. -- Robert Kern "I have come to believe that the whole world is an

Re: Pickling extension types

2011-05-03 Thread Robert Kern
in the rest of the tuple. -- 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: Pickling extension types

2011-05-03 Thread Robert Kern
V", (PyObject*)&PyMV_Type); } C.f. http://docs.python.org/extending/newtypes.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 -- http://mail.python.org/mailman/listinfo/python-list

Re: vertical ordering of functions

2011-05-03 Thread Robert Kern
On 5/3/11 5:46 PM, MRAB wrote: On 03/05/2011 23:31, Chris Angelico wrote: On Wed, May 4, 2011 at 8:08 AM, Jabba Laci wrote: Hi, I'm just reading Robert M. Martin's book entitled "Clean Code". In Ch. 5 he says that a function that is called should be below a function t

Re: Pickling extension types

2011-05-04 Thread Robert Kern
hon code you are trying, I can't help much more. -- 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: Pickling extension types

2011-05-04 Thread Robert Kern
type object in the 0-index slot and the argument tuple in the 1-index slot. Are you saying that you just returned the argument tuple? I don't think that would work. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible

access to some text string in PDFs

2011-05-05 Thread Robert Pazur
got some Python experience) so i really appreciate any help! Kind regards, Robert. ------- Robert Pazur -- http://mail.python.org/mailman/listinfo/python-list

Re: access to some text string in PDFs

2011-05-06 Thread Robert Pazur
for line in file.xreadlines(): if "driving" in line: print(line) --- Robert Pazur Mobile : +421 948 001 705 Skype : ruegdeg 2011/5/6 Chris Rebert > On Thu, May 5, 2011 at 2:26 PM, Robert Pazur > wrote: > > Dear all, > > i would like to access s

Re: Fibonacci series recursion error

2011-05-07 Thread Robert Brown
Steven D'Aprano writes: > If you value runtime efficiency over development time, sure. There are > plenty of languages which have made that decision: Pascal, C, Java, > Lisp, Forth, and many more. I don't understand why you place Lisp and Forth in the same category as Pascal, C, and Java. Lisp

Re: Development time vs. runtime performance (was: Fibonacci series recursion error)

2011-05-08 Thread Robert Brown
Teemu Likonen writes: > * 2011-05-08T12:59:02Z * Steven D'Aprano wrote: > >> On Sun, 08 May 2011 01:44:13 -0400, Robert Brown wrote: >>> Python requires me to rewrite the slow bits of my program in C to get >>> good performance. >> >> Python doesn&

Re: scipy

2011-05-09 Thread Robert Kern
y bug tracker. -- Terry Jan Reedy Hi, the scipy mailing list? http://www.scipy.org/Mailing_Lists -- 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 underl

Re: Finding the bitness of an arbitrary executable with Python

2011-05-09 Thread Robert Kern
ets built. It is not actually examining the file referenced by sys.executable. -- 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: Slice implementation bug

2011-05-12 Thread Robert Kern
r yield etc Ofcourse I could return an iterator, but this would not be so simple. Really, it is. -- 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 trut

Re: Parsing a graph image

2011-05-13 Thread Robert Kern
to extract the data that is contained in an image file. There is nothing in Python that solves this problem, per se, but there are free and open source tools for this out there. E.g. http://digitizer.sourceforge.net/ -- Robert Kern "I have come to believe that the whole world is a

Re: unicode by default

2011-05-13 Thread Robert Kern
font that will be able to render all or 'most' (whatever I mean by that) code points in unicode? Is this a Python issue at all? Not really. -- 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 atte

Re: Parsing a graph image

2011-05-16 Thread Robert Kern
u are probably looking at the tutorials for manually digitizing graphs. Check out this one: http://digitizer.sourceforge.net/usermanual/tutorautolinegraph.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

<    1   2   3   4   5   6   7   8   9   10   >