Re: Connecting to Firebird database using Kinterbasdb+Python

2005-07-04 Thread Mathias Waack
Maurice LING wrote: > What I am trying to do is "port" a workable program from my own machine > (Mac OSX) to a larger machine (Linux). So, the DB and the program are > also on the same Linux machine. > > On the Linux machine, I cannot use localhost, so I set host parameter in > kinterbasdb.connec

Tkinter + Tcl help

2005-07-04 Thread sunitajain
Hello all, I have a Tcldot package which I am using with Tcl (I source the package by 'load .\libtcldot.so.0' command. Now I want to use this package in Tkinter. Can anyone suggest me how to do this? I tried the foll: root=Tk() root.tk.eval('load ..\libtcldot.so.0') root.mainloop() But I ge

Re: wxPy + Py2Exe + sys.argv[0]

2005-07-04 Thread Miki Tebeka
Hello fowlertrainer, > Hi ! > > The problem that when I started the program from CMD, the sys.argv is > show the good path (in my machine the c:\dev\...) from Dialog1.py. > But when I compile it with Py2Exe, and try to start the exe, it has been > not found the hwinfo.ini file what store th

Re: pexpect question....

2005-07-04 Thread Jonathan Ellis
[EMAIL PROTECTED] wrote: > Currently, I am spawning a new thread > that just does pexpect_spawned_child.close(wait=1). It seems to work in > some cases but the child process is occassionally getting deadlocked. I think your only cross-platform option will be to fix the child process to die nicely

Re: f*cking re module

2005-07-04 Thread D H
Gustavo Niemeyer wrote: > That's what I love in that news group. Someone comes with a > stupid and arrogant question, and someone else answers in a > calm and reasonable way. ...and then someone else comes along and calls the first person stupid and arrogant, which is deemed QOTW. :) -- http://m

Re: "long int..." exception reported with strange traceback location

2005-07-04 Thread Joe Peterson
Yep, my thinking too. Well, maybe it's all related to the same bug somehow. OK, I submitted a bug report, and I included a slight modification of the test case you guys suggested: import sys import os t = 2147483648L os.utime("foo_test_file", (t, t)) print "hi" ---

Re: Considering moving from Delphi to Python [Some questions]

2005-07-04 Thread Dark Cowherd
Stupid of me. I want some feedback on folllwing: anybody who has experience in writing SOAP servers in Python and data entry heavy web applications. Any suggestions? darkcowherd On 7/4/05, Dark Cowherd <[EMAIL PROTECTED]> wrote: > Hi, > > We program in Delphi in our shop and are generally very

Re: HTML Conventions

2005-07-04 Thread Chinook
Patrick Rutkowski wrote: > I couldn't help but make an even better list in reference to this thread: > I'll go you one better :<)) I found the source of what I pulled that table from: http://jaynes.colorado.edu/PythonGuidelines.html Lee C -- http://mail.python.org/mailman/listinfo/python-l

Re: What are __slots__ used for?

2005-07-04 Thread Casey Hawthorne
To save a a few bytes (10?) per instance instead of having a dict to hold attributes one has slots! Designed for having lots of instances (millions?) at the same time to save space! "Ric Da Force" <[EMAIL PROTECTED]> wrote: >I am a C# programmer and new to the language and I am trying to debug s

RE: What are __slots__ used for?

2005-07-04 Thread Delaney, Timothy (Tim)
Ric Da Force wrote: > I am a C# programmer and new to the language and I am trying to debug > some code which uses this feature. Can anyone elaborate on what it > is and how it is used? __slots__ is used for memory and performance gains in classes that need them. A class with __slots__ has a fix

What are __slots__ used for?

2005-07-04 Thread Ric Da Force
I am a C# programmer and new to the language and I am trying to debug some code which uses this feature. Can anyone elaborate on what it is and how it is used? Regards, Ric -- http://mail.python.org/mailman/listinfo/python-list

Re: pickle alternative

2005-07-04 Thread simonwittber
Ok, I've attached the proto PEP below. Comments on the proto PEP and the implementation are appreciated. Sw. Title: Secure, standard serialization of simple python types. Abstract This PEP suggests the addition of a module to the standard library, which provides a serialization class

Re: How do you program in Python?

2005-07-04 Thread gene tani
+1 on investing in emacs. There's a shiny new release of the Oreilly, which is (a really large book) that a lot of people teach themself out of: http://www.oreilly.com/catalog/gnu3/ But i would also recommend komodo from activestate's IDE, easy and powerful, once you understand what all's in the

Re: How do you program in Python?

2005-07-04 Thread Chris Smith
>> My question isn't as all-encompassing as the subject would >> suggest... >> >> I am almost a Python newbie, but I have discovered that I don't >> get along with IDLE, as i can't work out how to run and rerun a >> routine without undue messing about. >> >> What I

readline: edit-and-execute-command

2005-07-04 Thread josh
anybody know why "edit-and-execute-command" doesn't work in python's readline? it doesn't even show up in a dump of readline functions: $ cat fc_test

Re: pexpect question....

2005-07-04 Thread [EMAIL PROTECTED]
Hi, I actually replied saying that the process dies when close(wait=0) is done (the reply doesn't show up yet). It is not correct. The process actually runs but ends up in zombie status (defunct). Raghu. -- http://mail.python.org/mailman/listinfo/python-list

Re: Existance of of variable

2005-07-04 Thread Roy Smith
Steven D'Aprano <[EMAIL PROTECTED]> wrote: > Should we *really* be encouraging newbies to mess with globals() and > locals()? Isn't that giving them the tools to shoot their foot off before > teaching them how to put shoes on? Why risk damaging perfectly good footwear? But, seriously, I agree wit

Re: Connecting to Firebird database using Kinterbasdb+Python

2005-07-04 Thread Maurice LING
Mathias Waack wrote: > Maurice LING wrote: > > >>I've been using FB1.5 and access the database using Kinterbasdb + >>Python. My connection is established using kinterbasdb.connect() method >>and the parameters host, dns, database, user, password are all defaulted >>to 'None'. >> >>On my own machi

Re: Existance of of variable

2005-07-04 Thread Steven D'Aprano
On Mon, 04 Jul 2005 21:17:21 +0200, tiissa wrote: > Josiah Manson wrote: >> Hello. I am very new to Python, and have been unable to figure out how >> to check if a variable exists or not. In the following code I have made >> a kludge that works, but I think that it would be clearer to check if >>

Re: f*cking re module

2005-07-04 Thread Erik Max Francis
James Stroud wrote: > Its perhaps that they remember the frustration of being new to programming. > Those "wasted" 1.5 hr sessions getting nowhere add up pretty fast and then > the explicatives begin to flow. Also because the best way to make someone who's having a tantrum look foolish in publ

Re: math.nroot [was Re: A brief question.]

2005-07-04 Thread Steven D'Aprano
On Mon, 04 Jul 2005 15:35:56 +0100, Tom Anderson wrote: >>> Also, would it be a good idea for (-1.0) ** 0.5 to evaluate to 1.0j? It >>> seems a shame to have complex numbers in the language and then miss this >>> opportunity to use them! >> >> It's generally true in Python that complex numbers are

Re: f*cking re module

2005-07-04 Thread James Stroud
On Monday 04 July 2005 12:39 pm, Gustavo Niemeyer wrote: > > > the only thing I want are the number of places blabla, Re modules > > > sucks! and blabla are. > > > > Your question is still not clear. What you're searching for is > > '', which isn't there, so .search returns None, and so > > you ge

Re: threads and sleep?

2005-07-04 Thread Peter Hansen
Jeffrey Maitland wrote: > I am in the process of writing a multithreading program and what I was > wondering is a sleep command in an executing function will affect the > threads below it? Note that the "executing function" is itself running inside a thread, specifically the "main thread". The

PROBLEM?? deepcopy

2005-07-04 Thread phil
I wrote the following to prove to myself that deepcopy would copy an entire dictionary which contains an instance of a class to one key of another dictionary. Note that after copying adict to ndict['x'] I delete adict. Then ndict['x'] contains a good copy of adict. works great. class aclass:

Re: "long int..." exception reported with strange traceback location

2005-07-04 Thread Peter Otten
Terry Reedy wrote: os.utime("foo_test_file", (0, float(sys.maxint+1))) > Traceback (most recent call last): > File "", line 1, in ? > TypeError: utime() arg 2 must be a tuple (atime, mtime) > > which is quite sane.  So maybe bug was introduced in 2.3 which you were > running. But arg 2 *is*

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

2005-07-04 Thread Steven Bethard
Erik Max Francis wrote: > Steven Bethard wrote: > >> And it's almost two times slower: > > That's because you're not using operator.add. Huh? Please re-read my post. That's exactly what I used. STeVe -- http://mail.python.org/mailman/listinfo/python-list

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

2005-07-04 Thread Ron Adam
George Sakkis wrote: > And finally for recursive flattening: > > def flatten(seq): > return reduce(_accum, seq, []) > > def _accum(seq, x): > if isinstance(x,list): > seq.extend(flatten(x)) > else: > seq.append(x) > return seq > > flatten(seq) > > [1, 2, 3,

Re: "long int..." exception reported with strange traceback location

2005-07-04 Thread Terry Reedy
"Michael Hoffman" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I came up with a simpler testcase. Strangely, the exception occurs in > the statement *following* the os.utime() call: > > >>> import os, sys > >>> os.utime("foo_test_file", (0, float(sys.maxint+1))) > >>> print "hi"

Re: Trapping user logins in python ( post #1)

2005-07-04 Thread Patrick Rutkowski
On Monday 04 July 2005 13:49, Jeff Epler wrote: > I don't know of a portable way for an inetd-style daemon to "listen" for > user logins. > > On some systems (including RedHat/Fedora and debian), you may be able to > use PAM to do this. (pam modules don't just perform authentication, > they can ta

Re: Existance of of variable

2005-07-04 Thread Terry Reedy
"tiissa" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Variables are stored in two dictionnaries: globals() (for global > variables) and locals() (for the local ones, which are also global on > top level). Within a function, the local namespace is usually *not* a dictionary. D=lo

HTTP Open -v- File Read

2005-07-04 Thread [EMAIL PROTECTED]
I am relatively new to Python ... I have a script that uses urllib2 to open another XML file off of the same server the PY file is living on. urllib2.urlopen(url).read() I changed a bit of it to use: open(filename, 'r').read() to open the file locally rather than making an HTTP call however the

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

2005-07-04 Thread Carl Banks
Christopher Subich wrote: > That said, Python itself is mostly a procedural language, with the > functional tools really being bolted on[1]. [etc., snip] Yeah, that's pretty much what I said in the first place. -- CARL BANKS -- http://mail.python.org/mailman/listinfo/python-list

Re: Existance of of variable

2005-07-04 Thread Benjamin Niemann
George Sakkis wrote: > Hi Josiah, > >> Hello. I am very new to Python, and have been unable to figure out how >> to check if a variable exists or not. In the following code I have made >> a kludge that works, but I think that it would be clearer to check if >> closest exists and not have to initi

Re: "long int..." exception reported with strange traceback location

2005-07-04 Thread Michael Hoffman
Joe Peterson wrote: > I could not find another example of this via internet searches, so here > it is... I am wondering if this is a python bug or otherwise. The > first example of this happened in a larger program of mine, and the > traceback reports the problem at the start of a "for" loop (mak

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

2005-07-04 Thread Erik Max Francis
Steven Bethard wrote: > And it's almost two times slower: That's because you're not using operator.add. -- Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/ San Jose, CA, USA && 37 20 N 121 53 W && AIM erikmaxfrancis Virtue has never been as respectable as money. -- Mar

"long int..." exception reported with strange traceback location

2005-07-04 Thread Joe Peterson
I could not find another example of this via internet searches, so here it is... I am wondering if this is a python bug or otherwise. The first example of this happened in a larger program of mine, and the traceback reports the problem at the start of a "for" loop (making no sense), but I cannot

Re: Existance of of variable

2005-07-04 Thread George Sakkis
Hi Josiah, > Hello. I am very new to Python, and have been unable to figure out how > to check if a variable exists or not. In the following code I have made > a kludge that works, but I think that it would be clearer to check if > closest exists and not have to initialize it in the first place. H

Re: math.nroot [was Re: A brief question.]

2005-07-04 Thread James Dennett
Steven D'Aprano wrote: > James Dennett wrote: > >> > Yes: 5^2 + -2^2 is 29, however you write it. >> >> *If* you take -2 as a number, but not if you take the number >> as 2 and the unary minus as an operator with lower precedence >> than exponentiation. > > > [snip] > >> Not in this respect.

Re: f*cking re module

2005-07-04 Thread Gustavo Niemeyer
> > the only thing I want are the number of places blabla, Re modules > > sucks! and blabla are. > > Your question is still not clear. What you're searching for is > '', which isn't there, so .search returns None, and so > you get that exception (.group takes an argument, anyway). That's what

Re: Existance of of variable

2005-07-04 Thread Terry Reedy
"Josiah Manson" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hello. I am very new to Python, and have been unable to figure out how > to check if a variable exists or not. In the following code Python does not have variables is the sense some other languages do. It has (typele

threads and sleep?

2005-07-04 Thread Jeffrey Maitland
Hello all, I am in the process of writing a multithreading program and what I was wondering is a sleep command in an executing function will affect the threads below it? Here is a basic example of what I mean. def main(): temp_var = True while temp_var == True: if t = threa

Re: Existance of of variable

2005-07-04 Thread Peter Otten
Josiah Manson wrote: > Hello. I am very new to Python, and have been unable to figure out how > to check if a variable exists or not. In the following code I have made try: variable except NameError: # variable doesn't exist else: # variable exists But it is rare that you actually ne

Re: Connecting to Firebird database using Kinterbasdb+Python

2005-07-04 Thread Grig Gheorghiu
How is your Firebird database configured -- Classic Server or Super Server? If it's in classic server mode, you don't need to worry about the host portion. You do need to worry about permissions on the database file. I got it to work by making it 664 and owner + group firebird. Grig -- http://ma

Re: Considering moving from Delphi to Python [Some questions]

2005-07-04 Thread Terry Reedy
"Dark Cowherd" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > We program in Delphi in our shop and are generally very happy with it. > We are now looking at cross-platform options especially for middle > tier and web server. > > I have been doing a lot of reading and testing of Pyt

Re: Existance of of variable

2005-07-04 Thread tiissa
Josiah Manson wrote: > Hello. I am very new to Python, and have been unable to figure out how > to check if a variable exists or not. In the following code I have made > a kludge that works, but I think that it would be clearer to check if > closest exists and not have to initialize it in the first

Re: Accepted Summer of Code proposals

2005-07-04 Thread Terry Reedy
"A.M. Kuchling" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Fri, 1 Jul 2005 14:22:51 -0400, > Terry Reedy <[EMAIL PROTECTED]> wrote: >> Thanks for posting this and thanks for coordinating the PSF effort. > > I did little beyond writing up that wiki page. David Ascher > has b

Re: importing pyc from memory?

2005-07-04 Thread Derek van Vliet
I do have to do everything you describe here in the current implementation of my system. I realize that importing a pyc file and compiling a string results in two different things. This is okay though as I'm fairly sure this will still suit my needs. As I said, the file format I plan to store thes

Re: importing pyc from memory?

2005-07-04 Thread Sybren Stuvel
Derek van Vliet enlightened us with: > Up to now, I've had all my python scripts defined in XML elements, > which were compiled when my program started up using > Py_CompileString. This has worked great, but I'm finding that most > of the time my app uses to start up is spent in that > Py_CompileS

Re: How do you program in Python?

2005-07-04 Thread Aahz
In article <[EMAIL PROTECTED]>, Peter Hansen <[EMAIL PROTECTED]> wrote: > >After 25 years doing this, I've become something of a Luddite as far as >fancy IDEs and non-standard features go... and a huge believer in strict >decoupling between my tools, to the point of ignoring things that bundle

Re: Folding in vim

2005-07-04 Thread Terry Hancock
On Monday 04 July 2005 07:42 am, Ivan Van Laningham wrote: > Terry Hancock wrote: > > I also got "space_hi.vim" which highlights tabs > > and trailing spaces, which made it a lot easier to fix the > > problem. > > Is that really the name? I tried searching for it & got no hits. Sorry, no unders

Existance of of variable

2005-07-04 Thread Josiah Manson
Hello. I am very new to Python, and have been unable to figure out how to check if a variable exists or not. In the following code I have made a kludge that works, but I think that it would be clearer to check if closest exists and not have to initialize it in the first place. How is that check don

Re: importing pyc from memory?

2005-07-04 Thread Bengt Richter
On Mon, 04 Jul 2005 19:25:13 +0200, Thomas Heller <[EMAIL PROTECTED]> wrote: >"Derek van Vliet" <[EMAIL PROTECTED]> writes: > >> The second method you describe sounds like it is along the lines of >> what I need to do. Is there a way to do this using the Python/C API? >> >> For instance, if I have

Re: math.nroot

2005-07-04 Thread George Sakkis
"Mike Meyer" <[EMAIL PROTECTED]> wrote: > "George Sakkis" <[EMAIL PROTECTED]> writes: > > "Steven D'Aprano" <[EMAIL PROTECTED]> wrote: > > > >> But it doesn't make sense to say that two flags are equal: > >> > >> keep_processing = True > >> more_reading_needed = True > >> while more_reading_needed

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

2005-07-04 Thread Steven Bethard
Erik Max Francis wrote: > Ron Adam wrote: > >> In this case sum and product fulfill 90% (estimate of course) of >> reduces use cases. It may actually be as high as 99% for all I know. >> Or it may be less. Anyone care to try and put a real measurement on it? > > Well, reduce covers 100% of th

Re: Considering moving from Delphi to Python [Some questions]

2005-07-04 Thread flamesrock
The curve may take a while, but I'd definately recommend it. While you're at it, why not switch th front end to python too? -- http://mail.python.org/mailman/listinfo/python-list

Re: importing pyc from memory?

2005-07-04 Thread Jeff Epler
This stupid code works for modules, but not for packages. It probably has bugs. import marshal, types class StringImporter: def __init__(self, old_import, modules): self._import = old_import self._modules = modules def __call__(self, name, *args): module = self.

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

2005-07-04 Thread Christopher Subich
Carl Banks wrote: > I suspect you're misunderstanding what I mean by heavily functional. > Heavily functional programming is a different mindset altogether. In > heavily functional programming, things like maps and filters and > function applications are actually what you're thinking about. map

Re: Trapping user logins in python ( post #1)

2005-07-04 Thread Jeff Epler
I don't know of a portable way for an inetd-style daemon to "listen" for user logins. On some systems (including RedHat/Fedora and debian), you may be able to use PAM to do this. (pam modules don't just perform authentication, they can take other actions. As an example, pam_lastlog "prints the l

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

2005-07-04 Thread Christopher Subich
Peter Hansen wrote: > [str(parrot) for parrot in sequence], for example, tells you much more > about what is going on than str(x) does. > > Exactly what, I have no idea... but it says _so_ much more. ;-) Yarr! Avast! Etc! -- http://mail.python.org/mailman/listinfo/python-list

Re: math.nroot

2005-07-04 Thread Mike Meyer
"George Sakkis" <[EMAIL PROTECTED]> writes: > "Steven D'Aprano" <[EMAIL PROTECTED]> wrote: > >> But it doesn't make sense to say that two flags are equal: >> >> keep_processing = True >> more_reading_needed = True >> while more_reading_needed and keep_processing: >> get_more_records() >>

Re: importing pyc from memory?

2005-07-04 Thread Thomas Heller
"Derek van Vliet" <[EMAIL PROTECTED]> writes: > The second method you describe sounds like it is along the lines of > what I need to do. Is there a way to do this using the Python/C API? > > For instance, if I have the contents of a pyc file loaded entirely into > memory, and I have a pointer to t

Considering moving from Delphi to Python [Some questions]

2005-07-04 Thread Dark Cowherd
Hi, We program in Delphi in our shop and are generally very happy with it. We are now looking at cross-platform options especially for middle tier and web server. I have been doing a lot of reading and testing of Python, I am falling in love with the language :-) But seems to be be very difficul

Re: importing pyc from memory?

2005-07-04 Thread Derek van Vliet
The second method you describe sounds like it is along the lines of what I need to do. Is there a way to do this using the Python/C API? For instance, if I have the contents of a pyc file loaded entirely into memory, and I have a pointer to the beginning of the file and the size in bytes at my dis

Re: importing pyc from memory?

2005-07-04 Thread Derek van Vliet
Up to now, I've had all my python scripts defined in XML elements, which were compiled when my program started up using Py_CompileString. This has worked great, but I'm finding that most of the time my app uses to start up is spent in that Py_CompileString, because of the large number of scripts th

HTML Conventions

2005-07-04 Thread Patrick Rutkowski
I couldn't help but make an even better list in reference to this thread: http://mail.python.org/pipermail/python-list/2005-July/288678.html Type Convention Example funtion action_with_underscores find_all vari

Re: Outlook COM: how to create a MailItem from a .msg file

2005-07-04 Thread Tim Williams (gmail)
On 7/4/05, Guy Lateur <[EMAIL PROTECTED]> wrote: > > Anything else I could try? Lateral thinking ? === untested === import imaplib, time, sys f = open(msg_file) r = f.readlines() f.close() msg1 = ''.join(r) server = 'my.exchangeserver.com' # or IP address user = 'user' pw = 'pw' M = imaplib.

Re: importing pyc from memory?

2005-07-04 Thread Robert
"Derek van Vliet" <[EMAIL PROTECTED]> schrieb im Newsbeitrag news:[EMAIL PROTECTED] > Using the Python/C API, is there a way I can import a pyc file that I > have in memory (as opposed to loading from disk)? > > I'm trying to save compiled python code in a proprietary file format to > cut reduce t

Re: importing pyc from memory?

2005-07-04 Thread Sybren Stuvel
Derek van Vliet enlightened us with: > I'm trying to save compiled python code in a proprietary file format > to cut reduce the overhead of compiling all my scripts when my app > starts up. Why is that faster than having the .pyc files ready on your filesystem? And why do you want it in a propriet

Re: Will Guido's "Python Regrets" ever get implemented/fixed?

2005-07-04 Thread Rocco Moretti
John Roth wrote: > "Peter Maas" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > >> George Sakkis schrieb: >> >>> Given that the latest 2.x python will be 2.9 >> >> >> Why not 2.13 or 2.4711? Version strings are sequences of arbitrary >> integers separated by dots and not decimal n

Re: missing cephes module

2005-07-04 Thread Robert Kern
Justin wrote: > Hi All: > > 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? Did you try what I suggested the last time you posted this

Re: A question for profile

2005-07-04 Thread slchen
Sorry~~ I found the problem~~ There is an error profile.pyc in the same folder. some it execute error. thanks a lot! -- http://mail.python.org/mailman/listinfo/python-list

Re: noob question

2005-07-04 Thread Jorgen Grahn
On Sun, 26 Jun 2005 03:36:58 -0400, Chinook <[EMAIL PROTECTED]> wrote: ... > Here is something I copied from somewhere (someone else might know the > source): > > Summary of Naming Conventions ... > > Hope it does not come out too jumbled, It did, but it seemed so useful that I repost it with min

A question for profile

2005-07-04 Thread slchen
Now, I have a question about profile. I write a program as below: file name: pro.py --- import profile import string,re,sys,random,time import main,read_dont #Read the data S1=sys.argv[1] S2=sys.argv[2] T=read_dont.readfile(S1,string.atoi(S2)) print "T[0] is %s" % T[0

Re: How do you program in Python?

2005-07-04 Thread bruno modulix
Roy Smith wrote: > bruno modulix <[EMAIL PROTECTED]> wrote: > > >>Try Emacs + python-mode. Emacs surely has a lot of warts, but I'm still >>looking for a better and more versatile code editor/IDE - specially when >>it comes to languages with REPL (-> Read-Eval-Print Loop). > > > When you build

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

2005-07-04 Thread George Sakkis
"Tom Anderson" <[EMAIL PROTECTED]> wrote: > I'll just chip in and say i'd quite like a flatten(), too; at the moment, > i have one like this: > > def flatten(ll): > return reduce(lambda a, l: a.extend(l), ll, []) This doesn't work; a.extend() returns None, not the extended list a: >>> seq = [[

Re: unittest: collecting tests from many modules?

2005-07-04 Thread Jorgen Grahn
On 12 Jun 2005 10:14:50 GMT, Jorgen Grahn <[EMAIL PROTECTED]> wrote: [regarding module unittest] > What's the best way of creating a test.py which > - aggregates the tests from all the test_*.py modules? > - doesn't require me to enumerate all the test classes in test.py > (forcing each module

Re: What are the other options against Zope?

2005-07-04 Thread phil
> It's an object oriented database, with a structure that is similar to > files and directories in an ordinary OS. > > But it is a lot smarter, because the files and directories are actually > objects with different attributes and parameters. > > The methods on these objects can then be called

Re: python project layout

2005-07-04 Thread Huron
> A concrete example would probably help. What are you envisioning? Let say you have an interface (zope.interface) IMyProduct and two classes implementing the interface MyProduct1 and MyProduct2 ... But I think I found the answer. One file each. Python is just more flexi

Re: OT: ^ in redirection (windows)

2005-07-04 Thread Duncan Booth
Bengt Richter wrote: > You'd think ^ would be mentioned in > http://www.microsoft.com/resources/documentation/windows/xp/all/pro > ddocs/en-us/redirection.mspx > but it seems not to be. > You mean you didn't think to look at http://www.microsoft.com/resources/documentation/windows/xp/

Re: curses -- getxy() error

2005-07-04 Thread [EMAIL PROTECTED]
Peter Hansen wrote: > post the exception traceback here[...], we can show you how to analyze it to > determine for yourself exactly what the problem is true, remember that for the future. and that goes to everybody asking questions here. thing is, I've done enough curses programming (in both Pytho

Re: Where can I get the new version of python-mode for emacs?

2005-07-04 Thread Skip Montanaro
Marcio> I have version 4.70 installed in my debian system (installed Marcio> with apt-get, so I don't know where the sources are from). After Marcio> reading the thread_ at sourceforge, I did a google search for Marcio> "python emacs" and found the `Emacs goodies`_ page at python.o

missing cephes module

2005-07-04 Thread Justin
Hi All:   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 Yahoo! Mail Mobile Take Yahoo! Mail with you! Check email on your mobile pho

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

2005-07-04 Thread Peter Hansen
Terry Hancock wrote: > On Sunday 03 July 2005 07:05 pm, Erik Max Francis wrote: >>I personally think that map looks clearer than a list comprehension for >>a simple function call > This on the other hand, >> [str(x) for x in sequence] > is practically plain English: > > "call the function "

wxPy + Py2Exe + sys.argv[0]

2005-07-04 Thread [EMAIL PROTECTED]
Hi ! I have been finished my WMI information getter simple application, but the exe is not working as like the py modules before compilation. The problem that when I started the program from CMD, the sys.argv is show the good path (in my machine the c:\dev\...) from Dialog1.py. But when I c

Re: OT: ^ in redirection (windows)

2005-07-04 Thread Bengt Richter
On 4 Jul 2005 13:07:02 GMT, Duncan Booth <[EMAIL PROTECTED]> wrote: >Miki Tebeka wrote: > >> Can someone explain me the difference between: >> echo 1 > 1.txt 2>&1 >> and >> echo 1 > 1.txt 2>^&1 >> >> (Windows XP "cmd" shell) >> >> Both produce 1.txt with the content 1. >> >> (Sadly, I d

Re: math.nroot [was Re: A brief question.]

2005-07-04 Thread Tom Anderson
On Sun, 3 Jul 2005, Tim Peters wrote: > [Tom Anderson] >> So, is there a way of generating and testing for infinities and NaNs >> that's portable across platforms and versions of python? > > Not that I know of, and certainly no simple way. > >> If not, could we perhaps have some constants in the m

Re: math.nroot [was Re: A brief question.]

2005-07-04 Thread Tom Anderson
On Sun, 3 Jul 2005, Dennis Lee Bieber wrote: > On Sun, 3 Jul 2005 20:53:22 +0100, Tom Anderson <[EMAIL PROTECTED]> > declaimed the following in comp.lang.python: > >>2 >> -1 >> >> Evaluates to -1? > > But what do you expect, say > > 2 > -X > > to evaluate as? (-X)^2 or -(X^2) > >

Re: curses -- getxy() error

2005-07-04 Thread Peter Hansen
shablool wrote: > Hi, > Could someone please explain why stdscr.getxy() always raise an > exception: If you post the exception traceback here (the whole thing, cut and pasted from your terminal window), we can show you how to analyze it to determine for yourself exactly what the problem is. Thi

Re: Accepted Summer of Code proposals

2005-07-04 Thread A.M. Kuchling
On Fri, 1 Jul 2005 14:22:51 -0400, Terry Reedy <[EMAIL PROTECTED]> wrote: > Thanks for posting this and thanks for coordinating the PSF effort. I did little beyond writing up that wiki page. David Ascher has been the primary coordinator for the PSF. --amk -- http://mail.python.org/ma

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

2005-07-04 Thread Nick Efford
Grant Edwards <[EMAIL PROTECTED]> wrote: > I'm an American who grew up watching plenty of BBC, and I run > into afew native Londoners whom I have hard time understanding. > I don't ever remember having troubly understanding people > outside the city. But have you encountered regional dialects? - e

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

2005-07-04 Thread Tom Anderson
On Sun, 3 Jul 2005, Robert Kern wrote: > Erik Max Francis wrote: >> Ron Adam wrote: >> >>> So you are saying that anything that has a 1% use case should be included >>> as a builtin function? >>> >>> I think I can find a few hundred other functions in the library that are >>> used more than te

Re: Determining actual elapsed (wall-clock) time

2005-07-04 Thread Roy Smith
Peter Hansen <[EMAIL PROTECTED]> wrote: > As it turns out, Windows XP already has support (via NTP > I presume, though of course since this is Microsoft they try to keep the > user base ignorant by making no mention of that even in the help page) > for keeping the clock accurate, right on the la

Re: curses -- getxy() error

2005-07-04 Thread shablool
Thanks! (silly me) [EMAIL PROTECTED] wrote: > shablool wrote: > > Could someone please explain why stdscr.getxy() always raise an > > exception: > [code here] > the method is named getyx(), this is old unix heritage. > see http://www.python.org/doc/2.0.1/lib/curses-window-objects.html -- http://

Re: Determining actual elapsed (wall-clock) time

2005-07-04 Thread Peter Hansen
Coates, Steve (ACHE) wrote: > > There is already an NTP client in the ASPN cookbook :- > http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/117211 Thanks Steve. As it turns out, Windows XP already has support (via NTP I presume, though of course since this is Microsoft they try to keep the

Re: python project layout

2005-07-04 Thread Peter Hansen
Huron wrote: > For instance, if you have several classes implementing the same > interface > (say, doing the same things with different strategies), how would you > organize that in terms of files (modules) and directories (packages) ? A concrete example would probably help. What are you

Re: python project layout

2005-07-04 Thread Peter Hansen
Huron wrote: > Hi Peter, > Thanks for you detailed reply. > The layout that you suggest sounds wise to me (I'm about to start a > project). I wouldn't necessarily recommend something so complex (not that it's particular complex, but it's more than just "flat") for a newcomer, however. One of th

Re: Outlook COM: how to create a MailItem from a .msg file

2005-07-04 Thread Guy Lateur
Thanks for the tip, Simon, but unfortunately it doesn't work; it says "The interface name 'MailItem' does not appear in the same library as object '" Anything else I could try? Cheers, g "Simon Brunning" <[EMAIL PROTECTED]> schreef in bericht news:[EMAIL PROTECTED] Well, I don't know anyt

importing pyc from memory?

2005-07-04 Thread Derek van Vliet
Using the Python/C API, is there a way I can import a pyc file that I have in memory (as opposed to loading from disk)? I'm trying to save compiled python code in a proprietary file format to cut reduce the overhead of compiling all my scripts when my app starts up. Derek -- http://mail.python.

Where can I get the new version of python-mode for emacs?

2005-07-04 Thread Marcio Rosa da Silva
Hi all, My first try on using RST to write an email. so I can (will) make mistakes :-) I am experiencing the problem shown in this thread_ of the `python-mode`_ discussion list hosted at SourceForge. .. _thread: https://sourceforge.net/tracker/?func=detail&atid=581349&aid=1215039&group_id=869

Re: Obtaining glyph width in Python

2005-07-04 Thread Andreas Lobinger
Aloha, Charlie wrote: > Hi, I'm looking for a way to obtain the width of a string, either in actual > inches/centimeters, or pixels will also work. Unfortunately this seems > difficult as I'd like to keep things as close to the stock Python install as > possible, and I'm not working with Graphics

  1   2   >