Re: Error in "Import gv " module

2013-04-22 Thread Andreas Perstinger
" errors?: https://code.google.com/p/python-graph/issues/list?can=1&q=import+gv&colspec=ID+Type+Status+Priority+Milestone+Owner+Summary&cells=tiles Bye, Andreas -- http://mail.python.org/mailman/listinfo/python-list

Re: Error in "Import gv " module

2013-04-22 Thread Andreas Perstinger
a/12698636 2) Try some other Graphviz bindings. A quick search on PyPi gave me: https://pypi.python.org/pypi/pygraphviz/1.1 https://pypi.python.org/pypi/pydot/1.0.28 https://pypi.python.org/pypi/yapgvb/1.2.0 Bye, Andreas -- http://mail.python.org/mailman/listinfo/python-list

Re: SVG rendering with Python

2005-12-15 Thread Andreas Lobinger
Aloha, richard wrote: > Dennis Benzinger wrote: >>Does anybody know of a SVG rendering library for Python? > Google "python svg" ... to find what? Whishing a happy day LOBI -- http://mail.python.org/mailman/listinfo/python-list

Re: python speed

2005-12-28 Thread Andreas Kostyrka
ning that you can do anything you can do in Python in C, C++ or Assembler. Just don't tell me that it is usual to write self-modifying assembler programs that create an optimized piece of code for combinations of argument types, like Psyco does. Andreas signature.asc Description: Dies ist ein digital signierter Nachrichtenteil -- http://mail.python.org/mailman/listinfo/python-list

Encoding sniffer?

2006-01-05 Thread Andreas Jung
Does anyone know of a Python module that is able to sniff the encoding of text? Please: I know that there is no reliable way to do this but I need something that works for most of the case...so please no discussion about the sense of such a module and approach. Andreas pgpj27jiq5WgN.pgp

Re: Encoding sniffer?

2006-01-06 Thread Andreas Jung
Thanks! --On 5. Januar 2006 18:21:39 -0600 [EMAIL PROTECTED] wrote: http://orca.mojam.com/~skip/python/ pgpyF17uM2CTT.pgp Description: PGP signature -- http://mail.python.org/mailman/listinfo/python-list

Re: pdb.py - why is this debugger different from all other debuggers?

2006-01-15 Thread Andreas Kostyrka
Actually, for many things, python -i is more then enough to test and debug code interactivly. Consider writing a settrace function, that catches any data and control flow you might be interested. Andreas > > I was disappointed not to see any replies to this. > I use pdb a lot becau

Re: pdb.py - why is this debugger different from all other debuggers?

2006-01-15 Thread Andreas Kostyrka
lty > in my mind. > For me, it is mostly useful for understanding flow of > control and how objects change as that happens. I > find it easier than constantly modifying the source code. One question that is often needed is "How did we get to this place?". Th

Re: What is a type error?

2006-07-12 Thread Andreas Rossberg
d intermediate languages within the compiler might actually help drastically cutting down on the more severe problem of code transformation bugs, notwithstanding the relative complexity of suitable internal type systems. - Andreas -- http://mail.python.org/mailman/listinfo/python-list

Re: What is a type error?

2006-07-13 Thread Andreas Rossberg
to differentiate between both concepts - pointers are just mutable objects holding other mutable objects (immutable pointer types exist, but are only interesting if you also have pointer arithmetics - which, however, is largely equivalent to arrays, i.e. not particularly relevant either).

Re: What is a type error?

2006-07-13 Thread Andreas Rossberg
words, pointers are essentially just an *aspect* of mutability >>in lower-level languages. > > Again, I disagree: it is posible to have mutability without > pointers/identity/objects. OK, if you prefer: it is an aspect of first-class mutability - which is present in almost a

Re: What is a type error?

2006-07-14 Thread Andreas Rossberg
Darren New wrote: > Andreas Rossberg wrote: > >> Yes, technically you are right. But this makes a pretty weak notion of >> mutability. All stateful data structures had to stay within their >> lexical scope, and could never be passed to a function. > > Not reall

Re: What is a type error?

2006-07-14 Thread Andreas Rossberg
mming, usually based on deep unification, brings by far the worst incarnation of aliasing issues to the table. - Andreas -- Andreas Rossberg, [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

RE: How do you implement this Python idiom in C++

2006-07-27 Thread Ames Andreas
7;should be 2') is questionable, IMHO. I think the above code has it right in this case rather than your python version (after all c isA CountedClass, isn't it?). cheers, aa -- Andreas Ames | Programmer | Comergo GmbH | Voice: +49 69 7505 3213 | ames AT avaya DOT com -- http://mail.python.org/mailman/listinfo/python-list

Find out the name of a variable passed as an argument

2006-10-04 Thread Andreas Huesgen
var2) var2 thanks in advance, greets Andreas Huesgen -- http://mail.python.org/mailman/listinfo/python-list

Re: Classes and Functions - General Questions

2006-10-18 Thread Andreas Hartl
er, I would not recommend this last solution unless you have a really, really weird problem that also heavily depends on the type of parameters. Simply stick to the first one, this will be sufficient for >90% of all cases. Andreas -- http://mail.python.org/mailman/listinfo/python-list

RE: Singleton Class Exception

2006-11-13 Thread Ames Andreas
't think so. The op wrote that he uses 2.4.3. So I guess, the problem is, that PurchaseRequisitionController inherits (directly or not) from 'object'. Although new style classes are allowed as exceptions in 2.5, an additional requirement is, that the exception must inherit from BaseExce

Negative hex to int

2006-06-14 Thread andreas . lydersen
problem is negative values. If the unit returns the hex value 'e7', it means -25, but python says it's 231: ------- >>> int('e7', 16) 231 --- Does anyone have a clue a to what I need to do? Thanks! Andreas Lydersen -- http://mail.python.org/mailman/listinfo/python-list

Re: What is Expressiveness in a Computer Language

2006-06-20 Thread Andreas Rossberg
re not a necessary ingredient of a type system, nor is "eliminating tags" very relevant to its function. - Andreas -- http://mail.python.org/mailman/listinfo/python-list

Re: What is Expressiveness in a Computer Language

2006-06-20 Thread Andreas Rossberg
les. Don't confuse type assignment with type annotation (which many mainstream languages enforce for, but also only allow for, variable declarations). - Andreas -- http://mail.python.org/mailman/listinfo/python-list

Re: What is Expressiveness in a Computer Language

2006-06-20 Thread Andreas Rossberg
ole purpose of a type system is to ensure that any expression of type T always evaluates to a value of type T. So when you look at type systems formally then you certainly have to assign types to values, otherwise you couldn't prove any useful property about those systems (esp. soundness). - Andreas -- http://mail.python.org/mailman/listinfo/python-list

Re: What is Expressiveness in a Computer Language

2006-06-20 Thread Andreas Rossberg
David Squire wrote: > Andreas Rossberg wrote: > >> Rob Thorpe wrote: >> >>>> >>>>> No, that isn't what I said. What I said was: >>>>> "A language is latently typed if a value has a property - called it's >>&

Re: What is Expressiveness in a Computer Language

2006-06-20 Thread Andreas Rossberg
Rob Thorpe wrote: >Andreas Rossberg wrote: >>Rob Thorpe wrote: >> >>>>>"A language is latently typed if a value has a property - called it's >>>>>type - attached to it, and given it's type it can only represent values >>

Re: What is Expressiveness in a Computer Language

2006-06-21 Thread Andreas Rossberg
w this is totally different from simple tagging, because it deals with real types at runtime. - Andreas -- http://mail.python.org/mailman/listinfo/python-list

Re: What is Expressiveness in a Computer Language

2006-06-21 Thread Andreas Rossberg
ructure of an expression the type system derives the type of the resulting value. An expression may contain variables, and then the type system generally must know (or be able to derive) their types too, but that's a separate issue. Most values are anonymous. Nevertheless their types are kno

Re: What is Expressiveness in a Computer Language

2006-06-21 Thread Andreas Rossberg
xplicit (in ML for example you have the option type for that purpose). - Andreas -- http://mail.python.org/mailman/listinfo/python-list

Re: What is Expressiveness in a Computer Language

2006-06-21 Thread Andreas Rossberg
that cannot be updated, it makes > no sense to call it "variable" since it isn't *able* to *vary.* > Let's call it a named constant. The name of a function argument is a variable. Its denotation changes between calls. Still it cannot be mutated. Likewise, local "consta

Re: What is Expressiveness in a Computer Language

2006-06-21 Thread Andreas Rossberg
is the encoding of these properties. A type varying over time is an inherent contradiction (or another abuse of the term "type"). - Andreas -- http://mail.python.org/mailman/listinfo/python-list

Re: What is Expressiveness in a Computer Language

2006-06-21 Thread Andreas Rossberg
* have this ability... (which is slightly different from ADTs, btw) - Andreas -- http://mail.python.org/mailman/listinfo/python-list

Re: What is Expressiveness in a Computer Language

2006-06-21 Thread Andreas Rossberg
e that does *not* have this ability... (which is slightly >>different from ADTs, btw) > > Would Java count? Yes, you are right. And there certainly are more in the OO camp. But honestly, I do not remember when I last had to actively work with one of them, including Java... :-) - Andreas -- http://mail.python.org/mailman/listinfo/python-list

Re: What is Expressiveness in a Computer Language

2006-06-21 Thread Andreas Rossberg
have this ability... (which is slightly >> different from ADTs, btw) > > Java? C#? Icon? Perl? (Hmmm... Pascal does, IIRC.) I guess you just work > with better languages than I do. :-) OK, I admit that I exaggerated slightly. Although currently I'm indeed able to mostly w

Re: What is Expressiveness in a Computer Language

2006-06-22 Thread Andreas Rossberg
Marshall wrote: >Andreas Rossberg wrote: >>Chris Uppal wrote: >> >>>I have never been very happy with relating type to sets of values (objects, >>>whatever). >> >>Indeed, this view is much too narrow. In particular, it cannot explain >>abstract

Re: What is Expressiveness in a Computer Language

2006-06-22 Thread Andreas Rossberg
omething and thereby discover its actual type at the moment[1], whereas > "manifest" means that types[2] are lexically apparent in the code. Mh, I'd say typecase is actually a form of reflection, which is yet a different issue. Moreover, there are statically typed languages

Re: What is Expressiveness in a Computer Language

2006-06-22 Thread Andreas Rossberg
arantee that a and b will always hold numbers. I'm confused. Are you telling that you just write a+b in your programs without trying to ensure that a and b are in fact numbers?? - Andreas -- http://mail.python.org/mailman/listinfo/python-list

Re: What is Expressiveness in a Computer Language

2006-06-22 Thread Andreas Rossberg
object/value/variable can be different at different times in the execution. Neither do I. But what is wrong with a mutable reference-to-union type, as I suggested? It expresses this perfectly well. - Andreas -- http://mail.python.org/mailman/listinfo/python-list

Re: What is Expressiveness in a Computer Language

2006-06-22 Thread Andreas Rossberg
of them can even infer which comparison function to pass for individual calls, so that the programmer does not have to bother.) - Andreas -- http://mail.python.org/mailman/listinfo/python-list

Re: What is Expressiveness in a Computer Language

2006-06-22 Thread Andreas Rossberg
equivalent to some already existent type). So you'd need at least a theory for name generation or something similar to describe abstract types in a types-as-sets metaphor. - Andreas -- http://mail.python.org/mailman/listinfo/python-list

Re: What is Expressiveness in a Computer Language

2006-06-22 Thread Andreas Rossberg
t; languages have a place in it. But some of the advocates of statically > typed languages wish to lump these languages together with assembly > language a "untyped" in an attempt to label them as unsafe. No, see above. And I would assume that that is how most proponents of th

Re: What is Expressiveness in a Computer Language

2006-06-23 Thread Andreas Rossberg
} Now, foo is still immutable, it is a local, but it clearly also varies. - Andreas -- http://mail.python.org/mailman/listinfo/python-list

Re: What is Expressiveness in a Computer Language

2006-06-23 Thread Andreas Rossberg
different issues). Just that you cannot naively equate types with a set of underlying values, which is what is usually meant by the types-are-sets metaphor - to capture something like type abstraction you need to do more. (Even then it might be arguable if it really describes the same thing.) - Andreas -- http://mail.python.org/mailman/listinfo/python-list

Re: What is Expressiveness in a Computer Language

2006-06-23 Thread Andreas Rossberg
either true or false (or undecidable), but it is so persistently, considered under the same context. So if you want a type system to capture temporal elements, then these must be part of a type itself. You can introduce types with implications like "in context A, this is T, in context B this is U". But the whole quoted part then is the type, and it is itself invariant over time. - Andreas -- http://mail.python.org/mailman/listinfo/python-list

Re: What is Expressiveness in a Computer Language

2006-06-26 Thread Andreas Rossberg
ou snipped addressed it well enough. Anyway, I can't believe that we actually need to argue about the fact that - for any *useful* and *practical* notion of safety - C is *not* a safe language. I refrain from continuing the discussion along this line, because *that* is *really* silly. - A

Re: What is Expressiveness in a Computer Language [correction]

2006-06-28 Thread Andreas Rossberg
u simply do *not want* to have this, even though you easily could. E.g. for OCaml, unrestricted recursive typing was removed as default because of frequent user complaints. Which is why this actually is a very bad example to chose for dynamic typing advocacy... ;-) - Andreas -- http://mail.python.org/mailman/listinfo/python-list

Re: What is Expressiveness in a Computer Language

2006-06-28 Thread Andreas Rossberg
type of the function before actually running it. Eval itself can easily be expressed on top of this as a polymorphic function, which does not run the program if it does not have the desired type: eval ['a] s = typecase compile s of f : (()->'a) -> f () _ -> rais

Re: Py2exe make wxPython window looks bad

2006-06-30 Thread Andreas Kaiser
the setup.py or as a single file in the program dir. See examples in the py2exe installation dir. Andreas -- http://mail.python.org/mailman/listinfo/python-list

RE: Python and STL efficiency

2006-08-24 Thread Ames Andreas
a dead end using python. This fact lets me use python's great strengths (like programmer efficiency etc.) without tossing and turning sleeplessly in my bed. cheers, aa -- Andreas Ames | Programmer | Comergo GmbH | Voice: +49 69 7505 3213 | ames AT avaya DOT com -- http://mail.python.org/mailman/listinfo/python-list

python reference counting and exceptions

2006-09-12 Thread Andreas Huesgen
imic the c++ code snipped above in python without adding a try-except-unlock-rethrow block around every peace of code that locks some resources. Greets, Andreas Huesgen -- http://mail.python.org/mailman/listinfo/python-list

Re: python reference counting and exceptions

2006-09-13 Thread Andreas Huesgen
onstruct, which is *not* the same as a try/except. The > finally clause is always executed, whether or not an exception is raised. Yes, of course it must be the try finally construct and not try/except. Shame on me ;) Andreas Huesgen -- http://mail.python.org/mailman/listinfo/python-list

Type text global

2006-12-26 Thread Andreas Lysdal
Hey, I'm a noob at python so.. I just want to know, is there a function to type text global not in the program but in other programs(like you where typing it). For example in a textbox, in a program like "cmd.exe" or "notebook.exe". I'm using windows xp. Thanks! :) /Scripter47 -- http://m

Re: SPAM-LOW: Re: BeautifulSoup vs. loose & chars

2006-12-26 Thread Andreas Lysdal
Duncan Booth skrev: > "Felipe Almeida Lessa" <[EMAIL PROTECTED]> wrote: > > >> On 26 Dec 2006 04:22:38 -0800, placid <[EMAIL PROTECTED]> wrote: >> >>> So do you want to remove "&" or replace them with "&" ? If you >>> want to replace it try the following; >>> >> I think he wants to

mutable numeric type

2007-01-01 Thread Andreas Beyer
e the instance itself: >>> x.value = 0 >>> id(x) -1213448500 >>> x += 2 >>> x MutableNumeric(2) >>> id(x) # show that same instance -1213448500 >>> Is there anything wrong with such design? I am a bit surprised that Python does not a

OpenRTS - new OSS Python game

2006-02-01 Thread Andreas R.
OpenRTS is a new open source project, with the aim of creating a realtime strategy game. The game is developed in Python with Pygame. See http://www.openrts.org for more info about the game if you are interested. -- http://mail.python.org/mailman/listinfo/python-list

Re: OpenRTS - new OSS Python game

2006-02-01 Thread Andreas R.
Sybren Stuvel wrote: > To be honest, it looks very much like games from 1995... The game has isometric graphics. It's possible to have nice isometric graphics, ie. look at Civilization 3. Besides, there's a lot more to a good strategy game than good looks. -- http://mail.python.org/mailman/lis

asynchat + send problem

2006-02-13 Thread Andreas R.
ave to use select etc.? The source code is here: http://svn.gna.org/viewcvs/openrts/trunk/openrts/server/clienthandler.py?rev=36&view=markup Thanks in advance! Andreas R. www.openrts.org -- http://mail.python.org/mailman/listinfo/python-list

Re: asynchat + send problem

2006-02-13 Thread Andreas R.
Fredrik Lundh wrote: > "Andreas R." <[EMAIL PROTECTED]> wrote: > >> I'm using Python's asynchat for networking. If I invoke the send() >> method of the asynchat module, only a single send operation is possible >> at any given time. If I call it mo

asynchat network send problems

2006-03-01 Thread Andreas R.
ze is often 512 between client and server, when running len(packet) on the *compressed* packed. The len() of a large packet is usually about 64969. Complete source code is available at http://svn.gna.org/daily/openrts-snapshot.tar.gz Thanks anyone for the help, - Andreas R. www.openrts.org --

NaN support etc.

2005-05-18 Thread Andreas Beyer
ar: How do I get the maximum/minimum double for current machine? Thanks! Andreas Please, cc me, as I am not on the list. Thanks! -- http://mail.python.org/mailman/listinfo/python-list

Re: NaN support etc.

2005-05-19 Thread Andreas Beyer
y", line 8, in ? nan = cast('d', '\x00\x00\x00\x00\x00\x00\xf8\xff')[0] error: required argument is not a float Maybe the second line should read: cast = struct.unpack However, the actual fpconst.py works fine. Thanks for the hints, Andreas -- http://mail.python.org/mailman/listinfo/python-list

Re: What are OOP's Jargons and Complexities?

2005-05-24 Thread Andreas Rottmann
already said, Lisp is stronger typed than C, but C is statically typed, whereas Lisp is dynamically typed. In Lisp (or Scheme), all variables have types: (define foo #(1 2 3)) (vector? foo) => #t (boolean? foo) => #t See http://cliki.tunes.org/Type%20System. Rotty -- Andreas Rottmann

Point of Sale Use Cases

2005-05-26 Thread Andreas Pauley
Hi all, I've started writing use cases for my open source point of sale system (my first attempt at use cases). http://qualitypos.qbcon.com/ If anyone here has experience with either use cases or point of sale systems, feel free to comment or criticize. Regards, Andreas --

Re: Writing a bytecode interpreter (for TeX dvi files)

2005-05-27 Thread Andreas Lobinger
Aloha, Jonathan Fine wrote: > I'm writing some routines for handling dvi files. > In case you didn't know, these are TeX's typeset output. > These are binary files containing opcodes. > I wish to write one or more dvi opcode interpreters. > Are there any tools or good examples to follow for > writ

Re: Another source of time for the logging package?

2005-06-01 Thread Ames Andreas
*args, **kwargs) Then I call logging.setLoggerClass(MyLogger) before the relevant loggers are created. HTH, aa -- Andreas Ames | Programmer | Comergo GmbH | Voice: +49 69 7505 3213 | andreas . ames AT comergo . com -- http://mail.python.org/mailman/listinfo/python-list

Re: Software licenses and releasing Python programs for review

2005-06-02 Thread Andreas Kostyrka
perfect solutions there so a GPL'ed solution might be ok. (Especially because one can use OCR without linking with a lib *grin*) Andreas -- http://mail.python.org/mailman/listinfo/python-list

Re: Software licenses and releasing Python programs for review

2005-06-02 Thread Andreas Kostyrka
Am Donnerstag, den 02.06.2005, 17:52 + schrieb Karl A. Krueger: > Andreas Kostyrka <[EMAIL PROTECTED]> wrote: > > *) GPL is not acceptable for "library" stuff, because as a software > > developer I'm sometimes forced to do "closed" stuff. > &

Re: Software licenses and releasing Python programs for review

2005-06-06 Thread Andreas Kostyrka
at a company might do with it in the future ;) Andreas -- http://mail.python.org/mailman/listinfo/python-list

Re: Software licenses and releasing Python programs for review

2005-06-06 Thread Andreas Kostyrka
-owned" projects. Every part-owner owns his part. And it makes relicensing (taking the project closed-source) very difficult. That's a design feature, not a bug ;) Andreas -- http://mail.python.org/mailman/listinfo/python-list

Re: multiple inheritance

2005-06-09 Thread Andreas Kostyrka
lambda : None)() class C(A,B): def bar(self): print "C" getattr(super(C, self), "bar", lambda : None)() print "-" * 20, "base class without super call" C().bar() This produces: no super in A/B C A

Re: Perl s/ To Python?

2005-06-10 Thread Andreas Kostyrka
I'd consider taking a look at the re module ;) Andreas On Fri, Jun 10, 2005 at 02:57:21PM +0100, John Abel wrote: > Does anyone know of a quick way of performing this: > > $testVar =~ s#/mail/.*$##g > > The only way I can think of doing it, is: > > mailPos = testVar.

Re: What is different with Python ?

2005-06-13 Thread Andreas Kostyrka
understand how, more or less, your > computer or language works, otherwise your code will > be needless thousand times slower and will require > thousand times more memory than is necessary. > Look a recent thread where someone was asking why > python was so slow (and the code contained stuff > like "if x in range(low, high):" in an inner loop > that was itself pointless). Andreas -- http://mail.python.org/mailman/listinfo/python-list

Adding to Exception.args

2005-06-13 Thread Andreas Beyer
Should my 'user argument' be at the beginning or at the end of e.args? Thanks! Andreas -- http://mail.python.org/mailman/listinfo/python-list

Re: What is different with Python ?

2005-06-14 Thread Andreas Kostyrka
that it's amortized O(1) > instead then you say "wow..." and after some thinking > "ok, i think i understand how it could be done" and in > both cases you'll remember it. It's a clear *concrete* fact > that I think just cannot be forgot. Believe it can ;) But that's the idea why certain courses forced us to implement at least the most important data structures by ourselves. Because looking at it in a book is so much less intensive than doing it ;) Andreas -- http://mail.python.org/mailman/listinfo/python-list

Re: FAQ: __str__ vs __repr__

2005-06-15 Thread Andreas Kostyrka
Well, It means that eval(repr(x)) == x if at all possible. Basically: repr('abc') -> 'abc' str('abc') -> abc You'll notice that 'abc' is a valid python expression for the string, while abc is not a valid string expression. Andreas On Wed, Jun

Re: pyrex problem

2005-06-17 Thread Andreas Kostyrka
On Fri, Jun 17, 2005 at 01:03:14AM -0700, [EMAIL PROTECTED] wrote: > hi everyone > i'm newbie > > i try to compile the pyrex module: > def controlla(char *test): You cannot have a C datatype in a Python like that. Much better to use def controlla(test): Andreas -- http://mai

Re: The Modernization of Emacs: terminology buffer and keybinding

2007-06-24 Thread Andreas Eder
Java lends itself to this, Twisted> what with interfaces and inheritance and dynamic Twisted> class loading!) Have a look at Genera, the OS of the Lisp Machines. It offers all that and much more. Unfortunately it is almost non existent nowadays. 'Andreas -- Wherever I lay

Re: The Modernization of Emacs: terminology buffer and keybinding

2007-06-25 Thread Andreas Eder
y clutters your hard drive with Twisted> "temporary" files you occasionally forget to delete. You obviously have no clue about working under Unix either. 'Andreas -- Wherever I lay my .emacs, there's my $HOME. -- http://mail.python.org/mailman/listinfo/python-list

Re: The Modernization of Emacs: terminology buffer and keybinding

2007-06-28 Thread Andreas Eder
installed Twisted> (equivalent to rooting around in C:\Program Files\Appname for .hlp Twisted> files, because F1 didn't work and there was no "help" menu, if such a Twisted> thing ever happened on Windoze). Ever heard of man pages? and info? 'Andreas -- Wherever I lay my .emacs, there's my $HOME. -- http://mail.python.org/mailman/listinfo/python-list

python module developer wanted for 'libmsgque'

2007-05-10 Thread Andreas Otto
e extension: http://libmsgque.sourceforge.net/tclmsgque.htm Regards, Andreas Otto (aotto1968) -- http://mail.python.org/mailman/listinfo/python-list

Good Python style?

2007-05-31 Thread Andreas Beyer
ood Python style? Or would you recommend to refrain from such complex single-line code?? Thanks! Andreas inp = resource(some_file) # read first entries of all non-empty lines into a set some_set = frozenset([line.split()[0] for line in \ filter(None, [ln.strip() for ln in inp])]

expat error, help to debug?

2007-08-23 Thread Andreas Lobinger
Aloha, i'm trying to write an xml filter, that extracts some info about an .xml document (with external entities), esp. start elements and external entities. The document is a DOCBOOK xml and afacs well formed and passes our docbook toolchain (dblatex etc.). My parser is (very simple): [115] scyl

Re: expat error, help to debug?

2007-08-27 Thread Andreas Lobinger
Aloha, Lawrence D'Oliveiro wrote: > In message <[EMAIL PROTECTED]>, Andreas Lobinger wrote: >>Anyone any idea where the error is produced? > Do you want to try adding an EndElementHandler as well, just to get more > information on where the error might be happ

Re: expat error, help to debug?

2007-08-28 Thread Andreas Lobinger
Aloha, Andreas Lobinger wrote: > Lawrence D'Oliveiro wrote: >> In message <[EMAIL PROTECTED]>, Andreas Lobinger wrote: >>> Anyone any idea where the error is produced? ... to share my findings with you: def ex(self,context,baseid,n1,n2): print "

Re: expat error, help to debug?

2007-08-28 Thread Andreas Lobinger
Aloha, Andreas Lobinger wrote: > Andreas Lobinger wrote: >> Lawrence D'Oliveiro wrote: >>> In message <[EMAIL PROTECTED]>, Andreas Lobinger wrote: >>>> Anyone any idea where the error is produced? > The registered Handler has to return a (integer) va

Re: interesting puzzle......try this you will be rewarded...

2007-09-07 Thread Andreas Tawn
yet so I can't vouch for its quality. (am playing >it now) Maybe http://www.pythonchallenge.com/ ? Cheers, Drea Andreas Tawn Lead Technical Artist Ubisoft Reflections -- http://mail.python.org/mailman/listinfo/python-list

python & osgi

2007-09-12 Thread Andreas Wapf
Is there something like a osgi implementation in python? I am really impressed by the bundle system and the possibility to load and unload bundles without wasting memory. Is it even possible to do something like that in python? Would be nice to have a very small python interpreter and just load the

Re: [Edu-sig] minimum age to learn python (a.k.a graphical vs text languages)

2007-03-10 Thread Andreas Raab
she built Rome in a day). More than rumor apparently: http://www.cmu.edu/cmnews/extra/060310_alice.html Cheers, - Andreas -- http://mail.python.org/mailman/listinfo/python-list

Re: [Zope] how do I test for the current item in an iteration

2007-09-28 Thread Andreas Jung
--On 28. September 2007 16:36:43 +0100 kamal hamzat <[EMAIL PROTECTED]> wrote: Dear All, I have this error after i added the if statement Error Type: TypeError Error Value: mybrains.__cmp__(x,y) requires y to be a 'mybrains', not a 'int' for i in context.zCatNewsCurrent(): if i <= 5

Re: generating range of numbers

2007-10-03 Thread Andreas Tawn
>i just want to generate numbers in the form like: > >1,2,4,8,16,32.to a maximum of 1024 >using a range function >>> a = [2**x for x in range(11)] >>> a [1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024] Cheers, Andreas Tawn Lead Technical Artist Ubisoft Reflectio

RE: Really basic problem

2007-10-08 Thread Andreas Tawn
t;>> 0.10001 == 0.1 True >>> 0.30004 == 0.3 False I guess this means that Python has some concept of "close enough", but I'll have to defer to someone more knowledgeable to explain that. Cheers, Andreas Tawn Lead Technical Artist Ubisoft Reflections -- http://mail.python.org/mailman/listinfo/python-list

RE: Really basic problem

2007-10-08 Thread Andreas Tawn
> Steven > -- > http://mail.python.org/mailman/listinfo/python-list > After some caffeine and a head-smack, I realise that you're absolutely right and I just made the same mistake as the OP (doh). It does demonstrate just how sneaky floating point representations are though. Chee

mutable objects as dictionary keys

2007-10-09 Thread Andreas Kraemer
versions of python (2.6 ?, 3.0 ?) will contain class decorators and allow syntax like class A(*bases): pass Is there a better approach? Any comments are appreciated. I have been seriously using Python for one year know, mostly in the context of graph algorithms etc., and it has always been a delightful coding experience! Best regards, Andreas -- http://mail.python.org/mailman/listinfo/python-list

storing meta data on dictionary keys

2007-10-09 Thread Andreas Kraemer
; friends.get_key('Isabelle').hair_color 'green' A more sensible, realistic example are attributes of graph nodes (e.g. color, shape, etc) in the networkx package, where node objects are stored as keys of (nested) dictionaries. Is there any particular reason why the built-in dictionary does not define a get_key() method, but only keys(), iterkeys(), and has_key() ? Cheers, Andreas -- http://mail.python.org/mailman/listinfo/python-list

Re: storing meta data on dictionary keys

2007-10-09 Thread Andreas Kraemer
ng str would be the simplest, most straightforward structure for a node object. Of course there are workarounds (e.g. get all keys with keys()), but I thought something similar to a get_key() dictionary method would be the easiest way to retrieve the actually stored key object, and I was just

Re: storing meta data on dictionary keys

2007-10-10 Thread Andreas Kraemer
On Oct 9, 9:18 pm, Erik Jones <[EMAIL PROTECTED]> wrote: > So, do you not keep references to your nodes anywhere but the actual > graph dict? I kind of agree with Chris here in that two dicts will > work. One for the nodes, indexed by their strings. Yes, I guess that's exactly what I want. To kee

Re: Keeping track of subclasses and instances?

2007-10-10 Thread Andreas Kraemer
he (toy-) implementation of a frame-based knowledge representation system using Python's object model, where one definitely needs classes to keep track of their instances ... Cheers, Andreas -- http://mail.python.org/mailman/listinfo/python-list

Re: storing meta data on dictionary keys

2007-10-10 Thread Andreas Kraemer
ferent > object depending on the retrieval method used and that is NOT what > the built-in dict is for. In fact, now that I think of it, get_key > is probably a bad name for it, get_other_object_with_this_same_key is > probably more apt :) Or more precise: get_key_that_was_used_when_value_was_inserted_into_dictionary :-) Thanks, for taking the time for this elaborate response! Cheers, Andreas -- http://mail.python.org/mailman/listinfo/python-list

Re: storing meta data on dictionary keys

2007-10-11 Thread Andreas Kraemer
> > [...]In fact, now that I think of it, get_key > > is probably a bad name for it, get_other_object_with_this_same_key is > > probably more apt :) > > Or more precise: > get_key_that_was_used_when_value_was_inserted_into_dictionary :-) Or even more precisely: get_key_obj

Parsing a commandline from within Python

2007-10-11 Thread andreas . huesgen
strings "foo bar" and "some text" from the commandline <"foo bar" "some text">)? If not, do you have any other ideas how to handle this problem (increasing commandline length, xml files might be a way)? Regards, Andreas Huesgen Viel oder

Re: Parsing a commandline from within Python

2007-10-11 Thread Andreas Huesgen
e shlex module:: > > >>> import shlex > >>> shlex.split('"foo bar" "some text"') > ['foo bar', 'some text'] > Thanks, that is exactly what i need. Andreas Huesgen -- http://mail.python.org/mailman/listinfo/python-list

Re: storing meta data on dictionary keys

2007-10-11 Thread Andreas Kraemer
On Oct 11, 10:17 am, Erik Jones <[EMAIL PROTECTED]> wrote: > No, duck typing and inheritance are two different things. Duck > typing is when you implement the same operations as another object or > class, whereas with inheritance you get the same implementation as > that of the parent class. Exc

Re: storing meta data on dictionary keys

2007-10-11 Thread Andreas Kraemer
On Oct 11, 1:42 pm, Erik Jones <[EMAIL PROTECTED]> wrote: > On Oct 11, 2007, at 2:25 PM, Andreas Kraemer wrote: > > > On Oct 11, 10:17 am, Erik Jones <[EMAIL PROTECTED]> wrote: > > >> No, duck typing and inheritance are two different things. Duck > &

<    1   2   3   4   5   6   7   >