[Ann] Voidspace Pythonutils Website Change and Updates

2005-01-12 Thread Michael Foord
The Voidspace Pythonutil Pages have had a long overdue overhaul. The url of the Voidspace Pythonutils homepage has changed. It is now : http://www.voidspace.org.uk/python/index.html There are now separate pages for programs, modules, recipes, and CGIs. Several of the bigger modules and programs

[ANN]: twander 3.160 Released And Available

2005-01-12 Thread Tim Daneliuk
'twander' Version 3.160 is now released and available for download at: http://www.tundraware.com/Software/twander The last public release was 3.146. Existing users are encouraged to upgrade to this release as it has a number of bug fixes and several nice new features including: - Mouse

Re: Wide Unicode build for Windows available somewhere?

2005-01-12 Thread Martin v. Löwis
[EMAIL PROTECTED] wrote: I am trying to locate a windows binary of a recent python (2.4 preferred, but not essential) with support for Unicode characters with values greater than 0x1. I have tested the python.org binaries and those from Activestate, both give me a traceback on unichr(0x1)

Re: Python.org, Website of Satan

2005-01-12 Thread Jon Perez
This would be funny except for the fact that there are actually people out there who will take this seriously. http://rmitz.org/freebsd.daemon.html Don't forget Python == Snake == Serpent == ... ;-D [EMAIL PROTECTED] wrote: python.org = 194.109.137.226 194 + 109 + 137 + 226 = 666 What is

Re: os.spawnv stdin trouble

2005-01-12 Thread Denis S. Otkidach
On Tue, 11 Jan 2005 19:08:01 +0100 Jelle Feringa // EZCT / Paris [EMAIL PROTECTED] wrote: Using the subprocess module, but still not making any real progress... I'm trying to make the examples given in the __doc__ work, without any success I'm afraid, have you had more luck with it? [...] p =

Re: The best way to do web apps with Python?

2005-01-12 Thread Ian Bicking
Paul Rubin wrote: Steve Holden [EMAIL PROTECTED] writes: You can read about it in Philip Eby's excellent PEP at http://www.python.org/peps/pep-0333.html I looked at this and I have the impression that it tries to do something worthwhile, but I can't tell precisely what. The rationale and goals

Re: Architecture of Python was removed ?

2005-01-12 Thread Gerrit Muller
Nick Coghlan wrote: cr999 wrote: I found the Architecture of Python ( http://wiki.cs.uiuc.edu/cs427/PYTHON By Jim Jackson, Kar-Han Tan )is very useful for my understanding of the Python's architecture. But I found the link is not link to that document today. It seems that the document was removed.

Re: tuples vs lists

2005-01-12 Thread Antoon Pardon
Op 2005-01-11, Reinhold Birkenfeld schreef [EMAIL PROTECTED]: Antoon Pardon wrote: Op 2005-01-10, Bruno Desthuilliers schreef [EMAIL PROTECTED]: Antoon Pardon a écrit : Op 2005-01-08, Bruno Desthuilliers schreef [EMAIL PROTECTED]: worzel a écrit : I get what the difference is between a

Re: Securing a future for anonymous functions in Python

2005-01-12 Thread Jacek Generowicz
Jeff Shannon [EMAIL PROTECTED] writes: I guess we'll have to agree to disagree Indeed :-) I find that reading a lambda requires mentally pushing a stack frame to parse the lambda and another to translate map() into a loop, whereas a list comp's expression doesn't require such a shift

Re: Securing a future for anonymous functions in Python

2005-01-12 Thread Jacek Generowicz
Donn Cave [EMAIL PROTECTED] writes: List incomprehensions do not parse well in my eyes. Are you familiar with the Haskell syntax for list comprehensions? For example: http://www.zvon.org/other/haskell/Outputsyntax/listQcomprehension_reference.html Does their striking similarity to

Re: OT: MoinMoin and Mediawiki?

2005-01-12 Thread Robin Becker
Brion Vibber wrote: Paul Rubin wrote: I think mod_php doesn't play nice with apache2 but am not aware of any cgi interoperability problems. Generally it's recommended to configure apache2 in the child process mode (eg the way that 1.3 works) when using PHP as many library modules are alleged

Re: Help Optimizing Word Search

2005-01-12 Thread Ganesan R
Case == Case Nelson [EMAIL PROTECTED] writes: Hi there I've just been playing around with some python code and I've got a fun little optimization problem I could use some help with. Basically, the program needs to take in a random list of no more than 10 letters, and find all possible

Re: Python.org, Website of Satan

2005-01-12 Thread kosh
On Tuesday 11 January 2005 7:06 pm, [EMAIL PROTECTED] wrote: python.org = 194.109.137.226 194 + 109 + 137 + 226 = 666 What is this website with such a demonic name and IP address? What evils are the programmers who use this language up to? Geeze did you miss out on the demon summoning

Re: Re: Python.org, Website of Satan

2005-01-12 Thread Tim Churches
TimC [EMAIL PROTECTED] wrote: Writing code that has to be indented *exactly* or it just won't work. I bet they all use eVIl VI too. -- TimC -- http://astronomy.swin.edu.au/staff/tconnors/ Hey, two (real, actual) TimCs from the same country posting to the same list on the same stupid

[ANN]: twander 3.160 Released And Available

2005-01-12 Thread Tim Daneliuk
'twander' Version 3.160 is now released and available for download at: http://www.tundraware.com/Software/twander The last public release was 3.146. Existing users are encouraged to upgrade to this release as it has a number of bug fixes and several nice new features including: - Mouse

PyCrypto 2.0, pysco 1.4 - Windows Binaries for 2.4

2005-01-12 Thread Fuzzyman
The location of the prebuilt windows installer for PyCypto 2.0 (for python 2.4) has changed. Apologies for any confusion, this is because of a website reorganisation at Voidspace. The new location is : http://www.voidspace.org.uk/python/modules.shtml#pycrypto There is also a prebuilt windows

Re: Game programming in Python

2005-01-12 Thread Neil Benn
Baza wrote: I'm looking for any books or on-line resources on game programming using Python. Does anyone have any advice? -- Computer says, 'no' Like the end quote : eh, eh, eeehh!! -- Neil Benn Senior Automation Engineer Cenix BioScience BioInnovations Zentrum Tatzberg 47 D-01307

Re: Another look at language comparisons

2005-01-12 Thread Jon Perez
Max M wrote: Jan Dries wrote: [EMAIL PROTECTED] wrote: And there is hope for Python, as Guido has recently been seen with a beard :-) http://www.tbray.org/ongoing/When/200x/2004/12/08/-big/IMG_3061.jpg LOL, he is working on linux, isn't he? So it was about bloody time. Guido Van Rossum is now

Re: Another look at language comparisons

2005-01-12 Thread Bengt Richter
On Wed, 12 Jan 2005 17:54:49 +0800, Jon Perez [EMAIL PROTECTED] wrote: Max M wrote: Jan Dries wrote: [EMAIL PROTECTED] wrote: And there is hope for Python, as Guido has recently been seen with a beard :-) http://www.tbray.org/ongoing/When/200x/2004/12/08/-big/IMG_3061.jpg LOL, he is

distutils linux script installation broken?

2005-01-12 Thread Cory Davis
Hi all, I have been successfully deploying my own python package with distutils for some time now, but lately, with Python 2.4, the build_scripts command has been behaving badly. In the part where it is supposed to adjust the first line of the script it now produces #!None instead of

Re: python3: 'where' keyword

2005-01-12 Thread Antoon Pardon
Op 2005-01-11, Jeff Shannon schreef [EMAIL PROTECTED]: Paul Rubin wrote: Steve Holden [EMAIL PROTECTED] writes: [...] and if you think that newbies will have their lives made easier by the addition of ad hoc syntax extensions then you and I come from a different world (and I suspect the walls

[Ann] PyName and downman

2005-01-12 Thread Fuzzyman
A couple of new 'modules' available from Voidspace Pythonutils. PyName http://www.voidspace.org.uk/python/modules.shtml#pyname Slightly tongue in cheek, this isn't really a python module. It's three lists of English words containing 'py' - intended to be helpful to those choosing names for

Re: Python unicode

2005-01-12 Thread P
Scott David Daniels wrote: [EMAIL PROTECTED] wrote: Because the coding is only supported in string literals. But I'm not sure exactly why. The why is the same as why we write in English on this newsgroup. Not because English is better, but because that leaves a single language for everyone to use

Re: else condition in list comprehension

2005-01-12 Thread Nick Coghlan
Luis M. Gonzalez wrote: Hi there, I'd like to know if there is a way to add and else condition into a list comprehension. I'm sure that I read somewhere an easy way to do it, but I forgot it and now I can't find it... for example: z=[i+2 for i in range(10) if i%2==0] what if I want i to be i-2 if

[Ann] Voidspace Pythonutils Website Change and Updates

2005-01-12 Thread Michael Foord
The Voidspace Pythonutil Pages have had a long overdue overhaul. The url of the Voidspace Pythonutils homepage has changed. It is now : http://www.voidspace.org.uk/python/index.html There are now separate pages for programs, modules, recipes, and CGIs. Several of the bigger modules and programs

Re: Command line and GUI tools : need a single threading solution

2005-01-12 Thread Adrian Casey
Adrian Casey wrote: Diez B. Roggisch wrote: I'm thinking it may be possible to modify the command line tools to use qt threads instead of native python threads. Is this the way to go? Are there other options? Why don't you use python threads in qt - I do so and so far it didn't make

Re: Python.org, Website of Satan

2005-01-12 Thread ToYKillAS
[EMAIL PROTECTED] wrote: python.org = 194.109.137.226 194 + 109 + 137 + 226 = 666 What is this website with such a demonic name and IP address? What evils are the programmers who use this language up to? damn Franc Maçons -- Even though I walk through the valley of the shadow of death, I will

Re: [Ann] Voidspace Pythonutils Website Change and Updates

2005-01-12 Thread Thorsten Pferdekämper
Michael Foord [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] The Voidspace Pythonutil Pages have had a long overdue overhaul. The url of the Voidspace Pythonutils homepage has changed. It is now : http://www.voidspace.org.uk/python/index.html Hi, do you mean

Re: python guy ide

2005-01-12 Thread lbolognini
This is commercial. Never tried it but it exists: http://visualwx.altervista.org/ Lorenzo -- http://mail.python.org/mailman/listinfo/python-list

Re: distutils linux script installation broken?

2005-01-12 Thread Albert Hofkamp
On Wed, 12 Jan 2005 10:09:03 +, Cory Davis [EMAIL PROTECTED] wrote: command has been behaving badly. In the part where it is supposed to adjust the first line of the script it now produces #!None instead of #!/whereverpythonis/python Has anyone else encountered this? I haven't

Re: [Ann] Voidspace Pythonutils Website Change and Updates

2005-01-12 Thread Fuzzyman
Blinkin nora... I did... sorry. Better add a redirect *sigh*. Thanks Fuzzy http://www.voidspace.org.uk/python/index.shtml -- http://mail.python.org/mailman/listinfo/python-list

Re: distutils linux script installation broken?

2005-01-12 Thread Cory Davis
Thanks Albert. I already do use #!/usr/bin/env python in my package directory, but the build_scripts part of setup.py install changes this line to #!None before copying to my bin directory. Cheers, Cory. Albert Hofkamp wrote: On Wed, 12 Jan 2005 10:09:03 +, Cory Davis [EMAIL PROTECTED]

Re: Python Installation

2005-01-12 Thread Simon Brunning
On Tue, 11 Jan 2005 21:00:40 +0100, Fredrik Lundh [EMAIL PROTECTED] wrote: 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 Good to see that it was effbot.org that was down, rather that the effbot

Re: [OT] SciTe

2005-01-12 Thread Lucas Raab
Fouff wrote: I use Scintilla which is Scite with a lot of configurations files. In directory exists a file cpp.properties and near the end of the file is describe the command line use to compile, to link, ... I think you would be able to change here the compiler. regards Fouff Thanks. --

Re: distutils linux script installation broken?

2005-01-12 Thread Christopher De Vries
I just installed python2.4 and used it to install a set of scripts I had previously been using distutils with. It worked fine, and replaced the first line with: #!/usr/local/bin/python2.4 distutils should replace that first line with the location of the binary used to run setup.py. Are you

how to visualize symbol table?

2005-01-12 Thread Thomas Korimort
Hi, how can i visualize the content of the symbol table in Python? Sometimes i want to know which symbols are imported from apackage and such kind of things Greetings, THomas Korimort -- http://mail.python.org/mailman/listinfo/python-list

Re: distutils linux script installation broken?

2005-01-12 Thread Cory Davis
Hi Christopher distutils should replace that first line with the location of the binary used to run setup.py. Are you running setup with the following command line? python setup.py install Yes. A possible complication is that I also have python 2.3.? on that machine, which I am reluctant to

Re: how to visualize symbol table?

2005-01-12 Thread Pierre Barbier de Reuille
Thomas Korimort a écrit : Hi, how can i visualize the content of the symbol table in Python? Sometimes i want to know which symbols are imported from apackage and such kind of things Greetings, THomas Korimort Do you mean something like : dir(module) ??? Pierre --

Re: Help Optimizing Word Search

2005-01-12 Thread Win
Hi Case. Just in case you're really, truly looking for a fast Scrabble word-search algorithm, the classic AI/CS article here is: Andrew W. Appel and Guy J. Jacobson, The world's fastest Scrabble program, Communications of the ACM, 31(5), pp 572--578, May 1988. You can find a copy of this

Re: Excel module for Python

2005-01-12 Thread Simon Brunning
On Wed, 12 Jan 2005 15:18:09 +0800, sam [EMAIL PROTECTED] wrote: I m wondering which Excel module is good to be used by Python? If you are on Windows, and you have Excel, then the Python for Windows extensions[1] are all you need to drive Excel via COM. O'Reilly's Python Programming on Win32

Re: Excel module for Python

2005-01-12 Thread Peter Hansen
sam wrote: I m wondering which Excel module is good to be used by Python? Just use Excel's COM interface. See also this helpful page to improve future responses: http://www.catb.org/~esr/faqs/smart-questions.html -Peter -- http://mail.python.org/mailman/listinfo/python-list

Re: Python unicode

2005-01-12 Thread Michel Claveau - abstraction méta-galactique non triviale en fuite perpétuelle.
Hi ! Sorry, but I think that, for russians, english is an *add-on*, and not a common-denominator. English is the most known language, but it is not common. It is the same difference as between co-operation and colonization. Have a good day -- Michel Claveau --

Re: shutil.move has a mind of its own

2005-01-12 Thread Istvan Albert
Daniel Bickett wrote: In my script, rather than a file being moved to the desired location, it is, rather, moved to the current working directory (in this case, my desktop -- without any exceptions, mind you). As it happens, the what is the output generated by the lines: fdir, fname =

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

2005-01-12 Thread Paul Rubin
[EMAIL PROTECTED] writes: I can't imagine how it could be worse than the learning curve of __metaclass__, which we already have. To me, learning macros *and their subtilities* was much more difficult than learning metaclasses. I guess I've only used Lisp macros in pretty straightforward

Re: Help Optimizing Word Search

2005-01-12 Thread Scott David Daniels
Paul Rubin wrote: Case Nelson [EMAIL PROTECTED] writes: Basically, the program needs to take in a random list of no more than 10 letters, and find all possible mutations that match a word in my dictionary (80k words). However a wildcard letter '?' is also an acceptable character which increases

Re: Time script help sought!

2005-01-12 Thread kpp9c
paul that is awesome so much better than what i did which was lamo brute force method. I formmatted and reformatted my input data and stuffed it in a HUGE dictionary it was stupid and kludgy i hope to study all these approaches and learn something here's what i came up with ...

Re: Python unicode

2005-01-12 Thread Scott David Daniels
[EMAIL PROTECTED] wrote: Scott David Daniels wrote: If you allow non-ASCII characters in symbol names, your source code will be unviewable (and uneditable) for people with ASCII-only terminals, never mind how comprehensible it might otherwise be. So how does one edit non ascii string literals at

Re: Excel module for Python

2005-01-12 Thread sam
Simon Brunning wrote: On Wed, 12 Jan 2005 15:18:09 +0800, sam [EMAIL PROTECTED] wrote: I m wondering which Excel module is good to be used by Python? If you are on Windows, and you have Excel, then the Python for Windows extensions[1] are all you need to drive Excel via COM. O'Reilly's Python

Re: distutils linux script installation broken?

2005-01-12 Thread Christopher De Vries
I've got python 2.3.3, 2.4, and 1.5.2 (which came preinstalled) on my linux box. It's redhat 7.2 (I know... I would upgrade, but it would void my service contract, so I just install things in /usr/local). You can check if PYTHONHOME or PYTHONPATH are set, which may somehow be interfering. I don't

java 5 could like python?

2005-01-12 Thread vegetax
I was a java developer one year ago ,before i moved to python i realy liked it at the beggining, but i got very disapointed lately since my previus two python proyects where relatively big,and python didnt feel well suited for the task. The reasons are mainly due to the standard library,the

Re: Excel module for Python

2005-01-12 Thread Simon Brunning
On Wed, 12 Jan 2005 23:19:44 +0800, sam [EMAIL PROTECTED] wrote: No, I don't use MS windows. I need to generate Excel file by printing data to it, just like Perl module Spreadsheet::WriteExcel. If it's just data that needs to go into your spreadsheet, then I'd just build a CSV file if I were

Re: Excel module for Python

2005-01-12 Thread Peter Hansen
sam wrote: On Wed, 12 Jan 2005 15:18:09 +0800, sam [EMAIL PROTECTED] wrote: I m wondering which Excel module is good to be used by Python? [snip] No, I don't use MS windows. I need to generate Excel file by printing data to it, just like Perl module Spreadsheet::WriteExcel. Excel can read CSV

Re: Detecting shutdown of remote socket endpoint.

2005-01-12 Thread Michael Hobbs
Tim Gosselin [EMAIL PROTECTED] wrote: I am writing a tcp tunnel but cannot find a way of detecting when a socket shuts down its read end without writing to the socket. For testing the write end of the remote endpoint I just do a: if not sock.recv(buffsize) I cannot write to the socket and

RE: Excel module for Python

2005-01-12 Thread Tim Golden
[Simon Brunning] [sam [EMAIL PROTECTED]] wrote: | No, I don't use MS windows. I need to generate Excel file | by printing | data to it, just like Perl module Spreadsheet::WriteExcel. | | If you need to write out formulae, formratting, that kind of thing, | then I think you'll need to write a

2 versions of python on 1 machine

2005-01-12 Thread flupke
Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Lines: 15 Message-ID: [EMAIL PROTECTED] Date: Thu, 06 Jan 2005 15:13:42 GMT NNTP-Posting-Host: 212.123.8.34 X-Complaints-To: [EMAIL PROTECTED] X-Trace: phobos.telenet-ops.be 1105024422 212.123.8.34 (Thu, 06

Iteration over two sequences

2005-01-12 Thread Henrik Holm
I am just starting to learn Python, mostly by going through the examples in Dive Into Python and by playing around. Quite frequently, I find the need to iterate over two sequences at the same time, and I have a bit of a hard time finding a way to do this in a pythonic fashion. One example is a

Re: Python.org, Website of Satan

2005-01-12 Thread Gerhard Haering
On Wed, Jan 12, 2005 at 10:15:34AM -0500, Jane wrote: [...] Some people have too much time on their hands... OMG, PyPy is full of evil, too!!!1 print sum([ord(x) for x in PyPy]) or, if you haven't upgraded to 2.4, yet: import operator print reduce(operator.add, [ord(x) for x in

Re: Iteration over two sequences

2005-01-12 Thread Diez B. Roggisch
zip or izip is your friend: import itertools a = [1,2,3] b = ['a', 'b', 'c'] for a,b in itertools.izip(a, b): print a, b -- Regards, Diez B. Roggisch -- http://mail.python.org/mailman/listinfo/python-list

Newbie: module structure and import question

2005-01-12 Thread Ziong
hi all, i have question on how to design a module structure. for example, i have 3 files. [somewhere]/main.py [somewhere]/myLib/Base/BaseA.py [somewhere]/myLib/ClassA.py main.py === from myLib.ClassA import ClassA a = classA() dir(a) myLib/ClassA.py === from myLib.Base.BaseA

Re: Iteration over two sequences

2005-01-12 Thread Paul McGuire
Henrik Holm [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I am just starting to learn Python, mostly by going through the examples in Dive Into Python and by playing around. Quite frequently, I find the need to iterate over two sequences at the same time, and I have a bit of a

Re: Iteration over two sequences

2005-01-12 Thread Richard Brodie
Henrik Holm [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I suppose I could also use a lambda here -- but is there a different, efficient, and obvious solution that I'm overlooking? Check the itertools recipes in the library documentation. --

Re: Python.org, Website of Satan

2005-01-12 Thread Jane
[EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] python.org = 194.109.137.226 194 + 109 + 137 + 226 = 666 What is this website with such a demonic name and IP address? What evils are the programmers who use this language up to? Some people have too much time on their hands...

Re: Excel module for Python

2005-01-12 Thread [EMAIL PROTECTED]
that's easy. Just make an html file of your data, using tables and save it as a *.xls and excel will think it's an excel file. -- http://mail.python.org/mailman/listinfo/python-list

Re: Iteration over two sequences

2005-01-12 Thread Henrik Holm
Richard Brodie [EMAIL PROTECTED] wrote: Henrik Holm [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I suppose I could also use a lambda here -- but is there a different, efficient, and obvious solution that I'm overlooking? Check the itertools recipes in the library

ConfigParser - add a stop sentinel?

2005-01-12 Thread rzed
I am working with PythonCard in one of my apps. For its purposes, it uses an .ini file that is passed to ConfigParser. For my app, I also need configuration information, but for various reasons, I'd rather use a syntax that ConfigParser can't handle. I know I can maintain two separate

Re: java 5 could like python?

2005-01-12 Thread Roman Suzi
joking 1/2 On Wed, 12 Jan 2005, vegetax wrote: -No naming convention. The speech of it fits in my head is no longer valid when i use a lot of functionality,modules,classes in a large proyect. For example if i remember a function i want ie:get attribute, i dont remember if the module implementer

Re: complex numbers

2005-01-12 Thread It's me
Precisely. One have to convert complex number into vectors, and vector of complex numbers into vector of vectors, list of complex numbers into list of vectors, , you get the idea. And my code no longer look like the equation I have on paper... Like I said, I've travelled down that path

property () for Java Programmers ?

2005-01-12 Thread michael
Hi there, I am somewhat confused by the following : class C(object): def getx(self): return self.__x def setx(self, value): self.__x = extended + value def delx(self): del self.__x x = property(getx, setx, delx, I'm the 'x' property.) So far so good :-) But what to do with this

Re: Iteration over two sequences

2005-01-12 Thread John Lenton
Quite frequently, I find the need to iterate over two sequences at the same time, and I have a bit of a hard time finding a way to do this in a pythonic fashion. One example is a dot product. The straight-ahead C-like way of doing it would be: def dotproduct(a, b): psum = 0 for i in

Re: 2 versions of python on 1 machine

2005-01-12 Thread Peter Hansen
flupke wrote: I searched with Google and on this newsgroups and i didn't find any info regarding this. If there is more info, please redirect me to that info. [snip] The above looks like a glitch or accidental repost of the post that started this thread:

Re: Python.org, Website of Satan

2005-01-12 Thread Craig Ringer
On Wed, 2005-01-12 at 16:58 +0100, Gerhard Haering wrote: On Wed, Jan 12, 2005 at 10:15:34AM -0500, Jane wrote: [...] Some people have too much time on their hands... OMG, PyPy is full of evil, too!!!1 print sum([ord(x) for x in PyPy]) or, if you haven't upgraded to 2.4, yet:

[ANNOUNCE] Twenty-first release of PythonCAD now available

2005-01-12 Thread Art Haas
I'm pleased to announce the twenty-first development release of PythonCAD, a CAD package for open-source software users. As the name implies, PythonCAD is written entirely in Python. The goal of this project is to create a fully scriptable drafting program that will match and eventually exceed

Why would I get a TypeEror?

2005-01-12 Thread It's me
For this code snip: a=3 b=(1,len(a))[isinstance(a,(list,tuple,dict))] Why would I get a TypeError from the len function? Thanks, -- http://mail.python.org/mailman/listinfo/python-list

Re: property () for Java Programmers ?

2005-01-12 Thread Steven Bethard
michael wrote: Hi there, I am somewhat confused by the following : class C(object): def getx(self): return self.__x def setx(self, value): self.__x = extended + value def delx(self): del self.__x x = property(getx, setx, delx, I'm the 'x' property.) So far so good :-) But what to

Removing M2Crypto debug data in production code

2005-01-12 Thread Ola Natvig
Hi all I'm writing a SSL server and we are using M2Crypto as our SSL engine. What bothers me is that on every accept it prints a lot of 'junk-data' to my stdout. It would be nice if someone knew a way to get M2Crypto out of debug mode and into a more silent mode. LOOP: SSL accept:

Re: Architecture of Python was removed ?

2005-01-12 Thread Skip Montanaro
Someone Does anyone here have a copy of that document? Or who can tell Someone me what is the email address of Jim Jackson or Kar-Han Tan. Nick http://web.archive.org/web/2003101953/http://wiki.cs.uiuc.edu/cs427/PYTHON Gerrit This is again a nice document, and an example of

Re: a new Perl/Python a day

2005-01-12 Thread Jeff Shannon
Jon Perez wrote: ... or why 'Perl monkey' is an oft-heard term whereas 'Python monkey' just doesn't seem to be appropriate? That's just because pythons are more likely to *eat* a monkey than to be one :) Jeff Shannon Technician/Programmer Credit International --

Re: OT: MoinMoin and Mediawiki?

2005-01-12 Thread Alexander Schremmer
On 11 Jan 2005 21:24:51 -0800, Paul Rubin wrote: [backlinks] Searching instead of indexing makes it very resilient :-) How does it do that? It has to scan every page in the entire wiki?! That's totally impractical for a large wiki. So you want to say that c2 is not a large wiki? :-) Kind

Re: java 5 could like python?

2005-01-12 Thread more i squawed
vegetax wrote : I was a java developer one year ago ,before i moved to python i realy liked it at the beggining, but i got very disapointed lately since my previus two python proyects where relatively big,and python didnt feel well suited for the task. The reasons are mainly due to the

Refactoring; arbitrary expression in lists

2005-01-12 Thread Frans Englich
As continuation to a previous thread, PyChecker messages, I have a question regarding code refactoring which the following snippet leads to: runner.py:200: Function (detectMimeType) has too many returns (11) The function is simply a long else-if clause, branching out to different return

Re: Why would I get a TypeEror?

2005-01-12 Thread harold fellermann
On 12.01.2005, at 18:35, It's me wrote: For this code snip: a=3 b=(1,len(a))[isinstance(a,(list,tuple,dict))] Why would I get a TypeError from the len function? because len() works only for sequence and mapping objects: help(len) Help on built-in function len in module __builtin__: len(...)

Re: Why would I get a TypeEror?

2005-01-12 Thread harold fellermann
On 12.01.2005, at 18:35, It's me wrote: For this code snip: a=3 b=(1,len(a))[isinstance(a,(list,tuple,dict))] Why would I get a TypeError from the len function? the problem is, that (1,len(a)) is evaluated, neither what type a actually has (python has no builtin lazy evaluation like ML). You

Re: ConfigParser - add a stop sentinel?

2005-01-12 Thread Larry Bates
You should probably consider NOT doing what you suggest. You would need to do some rather extensive work so you can support the .write method of ConfigParser. With a little ingenuity I've been able to user ConfigParser to support some very different and complex syntaxes on different projects.

counting items

2005-01-12 Thread It's me
Okay, I give up. What's the best way to count number of items in a list? For instance, a=[[1,2,4],4,5,[2,3]] I want to know how many items are there in a (answer should be 7 - I don't want it to be 4) I tried: b=len([x for y in a for x in y]) That doesn't work because you would get an

Re: Iteration over two sequences

2005-01-12 Thread It's me
I tried this and I got: [(1, 'a'), (2, 'b'), (3, 'c')] But if I change: a=[1,2] I got: [(1, 'c')] Why is that? I thought I should be getting: [(1, 'a'),(2,'b')] ? Diez B. Roggisch [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] zip or izip is your friend: import

Re: Why would I get a TypeEror?

2005-01-12 Thread Peter Hansen
It's me wrote: For this code snip: a=3 b=(1,len(a))[isinstance(a,(list,tuple,dict))] Why would I get a TypeError from the len function? What did you expect the length of the integer 3 to be? -Peter -- http://mail.python.org/mailman/listinfo/python-list

Re: counting items

2005-01-12 Thread Andrew Koenig
It's me [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] What's the best way to count number of items in a list? For instance, a=[[1,2,4],4,5,[2,3]] I want to know how many items are there in a (answer should be 7 - I don't want it to be 4) How about this? def totallen(x):

Re: counting items

2005-01-12 Thread Mark McEahern
It's me wrote: Okay, I give up. What's the best way to count number of items in a list [that may contain lists]? a = [[1,2,4],4,5,[2,3]] def iterall(seq): for item in seq: try: for subitem in iterall(item): yield subitem except TypeError:

Re: Newbie: Pythonwin

2005-01-12 Thread drs
Brent W. Hughes [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] 1) I'm running a program within Pythonwin. It's taking too long and I want to stop/kill it. What do I do (other than ctrl-alt-del)? Right click on the little python icon in the sys tray and select break into running

Re: counting items

2005-01-12 Thread Paul McGuire
It's me [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Okay, I give up. What's the best way to count number of items in a list? For instance, a=[[1,2,4],4,5,[2,3]] I want to know how many items are there in a (answer should be 7 - I don't want it to be 4) snip I've sure seen

Re: Iteration over two sequences

2005-01-12 Thread Henrik Holm
John Lenton [EMAIL PROTECTED] wrote: def dotproduct(a, b): psum = 0 for i in range(len(a)): psum += a[i]*b[i] return psum for this particular example, the most pythonic way is to do nothing at all, or, if you must call it dotproduct, from Numeric import dot as

Re: complex numbers

2005-01-12 Thread Robert Kern
It's me wrote: Robert Kern [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] That's *it*. So, how would you overload an operator to do: With native complex support: def twice(a): return 2*a print twice(3+4j), twice(2), twice(abc) Let's presume for a moment that complex is *not* a

Re: counting items

2005-01-12 Thread Anthony
On Wed, 12 Jan 2005 17:42:50 GMT, It's me [EMAIL PROTECTED] wrote: Okay, I give up. What's the best way to count number of items in a list? How long is a piece of string? There are many different ways, which give you different trade offs. For instance, a=[[1,2,4],4,5,[2,3]] I want to

Re: Why would I get a TypeEror?

2005-01-12 Thread It's me
Sorry if my question was a little lazy and yes, I was asking about the lazy evaluation. :=) I am surprised about this (and this can be dangerous, I guess). If this is true, I would run into trouble real quick if I do a: (1/x,1.0e99)[x==0] and that's not good. Something to keep in mind. :-(

Re: complex numbers

2005-01-12 Thread Terry Reedy
It's me [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Precisely. One have to convert complex number into vectors, and vector of complex numbers into vector of vectors, list of complex numbers into list of vectors, , you get the idea. No, one would have a class with all

Re: counting items

2005-01-12 Thread It's me
Oh, darn. I asked this kind of question before. plonk, plonk Somebody posted an answer before: def flatten(seq): for x in seq: if hasattr(x, __iter__): for subx in flatten(x): yield subx else: yield x data = [[1,5,2],8,4] val_to_pos

Re: Refactoring; arbitrary expression in lists

2005-01-12 Thread Paul McGuire
Frans Englich [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] As continuation to a previous thread, PyChecker messages, I have a question regarding code refactoring which the following snippet leads to: runner.py:200: Function (detectMimeType) has too many returns (11) The

Re: counting items

2005-01-12 Thread It's me
Yes, Mark, I came up with almost the same code (after reading back old answers from this list): def flatten(seq): for x in seq: if hasattr(x, __iter__): for subx in flatten(x): yield subx else: yield x def count_item(data): return

Re: OT: MoinMoin and Mediawiki?

2005-01-12 Thread Paul Rubin
Alexander Schremmer [EMAIL PROTECTED] writes: How does it do that? It has to scan every page in the entire wiki?! That's totally impractical for a large wiki. So you want to say that c2 is not a large wiki? :-) I don't know how big c2 is. My idea of a large wiki is Wikipedia. My guess is

Re: counting items

2005-01-12 Thread Steven Bethard
Mark McEahern wrote: It's me wrote: Okay, I give up. What's the best way to count number of items in a list [that may contain lists]? a = [[1,2,4],4,5,[2,3]] def iterall(seq): for item in seq: try: for subitem in iterall(item): yield subitem except

  1   2   3   >