ome kind of
tree with bitwise digit packing?) would not fit in memory on any box I
own.
I would wonder if loading that much data isn't slower than solving the
puzzle.
--
John Krukoff <[EMAIL PROTECTED]>
Land Title Guarantee Company
--
http://mail.python.org/mailman/listinfo/python-list
ule = new.module( 'plot' )
>>> plotModule.AddPlot = AddPlot
>>> plotModule.DrawPlots = DrawPlots
>>> sys.modules[ 'plot' ] = plotModule
Then, you can import your fake module from anywhere, and access its
contents.
>>> import plot
>>> plot
>>> plot.AddPlot
Hope that helps.
-
John Krukoff
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
are
> > >> responsible for bringing AddPlot and DrawPlots into the current
> > >> namespace?
> > >> Import the same things in your second module.
> > >
> > > No, I *don't* have any import statement mainscript.py. When using this
> > > software
ilman/listinfo/python-list
It is worth noting that there's a bridge available to allow python to
integrate cleanly with R, the Rpy project:
http://rpy.sourceforge.net/
Which should allow you to use python for whatever it is you need without
abandoning R for your mathematical/statistical work.
-
John Krukoff
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
as
there is a space or tab character imeediately after the CRLF. If my
interpretation is correct (I've never tried this), then this would be a
legal multi-line value.
Testcases:
tct123
tct124
tct101
It looks like you'd just get this back as the string 'tct123 tct124 tct101'
though, so you'd have to split on whitespace to get the individual values.
And, well, if you want to support whitespace in your value names, I don't
think this will work at all.
-
John Krukoff
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:python-
> [EMAIL PROTECTED] On Behalf Of Phoe6
> Sent: Wednesday, June 20, 2007 8:51 PM
> To: python-list@python.org
> Subject: Re: Reading multiline values using ConfigParser
>
> On Jun 20, 10:35 pm, "Jo
how in listItem, noShowList ) ) ) ) == len( noShowList) else False,
myList ) )
['item four']
Which can be made to look much better by breaking the 'noShow in listItem'
test out into a separate function, and does have the advantage that by using
itertools.ifilter this is a lazy approach. There's got to be a better way to
do the test to see if takewhile bailed early than using len, though.
-
John Krukoff
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
John Krukoff wrote:
>
> [EMAIL PROTECTED] wrote:
> > Hi,
> >
> > I'm playing around with list comprehension, and I'm trying to find the
> > most aesthetic way to do the following:
> >
> > I have two lists:
> >
> > noShowList =
g anything after creating this data structure as it starts swapping to
disc.
My architechtural suggestion would be to refactor this as an iterator if at
all possible, so as to avoid the massive allocation burden.
-
John Krukoff
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
3D_xhatches():
list_of_kwargs = [
{pos:[ x, -hatch_length, 0], axis:[0, 2 * hatch_length, 0 ]},
{pos:[ x, 0, -hatch_length], axis:[0, 0, 2 * hatch_length ]},
And so on for all permutations...
]
for x in xrange(-axis_length, axis_length + 1):
if x == 0:
con
x27;ServiceModule' )
>>> compiled = compile( '''...some code here...''', '', 'exec',
0, 1 )
>>> exec compiled in service.__dict__
You could probably shorten it for your needs by using execfile instead.
If it's not in
.kamaelia.org/Home). Are these actually similar or am I
missing something important that differentiates circuits?
--
John Krukoff
Land Title Guarantee Company
--
http://mail.python.org/mailman/listinfo/python-list
t;", line 1, in
TypeError: foo() takes exactly 3 non-keyword arguments (2 given)
Is it even possible to get an error message in terms of required keyword
arguments? I seem to remember seeing a note about keyword only arguments
recently...
--
John Krukoff <[EMAIL PROTECTED]>
Land Title Guarantee Company
--
http://mail.python.org/mailman/listinfo/python-list
gt; os.doesnotexist
Traceback (most recent call last):
File "", line 1, in
AttributeError: 'module' object has no attribute 'doesnotexist'
>>> class os( object ):
... pass
...
>>> os.doesnotexist
Traceback (most recent call last):
File "", line 1, in
AttributeError: type object 'os' has no attribute 'doesnotexist'
--
John Krukoff <[EMAIL PROTECTED]>
Land Title Guarantee Company
--
http://mail.python.org/mailman/listinfo/python-list
people who argued
for this came from. But, if you'd just like a bit of discouragement,
here's GvR arguing that there's just no good way to mix statements and
expressions in python:
http://www.artima.com/weblogs/viewpost.jsp?thread=147358
--
John Krukoff
Land Title Guarantee Company
--
http://mail.python.org/mailman/listinfo/python-list
t;
> Diez
While I firmly believe lxml is the best python XML library available,
being built on libxml2 means that it only supports XSLT 1.0. As far as I
know, if you want 2.0 support, you still need to be using one of the
Java XSLT processors.
--
John Krukoff
Land Title Guarantee Company
--
http://mail.python.org/mailman/listinfo/python-list
ar as I know it's the only way to get partial transfers,
though.
Also, are you sure you're dealing with v1 tags and not v2? Since v2 tags are
stored at the beginning (or sometimes end with v2.4) of the file. You might
be better off just opening the file with urllib2 and handing it off
n.org/mailman/listinfo/python-list
It doesn't look like you can, with mutagen. So, time to find a different
library that supports arbitrary file objects instead of only file paths.
I'd suggest starting here:
http://pypi.python.org/pypi?%3Aaction=search&term=id3&submit=search
Possibly one with actual documentation, since that would also be a step
up from mutagen.
--
John Krukoff <[EMAIL PROTECTED]>
Land Title Guarantee Company
--
http://mail.python.org/mailman/listinfo/python-list
On Thu, 2008-05-15 at 17:11 -0600, John Krukoff wrote:
> On Thu, 2008-05-15 at 15:35 -0700, max wrote:
> > On May 15, 6:18 pm, MRAB <[EMAIL PROTECTED]> wrote:
> > > On May 15, 9:00 pm, max <[EMAIL PROTECTED]> wrote:
> > >
> > > > you're r
On Thu, 2008-05-15 at 17:32 -0600, John Krukoff wrote:
> On Thu, 2008-05-15 at 17:11 -0600, John Krukoff wrote:
> > On Thu, 2008-05-15 at 15:35 -0700, max wrote:
> > > On May 15, 6:18 pm, MRAB <[EMAIL PROTECTED]> wrote:
> > > > On May 15, 9:
On Thu, 2008-05-15 at 17:42 -0600, John Krukoff wrote:
> On Thu, 2008-05-15 at 17:32 -0600, John Krukoff wrote:
> > On Thu, 2008-05-15 at 17:11 -0600, John Krukoff wrote:
> > > On Thu, 2008-05-15 at 15:35 -0700, max wrote:
> > > > On May 15, 6:18 pm, MRAB <[EMAI
even then it'd be easy to make a wrapper function that made that
easy given a collection of loggers.
--
John Krukoff <[EMAIL PROTECTED]>
Land Title Guarantee Company
--
http://mail.python.org/mailman/listinfo/python-list
On Wed, 2008-06-11 at 00:43 +0200, Christian Heimes wrote:
> John Krukoff wrote:
> > Since you probably want access to these from many different places in
> > your code, I find the simplest way is to create a logging module of your
> > own (not called logging, obviously) a
t;
Which'll work fine, unless you end up with a repeated value such as:
a = [ 108, 58, 68, 108 ]
If you have to deal with that, would need a more complicated solution to
find the first free index slot of the available choices.
--
John Krukoff <[EMAIL PROTECTED]>
Land Title Guarantee Company
--
http://mail.python.org/mailman/listinfo/python-list
108, 0), (58, 1), (68, 2)]
>>> result = [ None, ] * len( listToSort )
>>> for sortedIndex, ( ignoredValue, originalIndex ) in
enumerate( sorted( decorated ) ):
... result[ originalIndex ] = sortedIndex
...
>>> result
[2, 0, 1]
--
John Krukoff <[EMAIL PROTECTED]>
Land Title Guarantee Company
--
http://mail.python.org/mailman/listinfo/python-list
> Any help would be appreciated.
> >>
> >> --
> >> http://mail.python.org/mailman/listinfo/python-list
> >>
> >>
> >
> >
> >
> >
>
> --
> http://mail.python.org/mailman/listinfo/python-list
Sorry, problem was
On Mon, 2008-07-28 at 16:00 -0700, iu2 wrote:
> On Jul 29, 12:10 am, John Krukoff <[EMAIL PROTECTED]> wrote:
> > On Mon, 2008-07-28 at 16:24 -0500, Ervan Ensis wrote:
> > > My programming skills are pretty rusty and I'm just learning Python so
> > > this pro
On Wed, 2008-07-30 at 12:06 -0700, Tobiah wrote:
> On Mon, 28 Jul 2008 23:41:51 -0700, iu2 wrote:
>
> > On Jul 29, 3:59 am, John Machin <[EMAIL PROTECTED]> wrote:
> >> On Jul 29, 8:10 am, John Krukoff <[EMAIL PROTECTED]> wrote:
> >>
> >>
>
t;>> sorted(range(len(s)), key=s.__getitem__)
> >
> > [1, 2, 0]
> >
>
> To get the desired output you have to apply it twice:
> >>> sorted(range(len(s)), key=sorted(range(len(s)),
> >>> key=s.__getitem__).__getitem__)
> [2, 0, 1]
>
>
rinting a number to
the screen certainly counts as. You might try again with a set of loops
that only increment, and don't print, and you may more obviously see the
GIL in action.
--
John Krukoff <[EMAIL PROTECTED]>
Land Title Guarantee Company
--
http://mail.python.org/mailman/listinfo/python-list
My question is: Is there a robust generic type of implementation of
> __repr__ which I can use instead?
>
> This is something I plan to reuse for many different Value classes, so
> I would like to get it robust.
>
> Thanks,
> Slaunger
> --
> http://mail.python.org/
our hashing code, that looks fine, if I were you
I'd try and figure out what's going wrong with your file handles. I
would suspect that in where ever you saw your short read, you were
likely not opening the file in the correct mode or did not rewind the
file ( with file.seek( 0 ) ) af
there's no
expectation of a python 3.0 compatible version of psyco, either.
--
John Krukoff <[EMAIL PROTECTED]>
Land Title Guarantee Company
--
http://mail.python.org/mailman/listinfo/python-list
-list
The maketrans interface is a bit clunky, but this is what
string.translate is best at:
>>> import string
>>> '-./other'.translate( string.maketrans( '', '' ), '-./' )
'other'
It'd be interesting to see where it falls in the benchmarks, though.
It's worth noting that the interface for translate is quite different
for unicode strings.
--
John Krukoff <[EMAIL PROTECTED]>
Land Title Guarantee Company
--
http://mail.python.org/mailman/listinfo/python-list
Another solution using the itertools module:
>>> import itertools
>>> t = ( ( 1, 2 ), ( 3, 4 ), ( 5, 6 ) )
>>> list( itertools.chain( *t ) )
[1, 2, 3, 4, 5, 6]
Though the list part is probably unnecessary for most uses. The problem
gets interesting when you want to recursively flatten an iterable of
arbitratrily deeply nested iterables.
--
John Krukoff <[EMAIL PROTECTED]>
Land Title Guarantee Company
--
http://mail.python.org/mailman/listinfo/python-list
__builtin__ module, and it'll be automatically imported
whenever you run python.
I'd doubt there's a case for getting this functionality added to the
language, as your use case seems pretty specific, and it's just not that
hard to write the function that does what you want to do.
--
John Krukoff <[EMAIL PROTECTED]>
Land Title Guarantee Company
--
http://mail.python.org/mailman/listinfo/python-list
te match what the OP's nsplit function did, as his n
parameter (maxsplit here) actually specified the number of list items in
the result, not the number of splits to perform. Which makes matching
the default split parameters kind of pointless, as why bother doing all
this work to return a
d an external
dependency.
As far as I know, both 4suite and lxml (my personal favorite:
http://codespeak.net/lxml/) support XSLT in python.
It might work out fine for you, but mixing regexps and XML always seems to
work out badly in the end for me.
-
John Krukoff
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
ne
> signal.signal(signal.SIGSLRM, handler), an attributeError appeared
> reading that 'module' object has no attribute 'SIGALRM'
> --
> http://mail.python.org/mailman/listinfo/python-list
Are you writing your program on windows, or some other platform which is
not unix?
--
John Krukoff <[EMAIL PROTECTED]>
Land Title Guarantee Company
--
http://mail.python.org/mailman/listinfo/python-list
15:38:58)
[GCC 4.1.2 (Gentoo 4.1.2 p1.1)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import signal
>>> signal.alarm( 1 )
0
>>> Alarm clock
(Interpreter exits)
--
John Krukoff <[EMAIL PROTECTED]>
Land Title Guarantee Company
--
http://mail.python.org/mailman/listinfo/python-list
ttp://marketing.openoffice.org/ooocon2004/presentations/friday/timmermann_digital_signatures.pdf
> [2] http://xmlsig.sourceforge.net/build.html
> [3] http://kelpi.com/script/00cd7c
> [4]
> http://java.sun.com/javase/6/docs/technotes/guides/security/xmldsig/XMLDigitalSignature.html
> --
> h
...
If you encode using UTF-8, you don't need to worry about the http://codespeak.net/lxml/parsing.html#python-unicode-strings
You may also find the target parser interface to be more accepting of
unicode than iterparse, though it requires a different parsing interface:
http://codespeak.net/lxml/parsing.html#the-target-parser-interface
--
John Krukoff <[EMAIL PROTECTED]>
Land Title Guarantee Company
--
http://mail.python.org/mailman/listinfo/python-list
stening on a domain socket?
>
> I'm am thinking there would be a need to have a semaphore, and some
> ACK or NACK that the server process got the whole pickle.
> --
> http://mail.python.org/mailman/listinfo/python-list
Quick bit of advice, don't reinvent the wheel, use PYRO:
man/listinfo/python-list
Well, you could just do the test (and the count!) in the xpath
expression:
count( //tr/td[ text() != "" ] )
It sounds like you're not familiar with xpath? I would recommend the
O'Reilly XSLT book, it has an excellent introduction to xpath in chapter
3.
--
John Krukoff <[EMAIL PROTECTED]>
Land Title Guarantee Company
--
http://mail.python.org/mailman/listinfo/python-list
ython.org/mailman/listinfo/python-list
--
John Krukoff <[EMAIL PROTECTED]>
Land Title Guarantee Company
--
http://mail.python.org/mailman/listinfo/python-list
standard level of broken one finds most often on the web. And, when it
falls down, it's easy to integrate BeautifulSoup as a slow backup for
when things go really wrong (as J Kenneth King mentioned earlier):
http://codespeak.net/lxml/lxmlhtml.html#parsing-html
At least in my experience, I h
s, whatever they are.
This is one of those places where the GIL is a good thing, and makes
your life simpler. You could consider it that the interpreter does the
locking for you for such primitive operations, if you like.
--
John Krukoff
Land Title Guarantee Company
--
http://mail.python.org/mai
e
> the formal rules for this behavior?
Don't forget about the similar "not in", as in:
>>> 'a' not in 'abc'
False
This is probably the section of documentation you want:
http://docs.python.org/reference/expressions.html#notin
--
John Krukoff
Land Title Guarantee Company
--
http://mail.python.org/mailman/listinfo/python-list
It's pretty simple minded, but this recipe from the element tree
documentation may do what you want:
http://effbot.org/zone/element-lib.htm#prettyprint
--
John Krukoff
Land Title Guarantee Company
--
http://mail.python.org/mailman/listinfo/python-list
of what
you're running for development.
--
John Krukoff
Land Title Guarantee Company
--
http://mail.python.org/mailman/listinfo/python-list
ng, but it doesn't look like this project even
has a python version. So, why is it on the python-announce list?
--
John Krukoff
Land Title Guarantee Company
jkruk...@ltgc.com
--
http://mail.python.org/mailman/listinfo/python-list
Have you ruled out the possibility that collections.Mapping has been
(perhaps temporarily) assigned to something else?
On Thu, Jan 18, 2018 at 2:37 PM, Jason Swails
wrote:
> Hello!
>
> I am running into a very perplexing issue that is very rare, but creeps up
> and is crashing my app.
>
> The ro
52 matches
Mail list logo