ANN: ElementTree 1.2.6 (march 16, 2005)

2005-03-17 Thread Fredrik Lundh
The Element type is a simple but flexible container object, designed to store hierarchical data structures, such as simplified XML infosets, in memory. The ElementTree package provides a Python implementation of this type, plus code to serialize element trees to and from XML files. ElementTree

ANN: cElementTree 1.0.2 (march 2, 2005)

2005-03-17 Thread Fredrik Lundh
effbot.org proudly presents release 1.0.2 of the cElementTree library, a fast and very efficient implementation of the ElementTree API, for Python 2.1 and later. On typical documents, it's 15-20 times faster than the Python version of ElementTree, and uses 2-5 times less memory. cElementTree

ANN: PythonDoc 2.1 beta 3 (march 25, 2005)

2005-03-25 Thread Fredrik Lundh
PythonDoc is a documentation tool for Python, inspired by JavaDoc. Like JavaDoc, PythonDoc scans your Python code for doc comments, and generates API documentation in XML and HTML formats. Python- Doc supports basic JavaDoc tags like @param and @return, and adds a few Python-specific tags. You

ANN: WCK for Tkinter 1.1 final (december 11, 2005)

2005-12-11 Thread Fredrik Lundh
The Widget Construction Kit (WCK) is an extension API that allows you to implement custom widgets in pure Python. The WCK can be (and is being) used for everything from light-weight display widgets to full-blown editor frameworks. The Tkinter3000 implementation of the WCK supports all recent

ANN: PIL 1.1.6 alpha 1 (december 11, 2005)

2005-12-12 Thread Fredrik Lundh
The first official PIL 1.1.6 alpha is now available from effbot.org: http://effbot.org/downloads (look for Imaging-1.1.6a1.tar.gz) Notable additions since 1.1.5: + Added pixel access object. The load method now returns an access object that can be used to directly get and set pixel

ANN: cElementTree 1.0.4 (december 13, 2005)

2005-12-16 Thread Fredrik Lundh
effbot.org proudly presents release 1.0.4 of the cElementTree library, a fast and very efficient implementation of the ElementTree API, for Python 2.1 and later. On typical documents, it's 15-20 times faster than the Python version of ElementTree, and uses 2-5 times less memory. cElementTree

ANN: PIL 1.1.6 final (december 3, 2006)

2006-12-04 Thread Fredrik Lundh
The Python Imaging Library (PIL) adds image processing capabilities to your Python interpreter. This library supports many file formats, and provides powerful image processing and graphics capabilities, including display support for Windows and Tkinter. The new 1.1.6 release provides, among other

Re: Python Installation

2005-01-11 Thread Fredrik Lundh
Steve Holden wrote: Hmm, effbot.org seems to be down just now. Sure it'll be back soon, though. http://news.bbc.co.uk/2/hi/europe/4158809.stm /F -- http://mail.python.org/mailman/listinfo/python-list

Re: What strategy for random accession of records in massive FASTA file?

2005-01-12 Thread Fredrik Lundh
Chris Lasher wrote: Since the file I'm working with contains tens of thousands of these records, I believe I need to find a way to hash this file such that I can retrieve the respective sequence more quickly than I could by parsing through the file request-by-request. However, I'm very new to

Re: site.here on python 2.4

2005-01-13 Thread Fredrik Lundh
ariza [EMAIL PROTECTED] wrote: greetings. it seems that the attribute site.here, of the site module, has vanished in python 2.4. up until python 2.3, site.here seemed (to me at least) a convenient way to get the complete path to the python library on any platform. here was a temporary

Re: python and macros (again) [Was: python3: 'where' keyword]

2005-01-13 Thread Fredrik Lundh
Antoon Pardon wrote: Well, it seems that Guido is wrong then. The documentation clearly states that an expression is a statement. no, it says that an expression statement is a statement. if you don't understand the difference, please *plonk* yourself. /F --

Re: Unclear On Class Variables

2005-01-13 Thread Fredrik Lundh
Tim Daneliuk wrote: I am a bit confused. I was under the impression that: class foo(object): x = 0 y = 1 means that x and y are variables shared by all instances of a class. But when I run this against two instances of foo, and set the values of x and y, they are indeed unique to the

Re: python 2.3.4 for windows: float(NaN) throws exception

2005-01-13 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: my python 2.3.4 for windows refuse to execute line float(NaN). It says: float(NaN) Traceback (most recent call last): File stdin, line 1, in ? ValueError: invalid literal for float(): NaN The same line works as expected on Linux and Solaris with python 2.3.4.

Re: sorted (WAS: lambda)

2005-01-13 Thread Fredrik Lundh
Paul Rubin wrote: Note that sorted is a builtin function, not a method of a list object. Oh, same difference. I thought it was a method because I'm not using 2.4 yet. The result is the same nope. sorted works on any kind of sequence, including forward-only iterators.

Re: python and macros (again) [Was: python3: 'where' keyword]

2005-01-14 Thread Fredrik Lundh
Paul Rubin wrote: Huh? Expressions are not statements except when they're expression statements? What kind of expression is not an expression statement? any expression that is used in a content that is not an expression statement, of course. Come on, that is vacuous. The claim was

Re: python and macros (again) [Was: python3: 'where' keyword]

2005-01-14 Thread Fredrik Lundh
Antoon Pardon wrote: no, expressions CAN BE USED as statements. that doesn't mean that they ARE statements, unless you're applying belgian logic. No I am applying set logic. Any string that is in the set of valid expressions is also in the set of valid statements. since you're arguing that

Re: python and macros (again) [Was: python3: 'where' keyword]

2005-01-14 Thread Fredrik Lundh
Antoon Pardon wrote: Well IMO I have explained clearly that I understood this in a set logical sense in my first response. what does first mean on your planet? /F -- http://mail.python.org/mailman/listinfo/python-list

Re: How to del item of a list in loop?

2005-01-15 Thread Fredrik Lundh
skull wrote: It makes a copy operation! so? in python, shallow copies are cheap. here is a faster and 'ugly' solution: faster? did you try it, or are you combining a C++ mindset with an urge to do premature optimizations? (hint: it's slower) if you care about performance, you shouldn't

Re: How to del item of a list in loop?

2005-01-16 Thread Fredrik Lundh
John Machin wrote: (if you have 2.4, try replacing [] with () and see what happens) The result is a generator with a name (lst) that's rather misleading in the context. according to my dictionary, the word list means A series of names, words, or other items written, printed, or imagined one

Re: why are some types immutable?

2005-01-17 Thread Fredrik Lundh
Roy Smith wrote: But, in a nutshell, the biggest reason for immutable types (tuples and strings) is that this lets they be dictionary keys. if you think that's the biggest reason, you haven't spent enough time working on high-performance Python code and extensions (there's a reason why some

Re: [perl-python] 20050116 defining a function

2005-01-17 Thread Fredrik Lundh
Ala Qumsieh wrote: © my $n= @_[0]; Do you ever test your code before making fun of yourself in front of millions? this perl usability study is getting more and more interesting. who needs television? /F -- http://mail.python.org/mailman/listinfo/python-list

Re: Install Python 2.4 on Fedora 3 Core

2005-01-17 Thread Fredrik Lundh
Bill [EMAIL PROTECTED] wrote: 2. I looked in the package editor and there was no way to uninstall 2.3? Should I? If so, how can I? If not,what are the problems, if any, of having both. if your OS comes with Python, there's a certain chance that it includes utilities that rely on a specific

Re: how to stop google from messing Python code

2005-01-17 Thread Fredrik Lundh
Fuzzyman wrote: if you have internet access, you have NNTP access. gmane.org provides access to more than 6,500 mailing lists via NNTP, including all relevant Python forums. Not if you're behind a censoring proxy that blocks everything except http. This is a situation many people find

Re: How to prevent the script from stopping before it should

2005-01-17 Thread Fredrik Lundh
Steve Holden wrote: You will need to import the socket module and then call socket.setdefaulttimeout() to ensure that communication with non-responsive servers results in a socket exception that you can trap. or you can use asynchronous sockets, so your program can keep processing the

Re: Problem parsing namespaces with xml.dom.minidom

2005-01-18 Thread Fredrik Lundh
Mike McGavin wrote: is the DOM API an absolute requirement? It wouldn't need to conform to the official specifications of the DOM API, but I guess I'm after some comparable functionality. In particular, I need to be able to parse a namespace-using XML document into some kind of node

Re: bind error!!!!!

2005-01-18 Thread Fredrik Lundh
Perrin Aybara wrote: my code was working pretty well until yesterday.suddenly it started giving me bind error: address already in use. google has the details: http://hea-www.harvard.edu/~fine/Tech/addrinuse.html but i have logged out and again logged in, but still the problem is not

Re: ElementTree cannot parse UTF-8 Unicode?

2005-01-19 Thread Fredrik Lundh
Erik Bethke wrote: I am getting an error of not well-formed at the beginning of the Korean text in the second example. I am doing something wrong with how I am encoding my Korean? Do I need more of a wrapper about it than simple quotes? Is there some sort of XML syntax for indicating a

Re: ElementTree cannot parse UTF-8 Unicode?

2005-01-19 Thread Fredrik Lundh
Erik Bethke wrote: 2) You are right in that the print of the file read works just fine. but what does it look like? I saved a raw copy of your original mail, fixed the quoted-printable encoding, and got an UTF-8 encoded file that works just fine. the thing you've been parsing, and that you've

Re: Zen of Python

2005-01-19 Thread Fredrik Lundh
Timothy Fitz wrote: While I agree that the Zen of Python is an amazingly concise list of truisms, I do not see any meaning in: Flat is better than nested. Python's not Pascal. /F -- http://mail.python.org/mailman/listinfo/python-list

Re: iteritems() and enumerate()

2005-01-19 Thread Fredrik Lundh
Xah Lee wrote: Python has iteritems() and enumerate() to be used in for loops. can anyone tell me what these are by themselves, if anything? iteritems() is a dictionary method, which returns a lazily constructed sequence of all (key, value) pairs in the dictionary. enumerate(seq) is a

Re: why are these not the same?

2005-01-20 Thread Fredrik Lundh
Lowell Kirsh wrote: On a webpage (see link below) I read that the following 2 forms are not the same and that the second should be avoided. They look the same to me. What's the difference? def functionF(argString=abc, argList = None): if argList is None: argList = [] ...

Re: ElementTree cannot parse UTF-8 Unicode?

2005-01-20 Thread Fredrik Lundh
Jorge Luiz Godoy Filho wrote: what does it give you on your machine? (looks like wxPython cannot handle Unicode strings, but can that really be true?) It does support Unicode if it was built to do so... Python has supported Unicode in release 1.6, 2.0, 2.1, 2.2, 2.3 and 2.4, so you might

Re: ElementTree cannot parse UTF-8 Unicode?

2005-01-20 Thread Fredrik Lundh
Erik Bethke wrote: layout += 'Vocab\n' layout += 'Word L1=\'' + L1Word + '\'/Word\n' what does print repr(L1Word) print (that is, what does wxPython return?). it should be a Unicode string, but that would give you an error when you write it out: f = open(file.txt, w)

Re: building extensions: ming python mathlink for win32

2005-01-20 Thread Fredrik Lundh
Jelle Feringa wrote: What struck me while trying to compile is that instead of the Active Python 2.4 version I was running I downloaded and installed the python.org version (as recommended by Fletcher), and while launching it, I stated ActivePython 2.4 Build 243 (ActiveState Corp.) based on

Re: Funny Python error messages

2005-01-21 Thread Fredrik Lundh
Peter Hansen wrote: My first one (i'm learning, i'm learning) is TypeError: 'callable-iterator' object is not callable # it = iter(lambda:0, 0) # it() # TypeError: 'callable-iterator' object is not callable Given that the supposed humour depends on the *name* of the object, which is

Re: circular iteration

2005-01-21 Thread Fredrik Lundh
Flavio codeco coelho wrote: is there a faster way to build a circular iterator in python that by doing this: c=['r','g','b','c','m','y','k'] for i in range(30): print c[i%len(c)] have you benchmarked this, and found it lacking, or are you just trying to optimize prematurely? /F

Re: What YAML engine do you use?

2005-01-21 Thread Fredrik Lundh
rm wrote: well, I did look at it, and as a text format is more readable than XML is. judging from http://yaml.org/spec/current.html (750k), the YAML designers are clearly insane. that's the most absurd software specification I've ever seen. they need help, not users. /F --

Re: xml parsing escape characters

2005-01-21 Thread Fredrik Lundh
Luis P. Mendes wrote: xml producer writes the code in Windows platform and 'thinks' that every client will read/parse the code with a specific Windows parser. Could that (wrong) XML code parse correctly in that kind of specific Windows client? not if it's an XML parser. Do you know any

Re: default value in a list

2005-01-21 Thread Fredrik Lundh
Paul McGuire wrote: I asked a very similar question a few weeks ago, and from the various suggestions, I came up with this: expand = lambda lst,default,minlen : (lst + [default]*minlen)[0:minlen] I wouldn't trust whoever suggested that. if you want a function, use a function: def

Re: list unpack trick?

2005-01-22 Thread Fredrik Lundh
Alex Martelli wrote: or (readable): if len(list) n: list.extend((n - len(list)) * [item]) I find it just as readable without the redundant if guard -- just: alist.extend((n - len(alist)) * [item]) the guard makes it obvious what's going on, also for a reader that doesn't

Re: Insanity

2005-01-22 Thread Fredrik Lundh
Tim Daneliuk wrote: Given an arbitrary string, I want to find each individual instance of text in the form: [PROMPT:optional text] I tried this: y=re.compile(r'\[PROMPT:.*\]') Which works fine when the text is exactly [PROMPT:whatever] didn't you leave something out here? compile

Re: Zen of Python

2005-01-22 Thread Fredrik Lundh
Paul Rubin wrote: Some languages let you say things like: for (var x = 0; x 10; x++) do_something(x); and that limits the scope of x to the for loop. depending on the compiler version, compiler switches, IDE settings, etc. /F --

Re: Zen of Python

2005-01-22 Thread Fredrik Lundh
Paul Rubin wrote: Some languages let you say things like: for (var x = 0; x 10; x++) do_something(x); and that limits the scope of x to the for loop. depending on the compiler version, compiler switches, IDE settings, etc. Huh? I'm not sure what you're talking about. guess

Re: What YAML engine do you use?

2005-01-22 Thread Fredrik Lundh
Reinhold Birkenfeld wrote: Agreed. If you just want to use it, you don't need the spec anyway. but the guy who wrote the parser you're using had to read it, and understand it. judging from the number of crash reports you see in this thread, chances are that he didn't. /F --

Re: rotor replacement

2005-01-22 Thread Fredrik Lundh
Paul Rubin wrote: Martin, do you know more about this? I remember being disappointed about the decisions since I had done some work on a new block cipher API and I had wanted to submit an implementation to the distro. But when I heard there was no hope of including it, I stopped working on

Re: rotor replacement

2005-01-22 Thread Fredrik Lundh
Paul Rubin wrote: 2. Would anyone except me have any use for this? shows a lack of understanding of how Python is used. Some users (call them application users or AU's) use Python to run Python applications for whatever purpose. Some other users (call them developers) use Python to develop

Re: rotor replacement

2005-01-22 Thread Fredrik Lundh
Paul Rubin wrote: Excellent. I hope you will re-read it several times a day. Doing that might improve your attitude. you really don't have a fucking clue about anything, do you? /F -- http://mail.python.org/mailman/listinfo/python-list

Re: What YAML engine do you use?

2005-01-22 Thread Fredrik Lundh
rm [EMAIL PROTECTED] wrote: 100% right on, stuff (like this)? should be easy on the users, and if possible, on the developers, not the other way around. I guess you both stopped reading before you got to the second paragraph in my post. YAML (at least the version described in that spec)

Re: What YAML engine do you use?

2005-01-22 Thread Fredrik Lundh
rm [EMAIL PROTECTED] wrote: furthermore, users will suffer too, I'm suffering if I have to use C++, with all its exceptions and special cases. and when you suffer, your users will suffer. in the C++ case, they're likely to suffer from spurious program crashes, massively delayed development

Re: What YAML engine do you use?

2005-01-22 Thread Fredrik Lundh
Stephen Waterbury wrote: The premise that XML had a coherent design intent stetches my credulity beyond its elastic limit. the design goals are listed in section 1.1 of the specification. see tim bray's annotated spec for additional comments by one of the team members:

Re: What YAML engine do you use?

2005-01-22 Thread Fredrik Lundh
Alex Martelli wrote: [1, 2, 'Joe Smith', 8237972883334L, # comment {'Favorite fruits': ['apple', 'banana', 'pear']}, # another comment 'xyzzy', [3, 5, [3.14159, 2.71828, [ I don't see what YAML accomplishes that something like the above wouldn't. Note that all the

Re: rotor replacement

2005-01-22 Thread Fredrik Lundh
Paul Rubin wrote: you really don't have a fucking clue about anything, do you? You're not making any bloody sense. oh, I make perfect sense, and I think most people here understand why I found your little lecture so funny. if you still don't get it, maybe some- one can explain it to you. /F

Re: list unpack trick?

2005-01-22 Thread Fredrik Lundh
Nick Coghlan wrote: I am think more in the line of string.ljust(). So if we have a list.ljust(length, filler), we can do something like name, value = s.split('=',1).ljust(2,'') Eh? Py s.split('=',1).ljust(2,'') Traceback (most recent call last): File stdin, line 1, in ?

Re: Insanity

2005-01-23 Thread Fredrik Lundh
Tim Daneliuk wrote: Thanks - very helpful. One followup - your re works as advertised. But if I use: r'\[PROMPT:[^]].*\]' it seems not to. the '.*' instead of just '*' it matches the entire string ... it's not just '*', it's [^]]*. it's the ^] set (anything but ]) that's repeated.

Re: Textual markup languages (was Re: What YAML engine do you use?)

2005-01-23 Thread Fredrik Lundh
Alan Kennedy wrote: From what I've seen, pretty much every textual markup targetted for web content, e.g. wiki markup, seems to have grown/evolved organically, meaning that it is either underpowered or overpowered, full of special cases, doesn't have a meaningful object model, etc. I

Re: compile python to binary

2005-01-23 Thread Fredrik Lundh
sam [EMAIL PROTECTED] wrote: I have seen some software written in python and delivered as binary form. How does these binary code get generated by python compiler? see section 6.1.2 in the tutorial: http://docs.python.org/tut/node8.html /F --

ANN: cElementTree 0.9.8 (january 23, 2005)

2005-01-23 Thread Fredrik Lundh
effbot.org proudly presents release 0.9.8 of the cElementTree library, a fast and very efficient implementation of the ElementTree API, for Python 2.1 and later. On typical documents, it's 15-20 times faster than the Python version of ElementTree, and uses 2-5 times less memory. Here are some

Re: compile python to binary

2005-01-23 Thread Fredrik Lundh
Daniel Bickett wrote: I believe Sam was talking about frozen python scripts using tools such as py2exe: oh, you mean that python compiler didn't mean the python compiler. here are links to some more tools, btw: http://effbot.org/zone/python-compile.htm /F --

Re: What is print? A function?

2005-01-23 Thread Fredrik Lundh
The reason I thinks about this is I need to implement a debug print for my program; very simple, a function/print statement that conditionally prints its message whether a bool is true. Not overly complex. I tried this by overshadowing the print keyword, but that obviously didn't work.. Is

Re: What is print? A function?

2005-01-23 Thread Fredrik Lundh
Frans Englich wrote: I find this a nice solution. The most practical would be if it was possible to do this with print, of course. But print won't budge. you can disable print, though: class dev_null: def write(self, text): pass sys.stdout = dev_null() or pipe all

Re: on the way to find pi!

2005-01-23 Thread Fredrik Lundh
Ali Polatel wrote: write the code type str(pi(5)) and see what I mean it helps if you post the code you want help with in your first post, so people don't have to guess. the pi function doesn't return anything, it prints the value to stdout (that's what the stdout.write things are doing). if

Re: [perl-python] 20050121 file reading writing

2005-01-23 Thread Fredrik Lundh
Erik Max Francis wrote: To do this efficiently on a large file (dozens or hundreds of megs), you should use the 'sizehint' parameter so as not to use too much memory: sizehint = 0 mylist = f.readlines(sizehint) It doesn't make any difference. .readlines reads the entire file into

Re: Asynchronous event handling...?

2005-01-23 Thread Fredrik Lundh
Chris Line wrote: When the 'stop' button is selected after 'count', it does not execute until the count command finishes at 500. Instead, it is desired to stop counting immediately and execute the 'stop' method. Is there a simple way to handle this situation? calling self.update() at

Re: compile python to binary

2005-01-24 Thread Fredrik Lundh
Daniel Bickett wrote: oh, you mean that python compiler didn't mean the python compiler. [snip] I simply inferred that he was using the wrong terminology, being that he said binary twice ;-) yeah, but PYC files (which is what the standard compiler produces) are binary files too, in all the

Re: delay and force in Python

2005-01-24 Thread Fredrik Lundh
Nick Coghlan wrote: How's this: Py from itertools import islice Py print islice((x for x in xrange(1, 996) if x % 2 == 0), 1, 2).next() 4 Wouldn't it be nice if this could be spelt: print (x for x in xrange(1, 996) if x % 2 == 0)[2] as I've always said, the sooner we can all use the

Re: finding name of instances created

2005-01-24 Thread Fredrik Lundh
Nick Coghlan wrote: Incidentally, this discussion made me realise the real reason why using a lambda to create a named function is evil: Py def f(): pass ... Py f.func_name 'f' Py f = lambda: None Py f.func_name 'lambda' I think I've heard that explanation before, but it never

Re: Py2.4 .exe installer

2005-01-24 Thread Fredrik Lundh
Facundo Batista: The bigger problem I'm facing is that the official operating system installed in the PCs is Win NT 4.0, tweaked and restricted, and it's impossible to install the Microsoft package that enables the .msi as a installer. Result: they can not install Py24.msi. There's

Re: Memory Usage

2005-01-24 Thread Fredrik Lundh
rbt wrote: For example, say I have the same Python script running on two WinXP computers that both have Python 2.4.0. One computer has 256 MB of Ram while the other has 2 GB of Ram. On the machine with less Ram, the process takes about 1 MB of Ram. On the machine with more Ram, it uses

Re: Right place for third party modules (here: fixedpoint)

2005-01-24 Thread Fredrik Lundh
Sibylle Koczian wrote: for the first time since getting Python I can't get a third party module to work. I got fixedpoint.0.1.2.tar.gz from SourceForge for use with KinterbasDB. After unpacking I had a directory called fixedpoint which I put under my site-packages directory. There are

Re: Right place for third party modules (here: fixedpoint)

2005-01-24 Thread Fredrik Lundh
I suppose fixedpoint is no package as described in the tutorial and so site-packages might not be the right place for it. site-packages sure works on my windows xp / python 2.4 configuration. ah, forget what I said. you need to put the fixedpoint.py *file* under site-packages, not the

Re: Python 2.1 - 2.4 differences

2005-01-24 Thread Fredrik Lundh
BOOGIEMAN [EMAIL PROTECTED] wrote: I found some e-book about Python 2.1, I want to print it but just to check first if sintax of Python 2.1 is same as 2.4 ? almost everything that works under 2.1 works under 2.4. the opposite isn't always true, though. for more information on new stuff, see:

Re: Tuple slices

2005-01-24 Thread Fredrik Lundh
George Sakkis wrote: Why does slicing a tuple returns a new tuple instead of a view of the existing one, given that tuples are immutable ? really? a = 1, 2, 3 b = a[:] a is b True /F -- http://mail.python.org/mailman/listinfo/python-list

Re: Tuple slices

2005-01-24 Thread Fredrik Lundh
Steven Bethard wrote: a = 1, 2, 3 b = a[:] a is b True My impression was that full tuple copies didn't actually copy, but that slicing a subset of a tuple might. Not exactly sure how to test this, but: py a = 1, 2, 3 py a[:2] is a[:2] False yup. and to figure out why things are done

Re: Question about reading a big binary file and write it into severaltext (ascii) files

2005-01-24 Thread Fredrik Lundh
Albert Tu wrote: I am learning and pretty new to Python and I hope your guys can give me a quick start. I have an about 1G-byte binary file from a flat panel x-ray detector; I know at the beggining there is a 128-byte header and the rest of the file is integers in 2-byte format. What I

Re: What's so funny? WAS Re: rotor replacement

2005-01-24 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: Maybe we're not thinking about the same problems. Say I'm an app writer and I want to use one of your modules. My development environment is GNU/Linux, and I want to ship a self-contained app that anyone can run without having to download additional components.

Re: Looking for Form Feeds

2005-01-24 Thread Fredrik Lundh
Greg Lindstrom wrote: I have a file generated by an HP-9000 running Unix containing form feeds signified by ^M^L. I am trying to scan for the linefeed to signal certain processing to be performed but can not get the regex to see it. Suppose I read my input line into a variable named

Re: What's so funny? WAS Re: rotor replacement

2005-01-24 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote As an app writer I want to publish code that runs on multiple platforms without needing special attention from the end user, and preferably without needing special platform-specific attention from me. please answer the question: have you done this? what kind of

Re: Looking for Form Feeds

2005-01-24 Thread Fredrik Lundh
Terry Hancock wrote: I also tried to create a ^M^L (typed in as ctrlQ M ctrlQ L) but that gives me a syntax error when I try to run the program (re does not like the control characters, I guess). Is it possible for me to pull out the formfeeds in a straightforward manner? I suspect you

Re: What's so funny? WAS Re: rotor replacement

2005-01-24 Thread Fredrik Lundh
Terry Hancock wrote: And, well, I'm sorry Mr. Lundh, but your PIL module actually is something of a pain to install still. The OP is right about that. Usually worth it, but I don't like the fact that that pain is being passed on to the end-user of my software. The fact that you got all

Re: What's so funny? WAS Re: rotor replacement

2005-01-25 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: The likely-best-known Python application in the world (probably more people have heard of it than have heard of Python) originally had crypto and what Python application is that? I can think of quite a few applications written in Python that are widely known, but

Re: error

2005-01-25 Thread Fredrik Lundh
me [EMAIL PROTECTED] wrote: whenever i try and run my Python GUI, my computer thinks for a sec, then drops the process, without ever displaying the window. the command prompt window seems to work fine, but the IDLE GUI won't start. i'm running Windows 2K professional and python 2.4, so any

Re: string.atoi and string.atol broken?

2005-01-25 Thread Fredrik Lundh
Mike Moum wrote: s.atoi('4',3) should result in 11 s.atoi('13',4) should result in 31 s.atoi('12',4) should result in 30 s.atoi('8',4) is legitimate, but it generates an error. Is this a bug, or am I missing something obvious? the function's named atoi, not atoitoa. /F --

Re: string.atoi and string.atol broken?

2005-01-26 Thread Fredrik Lundh
Christos TZOTZIOY Georgiou wrote: the function's named atoi, not atoitoa. automatic_effbot_post_translator_powered_by_python cool. can I have a copy of your script? reminds me that I have a few patches in the inqueue. I wonder what this one does? ;-) hmm ;-) guess I can tune that later

Re: re.search - just skip it

2005-01-26 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: but output is: SET2_S_W CHAR(1) NOT NULL, SET4_S_W CHAR(1) NOT NULL, It should delete every, not every other! for i in range(len(lines)): try: if s_ora.search(lines[i]): del lines[i] except IndexError: ... when you loop over a range, the

Re: Help With Python

2005-01-26 Thread Fredrik Lundh
Peter Maas wrote: Can anybody help me get started? I am completely new to programming! Online: - http://www.python.org/moin/BeginnersGuide (Beginner, Advanced) - http://www.freenetpages.co.uk/hp/alan.gauld/ (Beginner) - http://docs.python.org/tut/tut.html (Beginner) -

Re: .WAV processing library ?

2005-01-26 Thread Fredrik Lundh
Chris Stiles wrote: Is there a library available for python that will enable me to process .wav files ? Preferably extensible so I can write handlers for dealing with the non audio sections. Kåre Sjölander's Snack library might be useful: http://www.speech.kth.se/snack/ /F --

Re: string.atoi and string.atol broken?

2005-01-26 Thread Fredrik Lundh
Christos TZOTZIOY Georgiou wrote: You're messing with the time machine again, right? no, it was a subversion pilot error, this time. but now that you remind me, I have to say that this http://mail.python.org/pipermail/python-list/2005-February/030720.html is a bit scary. I wonder from

Re: Subclassed dict as globals

2005-01-26 Thread Fredrik Lundh
Evan Simpson wrote: In Python 2.4 the following works: class G(dict): ... def __getitem__(self, k): ... return 'K' + k ... g = G() exec 'print x, y, z' in g Kx Ky Kz ...while in Python 2.3 it fails with NameError: name 'x' is not defined. Is this an accidental feature,

Re: Question about 'None'

2005-01-27 Thread Fredrik Lundh
flamesrock [EMAIL PROTECTED] wrote: The statement (1 None) is false (or any other value above 0). Why is this? http://docs.python.org/ref/comparisons.html The operators , , ==, =, =, and != compare the values of two objects. The objects need not have the same type. If both are

Re: Question about 'None'

2005-01-27 Thread Fredrik Lundh
Steven Bethard wrote: So None being smaller than anything (except itself) is hard-coded into Python's compare routine. My suspicion is that even if/when objects of different types are no longer comparable by default (as has been suggested for Python 3.0), None will still compare as

Re: Question about 'None'

2005-01-27 Thread Fredrik Lundh
Francis Girard wrote: Wow ! What is it that are compared ? I think it's the references (i.e. the adresses) that are compared. The None reference may map to the physical 0x0 adress whereas 100 is internally interpreted as an object for which the reference (i.e. address) exists and therefore

Re: unicode and data strings

2005-01-28 Thread Fredrik Lundh
Laszlo Zsolt Nagy wrote: Now I installed Python 2.3.4 and wxPython 2.5.3 (with unicode support). I'm getting this exception: exceptions.UnicodeDecodeError:'ascii' codec can't decode byte 0x91 in position 0: ordinal not in range(128) From where? Can you include a print repr() of the

Re: A proposal idea for string.split with negative maxsplit

2005-01-28 Thread Fredrik Lundh
Antoon Pardon wrote: This behaviour would remain but additionally we would have the following. st1:st2:st3:st4:st5.split(':',-2) [st1:st2:st3 , st4 , st5] What do people think here? st1:st2:st3:st4:st5.rsplit(':', 2) ['st1:st2:st3', 'st4', 'st5'] /F --

Re: Who should security issues be reported to?

2005-01-28 Thread Fredrik Lundh
Nick Coghlan wrote: I'm sorry, but this isn't really good enough. If Open Source wants to say that they are better than these proprietary companies, they need to deal with these sorts of things more professionally and establish decent channels of communications for dealing with it. Is that

Re: Who should security issues be reported to?

2005-01-28 Thread Fredrik Lundh
Duncan Booth wrote: I think part of the problem you are having is that Python doesn't make any representations about security, so it is pretty hard to come up with issues which really are security related. Products which are based on Python (e.g. Zope) and which do aim to provide some kind of

Re: Who should security issues be reported to?

2005-01-28 Thread Fredrik Lundh
Duncan Booth wrote: I think its a bit borderline whether this really was a security bug in Python rather than just a problem with the way some people used Python. It was a standard library which if used in the wrong way opens a security hole on your machine for SmartCookie, that should be if

Re: python: can't open file 'timeit.py'

2005-01-28 Thread Fredrik Lundh
Aggelos I. Orfanakos wrote: Under Gentoo Linux, I issue: $ python timeit.py python: can't open file 'timeit.py' $ ls -al /usr/lib/python2.3/timeit.py -rw-r--r-- 1 root root 9833 Oct 19 02:17 /usr/lib/python2.3/timeit.py But if I specify the full path, it works: $ python

Re: Pystone benchmark: Win vs. Linux (again)

2005-01-28 Thread Fredrik Lundh
Franco Fiorese wrote: I am relatively new about Python benchmarks. After some experiments I found that Python on my PC Windows XP has a relevant higher performance than on Linux. The simple test using pystone.py shows this: * Windows XP Pro: 16566.7 pystones/second * Linux (kernel

Re: is this sort method the same as the one in python 2.4

2005-01-29 Thread Fredrik Lundh
Raymond Hettinger wrote: I'm trying to emulate the sorted() method introduced in python 2.4. The only difference is that it takes a sequence as one of its arguments rather than being a method of the sequence class. Does my method do the same as the sorted()? Almost. This is closer to the

Re: Coding style article with interesting section on white space

2005-01-30 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: The recent Pystone Benchmark message says that Python is only 75% as fast on Linux as on Windows. no, it really only says that the Pystone benchmark is 75% as fast as Linux as on Windows, on the poster's hardware, using his configuration, and using different compilers.

  1   2   3   4   5   6   7   8   9   10   >