Re: Scket connection to server

2005-07-01 Thread Irmen de Jong
Christopher Subich wrote: > Steve Horsley wrote: > >> There is a higher level socket framework called twisted that everyone >> seems to like. It may be worth looking at that too - haven't got round >> to it myself yet. > > > I wouldn't say 'like,' exactly. I've cursed it an awful lot (mostly

Re: Dr. Dobb's Python-URL! - weekly Python news and links (Jun 29)

2005-07-01 Thread Peter Maas
Simon Brunning schrieb: > Sibylle Koczian needs to sort part of a list. His first attempt made > the natural mistake - sorting a *copy* of part of the list: I think it was _her_ first attempt. -- --- Peter Maas, M+R Infosy

Re: Speaking of list-comprehension?

2005-07-01 Thread Chinook
Thank you all for taking the time to consider and respond. I had received the answer OL and responded with: > Thank you, and your elaboration is well taken. I was just exploring here > and the construct you noted is IMHO intuitively readable - at least for a > simple expression and cond

Re: Speaking of list-comprehension?

2005-07-01 Thread Andrew Durdin
On 7/1/05, Chinook <[EMAIL PROTECTED]> wrote: > Thank you Andrew, and your elaboration is well taken. I was just > exploring here and the construct you noted is IMHO intuitively readable > - at least for a simple expression and condition. Other than the > choice order [False, True] which see

Windows installation - questions about DLLs

2005-07-01 Thread Guillaume Hiron
Hi, I need to install python (2.3.5) on windows without the giving installer program. Do you know what dlls are needed? I found python23.dll, but the other (msvcrt.dll,msvcrit.dll) seems not be useful. Is there other dll? Are msvcrt.dll and msvcrit.dll used by something?(test/test___all__.py retur

Re: map vs. list-comprehension

2005-07-01 Thread George Sakkis
"Terry Hancock" wrote: > On Thursday 30 June 2005 09:49 am, Mike P. wrote: > > > IMHO I'm not particularly happy with the way Python is going language wise. > > I mean, I don't think I'll ever use decorators, for example. Personally, in > > terms of language features and capabilities I think the l

Re: Windows installation - questions about DLLs

2005-07-01 Thread kuoxin
python23.dll requires msvcrt.dll basically. if you use some .pyd, python requires other dll. for example: import _mysql # you must add a libmysql.dll for this module kuoxin Guillaume Hiron wrote: > Hi, > > I need to install python (2.3.5) on windows without the giving installer > program. > Do

python project layout

2005-07-01 Thread Huron
Hi, What do you guys recommend in terms of python project layout, especially unit tests layout ? Zope has unit tests per packages, twisted has a big tests directory full of tests ... and the file naming convention are also pretty differents ... I guess there is part of "pe

nested lists - utter newbie

2005-07-01 Thread rahoool
Hi, why is this possible - >>>b = [1,2,3] >>>b[2] = b >>>b [1,2,[...]] >>>b[2] [1,2,[...]] >>>b[2][2][2][2][2] [1,2,[...]] but this is not - >>>x = [1,2,x] Traceback (most recent call last): File "", line 1, in ? NameError: name 'x' is not defined thanks r_a_h_o_o_l -- http://mail.python.org/

Re: whois like functionality on Windows?

2005-07-01 Thread Gerrit Muller
Peter Hansen wrote: > If the address doesn't get mapped to a name by a DNS server, I strongly > suspect you will get nowhere with whois, or much else. Not all IP > addresses have corresponding domain names: many are dynamic addresses > assigned on the fly to arbitrary customers of (for example

Re: Dr. Dobb's Python-URL! - weekly Python news and links (Jun 29)

2005-07-01 Thread Simon Brunning
On 7/1/05, Peter Maas <[EMAIL PROTECTED]> wrote: > Simon Brunning schrieb: > > Sibylle Koczian needs to sort part of a list. His first attempt made > > the natural mistake - sorting a *copy* of part of the list: > > I think it was _her_ first attempt. Ooops! Sorry, Sibylle. -- Cheers, S

Re:

2005-07-01 Thread Adriaan Renting
I'm not a very experienced Python programmer yet, so I might be mistaken, but there are a few things that would make me prefer C++ over Python for large (over 500.000 LOC) projects. - namespaces - templates - strong type checking - data hiding - more available libraries and more advanced developeme

Re: Thoughts on Guido's ITC audio interview

2005-07-01 Thread Ville Vainio
> "Timothy" == Delaney, Timothy (Tim) <[EMAIL PROTECTED]> writes: Timothy> Absolutely. I've really tried to use Eclipse - it's the Timothy> standard editor for my current project (Java - blegh!). I Timothy> *hate* it. It's huge, bulky, slow ... I've gone back to Timothy> my tex

Re:

2005-07-01 Thread Thomas Heller
"Adriaan Renting" <[EMAIL PROTECTED]> writes: > I'm not a very experienced Python programmer yet, so I might be > mistaken, but there are a few things that would make me prefer C++ over > Python for large (over 500.000 LOC) projects. > - namespaces > - templates > - strong type checking > - data h

Re:

2005-07-01 Thread Thomas Heller
Thomas Heller <[EMAIL PROTECTED]> writes: > "Adriaan Renting" <[EMAIL PROTECTED]> writes: > >> I'm not a very experienced Python programmer yet, so I might be >> mistaken, but there are a few things that would make me prefer C++ over >> Python for large (over 500.000 LOC) projects. >> - namespaces

How to compare files

2005-07-01 Thread Lad
Hi, What is the best method for comparing two files by words? I was thinking about reading files by words and compare them but a word in one file can be linked with a new line character ( \n) and this '\n' will cause that the words will considered to be different( eventhough without '\n' are the sa

Re: Splitting string into dictionary

2005-07-01 Thread Terry Hancock
On Friday 01 July 2005 12:35 am, David Pratt wrote: > Wow Robert that is incredible python magic! I am trying to figure out > what this is doing since my attempts were regex and some long string > splitting and collection. Try it out in the interpreter: Test data: >>> test = "'en' | 'the brown

Re: How to compare files

2005-07-01 Thread [EMAIL PROTECTED]
you could always just remove those special characters (\n \t ..), remove spaces, read both files and compare string. I don't this is the best way of doing this... but maybe a combination of this way and yours will be efficient enough - remove all problematic characters and then compare line by line

Re: nested lists - utter newbie

2005-07-01 Thread Benjamin Niemann
[EMAIL PROTECTED] wrote: > Hi, > why is this possible - b = [1,2,3] b[2] = b b > [1,2,[...]] b[2] > [1,2,[...]] b[2][2][2][2][2] > [1,2,[...]] > > but this is not - x = [1,2,x] > Traceback (most recent call last): > File "", line 1, in ? > NameError: name 'x' is not defi

Re: Modules for inclusion in standard library?

2005-07-01 Thread Max M
Reinhold Birkenfeld wrote: > Hello, > > Do you have any other good and valued Python modules that you would think are > bug-free, mature (that includes a long release distance) and useful enough to > be granted a place in the stdlib? > > For my part, ctypes seems like a suggestion to start with.

Problem with struct.unpack

2005-07-01 Thread Kuner Martin
Title: Problem with struct.unpack Hi all, I have the following question/problem: >>> import struct >>> strBuffer = u'\x00\xf0\x00\x00\x00\x00\x00\x00' >>> print "%r" % strBuffer u'\x00\xf0\x00\x00\x00\x00\x00\x00' >>> (doorOpen,) = struct.unpack("1x1B6x", strBuffer) Traceback (most r

Re: Escaping commas within parens in CSV parsing?

2005-07-01 Thread Edvard Majakari
[EMAIL PROTECTED] writes: > I am trying to use the csv module to parse a column of values > containing comma-delimited values with unusual escaping: > > AAA, BBB, CCC (some text, right here), DDD > > I want this to come back as: > > ["AAA", "BBB", "CCC (some text, right here)", "DDD"] Quick and s

Re: Programmers Contest: Fit pictures on a page

2005-07-01 Thread Edvard Majakari
Dan Sommers <[EMAIL PROTECTED]> writes: > There's some sort of irony or something in there about not writing the > best genetic algorithm, but I can't quite put my finger on it. +1 QOTW :) -- # Edvard Majakari Software Engineer # PGP PUBLIC KEY available Soli Deo Gloria! $_

How to execute stored procedure?

2005-07-01 Thread godwin
Hi, I would like to execute an oracle stored procedure using the any oracle database module which satisfies the Database Specification standard. I have tried cxOracle and Odbc database packages with no success. If u have the answer plz give me an example code. Thank you -- http://mail.python.or

accessing individual element in a list.

2005-07-01 Thread future_retro
hi all,could someone clear this up for me. I'm sure it's probably very simple but I can't seem to get my head round it. doing the following >>> import wmi >>> c = wmi.WMI() >>> for printdriver in c.Win32_PrinterDriver(): ... pd = printdriver.Name >>> print pd AGFA-AccuSet v52.3,3,Windows

Re: accessing individual element in a list.

2005-07-01 Thread [EMAIL PROTECTED]
>>> import wmi >>> c = wmi.WMI() >>> for printdriver in c.Win32_PrinterDriver(): ... pd = printdriver.Name >>> print pd AGFA-AccuSet v52.3,3,Windows NT x86 >>> pd[1] # type(pd) == str u'G' >>> pd.split(',') # split returns a new list, and you do not save it [u'AGFA-AccuSet v52.3', u'3', u'Wi

Re: Thoughts on Guido's ITC audio interview

2005-07-01 Thread Fabio Zadrozny
Ville Vainio wrote: >>"Timothy" == Delaney, Timothy (Tim) <[EMAIL PROTECTED]> writes: >> >> > >Timothy> Absolutely. I've really tried to use Eclipse - it's the >Timothy> standard editor for my current project (Java - blegh!). I >Timothy> *hate* it. It's huge, bu

PyQT, QProcess.readyReadStdout() problem

2005-07-01 Thread aljosa
part of code: >>> try: self.isdnlog = QProcess(self) self.isdnlog.addArgument("/usr/bin/tail") self.isdnlog.addArgument("-f") self.isdnlog.addArgument("/home/aljosa/qt/isdn.log") [...] QObject.connect(self.isdnlog, SIGNAL("readyReadStdout()"), self.onPhoneCall) self.isdnlog.start() <<< pro

Re: accessing individual element in a list.

2005-07-01 Thread future_retro
the square brackets round the output of split got me. Have plit into a new list and all works as expeted. Cheers, MW. -- http://mail.python.org/mailman/listinfo/python-list

New tapos test area for wxWindows 2.6.1

2005-07-01 Thread Nigel Rowberry
There is a new winbin for testing upgraded tapos - and it does need testing \\Blackbox\public\tapos\newwinbin-wx2.6.1 -- http://mail.python.org/mailman/listinfo/python-list

Re: Python for everything?

2005-07-01 Thread Tom Anderson
On Thu, 30 Jun 2005 [EMAIL PROTECTED] wrote: > can Python "do it all"? More or less. There are two places where python falls down, IMHO. One is performance: python isn't generally as fast as C or Java, even with Psyco. However, the number of cases where performance - and absolute straight-line

Re: map vs. list-comprehension

2005-07-01 Thread Tom Anderson
On Thu, 30 Jun 2005, Roy Smith wrote: > Terry Hancock <[EMAIL PROTECTED]> wrote: > >> One of the strengths of Python has been that the language itself is >> small (which it shares with C and (if I understand correctly, not being >> a lisp programmer?) Lisp), but with all the syntax enhancements

Re: class attribute to instance attribute

2005-07-01 Thread Donnal Walter
Devan L wrote: > Why make it an instance attribute? Couldn't you just look at > the class attribute? Each "presenter" (instance) needs its own "view" (instance). The class attribute references a wxPython class. The resulting instance attribute references a wxPython object (widget or container)

Re: map vs. list-comprehension

2005-07-01 Thread Tom Anderson
On Fri, 1 Jul 2005, George Sakkis wrote: > "Terry Hancock" wrote: > > Keeping the language small is a worthwhile goal, but it should be traded > off with conciseness and readability; otherwise we could well be content > with s-expressions. There's quite a number of satisfied LISP programmers ou

Re:

2005-07-01 Thread Tom Anderson
On Fri, 1 Jul 2005, Adriaan Renting wrote: > I'm not a very experienced Python programmer yet, so I might be > mistaken, but there are a few things that would make me prefer C++ over > Python for large (over 500.000 LOC) projects. Hmm. I don't know C++, but here goes ... > - namespaces Aren't

Re: Debugger Confusion

2005-07-01 Thread Colin J. Williams
Adriaan Renting wrote: > I use the debugger that comes with Eric3, but it is only free for Linux/ > OS X, as it needs PyQt. > asside from setting (conditional) breakpoints, one of it's features is > that it can show you a browsable tree of all your variables. something > like this: > class MyClass

LOC in Python and C++ in large projects

2005-07-01 Thread Adriaan Renting
I think the point you want to make is that Python needs vastly less lines of code as a similar application written in C++. I think Python might on average be 50-60% of comparable C++ code, but not the 1-2% you seem to want to claim. LOC is a somewhat arbitrairy measurement, but it gives an idea of

Re: Python for everything?

2005-07-01 Thread Luis M. Gonzalez
Let me express it with an exaple (by the way, sorry for my bad english): Suppose you are planning to build a house. You have two choices: - Option one: Buy several thousands bricks, doors, tiles, windows, etc... put them all together according to the blueprints and build your home. - Option two: Ge

Re: Modules for inclusion in standard library?

2005-07-01 Thread Ivan Van Laningham
Hi All-- Max M wrote: > > Another good bet is BeautifulSoup, which is absolutely great for > scraping content from webpages. > > http://crummy.com/software/BeautifulSoup/index.html > Not if you want to handle HTML in anything but ASCII. BeautifulSoup insists you change your site.py to change

Question about Python

2005-07-01 Thread Jan Danielsson
Hello all, I recently started using Python, and I must say I like it. Both the language and libraries available for it. Background: I have written an application which I use to keep track of my personal economy. I wrote it in Java because I wanted to learn the language for a course in progr

Re: How to compare files

2005-07-01 Thread Brett g Porter
Lad wrote: > Hi, > What is the best method for comparing two files by words? > I was thinking about reading files by words and compare them but a word > in one file can be linked with a new line character ( \n) > and this '\n' will cause that the words will considered to be > different( eventhough

Re: Windows installation - questions about DLLs

2005-07-01 Thread Larry Bates
Take a look at py2exe it provides a way to "collect" all necessary files together for you. Add Inno Installer to the mix and you can create setup.exe insallation programs that don't require a Python install to distribute software. -Larry Bates Guillaume Hiron wrote: > Hi, > > I need to install

Re:

2005-07-01 Thread Adriaan Renting
Adriaan Renting| Email: [EMAIL PROTECTED] ASTRON | Phone: +31 521 595 217 P.O. Box 2 | GSM: +31 6 24 25 17 28 NL-7990 AA Dwingeloo | FAX: +31 521 597 332 The Netherlands| Web: http://www.astron.nl/~renting/ >>> Tom Anderson <[EMAIL PROTECTED]> 07/01

map/filter/reduce/lambda opinions and background unscientific mini-survey

2005-07-01 Thread Tom Anderson
Comrades, During our current discussion of the fate of functional constructs in python, someone brought up Guido's bull on the matter: http://www.artima.com/weblogs/viewpost.jsp?thread=98196 He says he's going to dispose of map, filter, reduce and lambda. He's going to give us product, any and

Re: How to run commands in command line from a script

2005-07-01 Thread Mike Meyer
Peter Hansen <[EMAIL PROTECTED]> writes: > Ivan Shevanski wrote: >> Alright well I'm quite a noob and when I run a simple command to >> change the current directory, nothing happens. I made a little test >> script to show it: >> import os >> cwd = os.getcwd() >> print cwd >> os.system('cd = C:\Pr

Re: Which kid's beginners programming - Python or Forth?

2005-07-01 Thread Colin J. Williams
BORT wrote: > Please forgive me if this is TOO newbie-ish. > > I am toying with the idea of teaching my ten year old a little about > programming. I started my search with something like "best FREE > programming language for kids." After MUCH clicking and high-level > scanning, I am looking at P

Re: Dr. Dobb's Python-URL! - weekly Python news and links (Jun 29)

2005-07-01 Thread John Machin
Simon Brunning wrote: > On 7/1/05, Peter Maas <[EMAIL PROTECTED]> wrote: > >>Simon Brunning schrieb: >> >>>Sibylle Koczian needs to sort part of a list. His first attempt made >>>the natural mistake - sorting a *copy* of part of the list: >> >>I think it was _her_ first attempt. > > > Oo

FWD: [python-win32] coinitialize problem

2005-07-01 Thread Gijs Korremans
Hi, I'm extending a Python application that uses several com objects and threads. The origional programmer set the main thread to multithreaded by doing this: * sys.coinit_flags = 0 * import pythoncom This is nessacary because otherwise a com (MapObjects2 from ESRI) can't run in a thread, but n

[no subject]

2005-07-01 Thread python-list-bounces+archive=mail-archive . com
#! rnews 1856 Newsgroups: comp.lang.python Path: news.xs4all.nl!newsspool.news.xs4all.nl!transit.news.xs4all.nl!195.241.76.212.MISMATCH!transit1.news.tiscali.nl!tiscali!transit0.news.tiscali.nl!tudelft.nl!txtfeed1.tudelft.nl!feeder1.cambrium.nl!feed.tweaknews.nl!news2.euro.net!newsfeed.freenet.de!

Re: Splitting string into dictionary

2005-07-01 Thread John Machin
David Pratt wrote: > I have string text with language text records that looks like this: > > 'en' | 'the brown cow' | 'fr' | 'la vache brun' Pardonnez-moi, but I thought "how now brown cow" translated into something like "comme maintenant vache brune" -- something about the adjectives agreeing

Re: map/filter/reduce/lambda opinions and background unscientificmini-survey

2005-07-01 Thread Ivan Van Laningham
Hi All-- Tom Anderson wrote: > > Comrades, > > "I expect tons of disagreement in the feedback, all from ex-Lisp-or-Scheme > folks. :-)" > > I disagree strongly with Guido's proposals, and i am not an ex-Lisp, > -Scheme or -any-other-functional-language programmer; my only other real > language

Re: It seems that ZipFile().write() can only write files, how can empty directories be put into it?

2005-07-01 Thread Jeff Epler
This has been discussed before. One thread I found was http://mail.python.org/pipermail/python-list/2003-June/170526.html The advice in that message might work for you. Jeff pgpPSqdIxsPgx.pgp Description: PGP signature -- http://mail.python.org/mailman/listinfo/python-list

Re: map vs. list-comprehension

2005-07-01 Thread George Sakkis
"Tom Anderson" wrote: > On Fri, 1 Jul 2005, George Sakkis wrote: > > > Keeping the language small is a worthwhile goal, but it should be traded > > off with conciseness and readability; otherwise we could well be content > > with s-expressions. > > There's quite a number of satisfied LISP programm

Re: Question about Python

2005-07-01 Thread Daniel Dittmar
Jan Danielsson wrote: >But then it occured to me.. I started writing my program in Java > pre-1.5. Then came 1.5, I upgraded, and my program would still compile > and run, though I did get three warnings. The language had changed a > little bit; I had to assign a type to three arrays. That wasn

[no subject]

2005-07-01 Thread python-list-bounces+archive=mail-archive . com
#! rnews 1689 Newsgroups: comp.lang.python Path: news.xs4all.nl!newsspool.news.xs4all.nl!transit.news.xs4all.nl!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!nntp.abs.net!attws2!ip.att.net!NetNews1!xyzzy!nntp From: Harry George <[EMAIL PROTECTED]> Subject: Re: Python for everything? X-Nntp-Posti

Re: Question about Python

2005-07-01 Thread George Sakkis
Backwards compatibility is addressed in several Python Enhancement Proposals (PEPs): http://www.python.org/peps/pep-0005.html http://www.python.org/peps/pep-0236.html http://www.python.org/peps/pep-0004.html http://www.python.org/peps/pep-0291.html You also may want to check related threads in c.

Re: Question about Python

2005-07-01 Thread Rocco Moretti
Jan Danielsson wrote: >However, when I look at the various Python modules/libraries, I see > that there are several versions of them, for different versions of > python. I've seen everything from "for python 1.5" up to "for python > 2.4" with all versions in between. This scares me a little bi

Re: Modules for inclusion in standard library?

2005-07-01 Thread Rocco Moretti
Paul Rubin wrote: > Rocco Moretti <[EMAIL PROTECTED]> writes: > >>Except that (please correct me if I'm wrong) there is somewhat of a >>policy for not including interface code for third party programs which >>are not part of the operating system. (I.e. the modules in the >>standard libary should a

Re: How to run commands in command line from a script

2005-07-01 Thread Ivan Shevanski
Well, the thing is that I was just using changing directories as an example for running a name specific command, is the the only way to run name specific commands? An example would be (what I am actually trying to do) run the simply command mame s1945 in the command line. MAME is, for those o

is there a better way to walk a file system?

2005-07-01 Thread ina
I want to walk a folder structor and group all the files by extention. Here is the code I put together is there a better way of doing this? import os folderKey = "Folders" dicExt = {} tDicKey = [] tDicKey.append(folderKey) dicExt[folderKey] = [] walkPath = r"\\zek\C$\AST" for d in os.walk(walk

Re: Question about Python

2005-07-01 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Jan Danielsson <[EMAIL PROTECTED]> wrote: >Hello all, > > I recently started using Python, and I must say I like it. Both the >language and libraries available for it. > > Background: I have written an application which I use to keep track >of my personal econom

Re: Python for everything?

2005-07-01 Thread Grant Edwards
On 2005-06-30, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > I have read in the old days that C was used for everything. It > was a systems programming language, and also did a lot of the > same stuff Bash scripts and perl do now. Not really. C was used for a lot of stuff (mostly just under Uni

Re: When someone from Britain speaks, Americans hear a "British accent"...

2005-07-01 Thread Chan . Fonseka
T can be silent in England too .. frui' cricke' or replaced with D in the US .. budder ledder -- http://mail.python.org/mailman/listinfo/python-list

Re: Python for everything?

2005-07-01 Thread Grant Edwards
On 2005-06-30, Ivan Van Laningham <[EMAIL PROTECTED]> wrote: >> As other have noted, C was never really used for everything. Unix >> tools were designed to connect together from the very beginning, which >> is what makes shell scripting so powerful. This was true before there >> was a C. Likewise,

Re: LOC in Python and C++ in large projects

2005-07-01 Thread Mike Meyer
"Adriaan Renting" <[EMAIL PROTECTED]> writes: > I think the choice of a programming language is not very important in > determining the overal succes of a project. C++ and Python are however > my two favorite languages. Well, getting done on time is a crucial part of success, and it takes less tim

missing cephes module

2005-07-01 Thread Justin
When I used py2exe to create executable file, "cephes" module missing error occurred.  I have installed python 2.3 and scientific and numeric python.  Can anybody suggest me how to resolve the problem?   Justin__Do You Yahoo!?Tired of spam? Yahoo! Ma

Re:

2005-07-01 Thread George Sakkis
>> - namespaces > > >Aren't namespaces basically the same as packages/modules in python? > > Not in the way C++ uses them. In Python if would be something like this: > --- > import os > using namespace casa > class os: > def open(self, file): > pass > a = os.open

getting Quicktime video into Python

2005-07-01 Thread Stefan Tietke
Hi all, for a realtime simulation of a video installation we want to use Quicktime to read video data from a file or stream and process the data in a realtime Gameblender model. We are trying to simulate a large-scale, low resolution media facade using individuell video pixels to control lamps mo

Re: Question about Python

2005-07-01 Thread Mike Meyer
Jan Danielsson <[EMAIL PROTECTED]> writes: > Hello all, > I'd like to ask seasoned Python developers: > - Are you comfortable in upgrading to the latest version of Python, or > are you worried about what you have to fix in your existing programs? No, I'm not worried. The Python developers worry a

Re: map vs. list-comprehension

2005-07-01 Thread Sion Arrowsmith
Tom Anderson <[EMAIL PROTECTED]> wrote: >On Thu, 30 Jun 2005, Roy Smith wrote: >> Even some of the relatively recent library enhancements have been kind >> of complicated. The logging module, for example, seems way over the >> top. >Exactly the same thing happened with Java. I was under the im

Re: missing cephes module

2005-07-01 Thread Robert Kern
Justin wrote: > When I used py2exe to create executable file, "cephes" module missing > error occurred. > I have installed python 2.3 and scientific and numeric python. > Can anybody suggest me how to resolve the problem? scipy uses a lazy import mechanism. IIRC, without some help, py2exe's de

Re: map/filter/reduce/lambda opinions and background

2005-07-01 Thread François Pinard
[Ivan Van Laningham] > [Tom Anderson] > > [Guido] > > "I expect tons of disagreement in the feedback, all from ex-Lisp-or-Scheme > > folks. :-)" > > I disagree strongly with Guido's proposals, and i am not an ex-Lisp, > > -Scheme or -any-other-functional-language programmer; my only other > > rea

Re: Modules for inclusion in standard library?

2005-07-01 Thread Daniel Dittmar
Rocco Moretti wrote: >>> Except that (please correct me if I'm wrong) there is somewhat of a >>> policy for not including interface code for third party programs which >>> are not part of the operating system. (I.e. the modules in the >>> standard libary should all be usable for anyone with a defau

Re: python project layout

2005-07-01 Thread Peter Hansen
Huron wrote: > What do you guys recommend in terms of python project layout, > especially > unit tests layout ? > Zope has unit tests per packages, twisted has a big tests directory > full of > tests ... and the file naming convention are also pretty differents ... > I gue

Re: map/filter/reduce/lambda opinions and background unscientific mini-survey

2005-07-01 Thread iK
Seems like he wants python programmers to solve their problems all in the same way. While that is great for corporate slaves it is terrible for the creative programmer. Python is quickly becoming the visual basic of the 21 century. If you want to have fun while getting some work done you need to

Accepted Summer of Code proposals

2005-07-01 Thread A.M. Kuchling
For anyone who's interested: the Python wiki now contains a list of the PSF-mentored proposals that were accepted for Google's Summer of Code: http://wiki.python.org/moin/SummerOfCode --amk -- http://mail.python.org/mailman/listinfo/python-list

Re: Programmers Contest: Fit pictures on a page

2005-07-01 Thread Peter Hansen
Dan Sommers wrote: > Peter Hansen <[EMAIL PROTECTED]> wrote: >>This problem is well suited to the abilities of genetic algorithms, >>and this would probably be an excellent way to learn more about them, >>even if you don't get the best solution. > > There's some sort of irony or something in there

Re: Python for everything?

2005-07-01 Thread Peter Hansen
Grant Edwards wrote: > [Why are Python programs referred to as "scripts". Python no > more a "scripting" language than Java, Pascal, Smalltalk, > Objective C.] I think it's because the term "script" is a nice, simple word that evokes the idea of "source file that can be directly executed", which

Re: How to run commands in command line from a script

2005-07-01 Thread Peter Hansen
Ivan Shevanski wrote: > Well, the thing is that I was just using changing directories as an > example for running a name specific command, is the here> the only way to run name specific commands? An example would be > (what I am actually trying to do) run the simply command > mame s1945 > in the

Re: map/filter/reduce/lambda opinions and background unscientific mini-survey

2005-07-01 Thread George Sakkis
> Seems like he wants python programmers to solve their problems all in the > same way. While that is great for corporate slaves it is terrible for the > creative programmer. > Python is quickly becoming the visual basic of the 21 century. If you want > to have fun while getting some work done you

Re: I am a Java Programmer

2005-07-01 Thread Thomas Bartkus
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I am a java programmer and I want to learn Python Please help me. > Well! Your condition is certainly tragic! But what can anyone do? Thomas Bartkus -- http://mail.python.org/mailman/listinfo/python-list

Re: is there a better way to walk a file system?

2005-07-01 Thread Peter Hansen
ina wrote: > I want to walk a folder structor and group all the files by extention. > > Here is the code I put together is there a better way of doing this? > [snip] If you were to download Jason Orendorff's "path" module, which is a convenient single-file package that vastly simplifies all man

Assigning to None (was Re: Question about Python)

2005-07-01 Thread Peter Hansen
Mike Meyer wrote: > Yes. I once grabbed an old program that did assignments to None. But > that's always been a bad idea. What was the use case!? -Peter -- http://mail.python.org/mailman/listinfo/python-list

Re: map/filter/reduce/lambda opinions and background unscientific mini-survey

2005-07-01 Thread mcherm
Tom Anderson wrote: > So, if you're a pythonista who loves map and lambda, and disagrees with > Guido, what's your background? Functional or not? I avoid map sometimes, because I find its syntax less readable than list (and expression) comprehensions. But occasionally it is the most readable way t

Re: Re:

2005-07-01 Thread Andreas Kostyrka
import os as realos Names are nothing magic in Python, and quite easily manipulated: import os os.write(1, "Hello World!") class os: pass o = os() import os os.write(1, "\n") So basically this kind of name clashes usually do not happen in Python. Or another usage: os = SomeObject()

Regular Expression for pattern substitution

2005-07-01 Thread Vibha Tripathi
It'd be silly to write the code for it if it already exists somewhere in the Python re or sre library module: I need to find and replace all strings in a text file from a certain pattern to another pattern. so for example if I see 'this(\D*)that' anywhere in the file then I'd like to make is 'tha

Money module

2005-07-01 Thread Facundo Batista
People: The Money two-days sprint in EuroPython 2005 has finished. We advanced a lot. The pre-PEP is almost done, and the corresponding test cases are all written. We need to finish the structure procesing for currency general information, and bring general functions to the module, but most of t

Re: Speaking of list-comprehension?

2005-07-01 Thread Chinook
Chinook wrote whilst his head was elsewhere: >> >>So, where might I have found this construct. >> >ta = [5, 15, 12, 10, 9] >nta = [tai+[10,-10][tai>=10]for tai in ta] >nta >> >>[15, 5, 2, 0, 19] >> Immediately after posting and shutting down last night, I had one of those expansiv

Re: Regular Expression for pattern substitution

2005-07-01 Thread Devan L
re.replace. I don't think there's any way to avoid it. Except maybe having an alias email address or a fake one. -- http://mail.python.org/mailman/listinfo/python-list

pexpect question....

2005-07-01 Thread [EMAIL PROTECTED]
Hi, I am using pexpect to spawn an interactive program and wait for particular string in its output. It works fine but once I get this required information, I really don't care about the child process anymore. I would effectively want to "detach" from it. Is there any way to do such thing in pexpe

Re: is there a better way to walk a file system?

2005-07-01 Thread George Sakkis
"Peter Hansen" wrote: > ina wrote: > > I want to walk a folder structor and group all the files by extention. > > > Here is the code I put together is there a better way of doing this? > > > > [snip] > > If you were to download Jason Orendorff's "path" module, which is a > convenient single-file

Re: Re:

2005-07-01 Thread Andreas Kostyrka
Am Freitag, den 01.07.2005, 08:25 -0700 schrieb George Sakkis: > > > > Again, how? Is there a way to force that an external user of my lib can > > not use my internal data/methods/classes, unless he uses odd compiler > > hacks? > Well, one could probably argue it the other way. In Python you can a

[no subject]

2005-07-01 Thread python-list-bounces+archive=mail-archive . com
#! rnews 4560 Newsgroups: comp.lang.python Path: news.xs4all.nl!newsspool.news.xs4all.nl!transit.news.xs4all.nl!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!nntp.abs.net!attws2!ip.att.net!NetNews1!xyzzy!nntp From: Harry George <[EMAIL PROTECTED]> Subject: Re: X-Nntp-Posting-Host: cola2.ca.boei

Re: map/filter/reduce/lambda opinions and background unscientific mini-survey

2005-07-01 Thread Devan L
None of them are really indispensible. Map and filter cab be replaced with list comprehensions. reduce is redundant except when multiplying a series; there's a sum function for a reason. Lambda looks cleaner in some cases, but you don't gain any functionality. What really struck me, though, is the

Re: Assigning to None (was Re: Question about Python)

2005-07-01 Thread François Pinard
[Peter Hansen] > Mike Meyer wrote: > > Yes. I once grabbed an old program that did assignments to None. But > > that's always been a bad idea. > What was the use case!? People used to assign None to itself as a keyword argument in function headers. The goal was to make a local copy of the refere

Re: is there a better way to walk a file system?

2005-07-01 Thread Peter Otten
George Sakkis wrote: > By the way, from this example I discovered that properties cannot be > unbound, i.e. using path.ext instead of getExtension raises TypeError. > Couldn't/shouldn't Class.prop(instance) be allowed as equivalent of > instance.prop, just as methods ? Use the property's __get__

Re: Regular Expression for pattern substitution

2005-07-01 Thread George Sakkis
"Deval L" wrote: > re.replace. There isn't a re.replace; be careful when you reply to newbies. > "Vibha Tripathi" wrote: > > > It'd be silly to write the code for it if it already > > exists somewhere in the Python re or sre library > > module: > > > > I need to find and replace all strings in a

Re: Escaping commas within parens in CSV parsing?

2005-07-01 Thread felciano
Thanks for all the postings. I can't change delimiter in the source itself, so I'm doing it temporarily just to handle the escaping: def splitWithEscapedCommasInParens(s, trim=False): pat = re.compile(r"(.+?\([^\(\),]*?),(.+?\).*)") while pat.search(s): s = re.sub(p

Re: map/filter/reduce/lambda opinions and background unscientific mini-survey

2005-07-01 Thread Steven Bethard
[EMAIL PROTECTED] wrote: > I avoid map sometimes, because I find its syntax less readable > than list (and expression) comprehensions. But occasionally it > is the most readable way to do something, and I wouldn't want to lose > it. I tend to avoid map as much as possible. The only places I'm sti

Re: aligning text with space-normalized text

2005-07-01 Thread Steven Bethard
Peter Otten wrote: > import re > _reLump = re.compile(r"\S+") > > def indices(text, chunks): > lumps = _reLump.finditer(text) > for chunk in chunks: > lump = [lumps.next() for _ in chunk.split()] > yield lump[0].start(), lump[-1].end() Thanks, that's a really nice, clean s

  1   2   >