Re: Access denied calling FireEvent in Python

2005-04-07 Thread Jude
> > Set the "campus" listbox value and theb call fire event, such as in > the > > code below. I get an "access denied" error. Fire-events on campuses were forbidden by George W because of terrorists might use them. Jeff -- http://mail.python.org/mailman/listinfo/python-list

Re: how can I extract all urls in a string by using re.findall() ?

2005-04-07 Thread could ildg
That's it! Thank you~~ On Apr 7, 2005 11:29 AM, Sidharth Kuruvila <[EMAIL PROTECTED]> wrote: > Reading the documentation on re might be helpfull here :-P > > findall returns a tuple of all the groups in each match. > > You might find finditer usefull. > > for m in re.finditer(url, html) : >

client-client connection using socket

2005-04-07 Thread [EMAIL PROTECTED]
Hello, I have two client computers, each has its own host name. Can I do connection like socket between the two? I check when we want to make connection we have to only put hostname and port. For example: #Server program. Could we use client hostname here ? HOST = "" PORT = 21567 BUFSIZ =

Re: logging as root using python script

2005-04-07 Thread Raghul
But this not the right answer -- http://mail.python.org/mailman/listinfo/python-list

Re: logging as root using python script

2005-04-07 Thread Luis Bruno
Raghul wrote: > What I need is when I execute a script it should login as root and > execute my command and logout from root to my existing account. I'm not sure of what you need, so I'll assume your *whole* .py script needs root priviledges. In this case, you can configure sudo(8) or use su(1).

Re: client-client connection using socket

2005-04-07 Thread Laszlo Zsolt Nagy
[EMAIL PROTECTED] wrote: Hello, I have two client computers, each has its own host name. Hello, I did not understand your problem. I do not see cleary what you want to do? When you say "client", do you mean a client in a client-server architecture? Maybe you want to create a peer-to-peer connec

Re: logging as root using python script

2005-04-07 Thread Martin Franklin
Luis Bruno wrote: Raghul wrote: What I need is when I execute a script it should login as root and execute my command and logout from root to my existing account. I'm not sure of what you need, so I'll assume your *whole* .py script needs root priviledges. In this case, you can configure sudo(8)

Re: logging as root using python script

2005-04-07 Thread Luis Bruno
Martin Franklin wrote: > another alternative would be setuid I also thought about making the script setuid root, but I'm under the impression that Linux (at least) won't honor the suid bit on a script. That's from memory though. Cheers! -- http://mail.python.org/mailman/listinfo/python-list

import statement - package visibility problem

2005-04-07 Thread Laszlo Zsolt Nagy
Hi All! I have the following structure: /Lib/Server/Db/ __init_.py DatabaseConnection.py Adapters/ __init__.py FireBirdConnection.py Important file contents are: /Lib/Server/Db/__init__.py: import DatabaseConnection import Adapters /Lib/Server/Db/DatabaseConnection.py:

Re: richcmpfunc semantics

2005-04-07 Thread Greg Ewing
harold fellermann wrote: richcmpfunc compare(PyObject *,PyObject, int); I supposed the two objects passed are the ones to be compared. Yes. What is the meaning of the integer argument? Does it specify the kind of comparision operator (e.g. __eq__ or __le__), and if so, how? < 0

Re: Calling a Perl Module from Python ( future direction of Python)

2005-04-07 Thread Greg Ewing
gf gf wrote: Really! That's a pity... Instead of trying to recreate a repository the size of CPAN, a Python interface to Perl modules is really called for. When Parrot comes on line, this presumably will become trivial... -- Greg Ewing, Computer Science Dept, University of Canterbury, Chris

Re: Calling a Perl Module from Python ( future direction of Python)

2005-04-07 Thread Greg Ewing
By the way, is the Parrot project still alive, or has it been given up on? Not that I actually want it, but the idea is kind of morbidly fascinating. -- Greg Ewing, Computer Science Dept, University of Canterbury, Christchurch, New Zealand http://www.cosc.canterbury.ac.nz/~greg -- http://mai

Re: Best editor?

2005-04-07 Thread Jussi Jumppanen
Joey C. wrote: > When I'm using Windows, I have found the Syn TextEditor The Zeus for Windows programmer's supports Python: http://www.zeusedit.com/lookmain.html Some of the programming specific features include: + Code folding (supports python) + Integrated class browser + Project/wo

Re: sorting a list and counting interchanges

2005-04-07 Thread Peter Nuttall
On Wed, Apr 06, 2005 at 03:30:41PM -0700, RickMuller wrote: > I have to sort a list, but in addition to the sorting, I need to > compute a phase factor that is +1 if there is an even number of > interchanges in the sort, and -1 if there is an odd number of > interchanges. > I would just write a

Re: richcmpfunc semantics

2005-04-07 Thread harold fellermann
Thank you Greg, I figured most of it out in the meantime, myself. I only differ from you in one point. What has to be done, if the function is invoked for an operator I don't want to define? Return Py_NotImplemented. (Note that's return, *not* raise.) I used PyErr_BadArgument(); return NULL; instea

Re: logging as root using python script

2005-04-07 Thread max . derkachev
Unixish system won't let You execute a setuid script with the setuid privileges. Only real machine code can be executed so. But of course, there are workarounds. When, say, you have a perl script with setuid bit set, and sperl (setuid root perl) is installed, the perl interpreter choses sperl to i

doubt regarding main function

2005-04-07 Thread praba kar
Dear All, I have doubt regarding main function in Python. In Python we can create a function and we can call a function directly. (eg:) def test(): print 'main function test' I can call this function the following way eg) test() So why we need the below way of calling a function? if __

Re: Best editor?

2005-04-07 Thread JZ
Dnia 5 Apr 2005 11:22:59 -0700, ChinStrap napisał(a): > Opinions on what the best is? Eclipse + plugins: pydev (http://pydev.sourceforge.net/updates/) and subclipse(http://subclipse.tigris.org/update/). It is free, stable, contains integrated (visual) debugger, code completion, refactoring, PyLin

Re: doubt regarding main function

2005-04-07 Thread Laszlo Zsolt Nagy
if __name__ == '__main__': test() What is the advantage of this way calling a function. For example, you can have a python script that has this function: def search(keywords,engine='www.google.com') At the end of the script, you can have this: if __name__ == '__main__': import sys

Re: Resticted mode still active (error?)

2005-04-07 Thread Max
Not that I know of - the problem only seems to occur when using the Python C API. I'm trying to come up with a C programs that shows the error but it'll take a few days to set up the emvironment. >"Jeff Epler" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] -- http://mail.python.or

Re: Python backend binding to PAM, NSS or pppd

2005-04-07 Thread Gerald Klix
Hi Heiko, Hi all, I have a PAM-library available that embedds Python. Just tell me if you need it and I will publish it. HTH, Gerald Heiko Wundram schrieb: Hey all! Before I start hacking away, I'm looking for a Python backend binding for libpam or libnss, or a python binding for the pppd plugin m

Re: Python backend binding to PAM, NSS or pppd

2005-04-07 Thread Diez B. Roggisch
Heiko Wundram wrote: > Hey all! > > Before I start hacking away, I'm looking for a Python backend binding for > libpam or libnss, or a python binding for the pppd plugin mechanism. > > I'm trying to set up an SQL authentication scheme for virtual user > accounts used for mail and PPTP-VPN-access

Re: Python backend binding to PAM, NSS or pppd

2005-04-07 Thread Diez B. Roggisch
> I've been using pyton-pam before. Works as expected - but pam frustrated > me a bit, and you gotta run as root for it to work - a thing I didn't want > to do. Ok, I just found that you wanted to play from the other side of the fence - never mind my answer. -- Regards, Diez B. Roggisch -- htt

Re: import statement - package visibility problem

2005-04-07 Thread Kristóf Stróbl
Hi! Laszlo Zsolt Nagy wrote: I have the following structure: /Lib/Server/Db/ __init_.py DatabaseConnection.py Adapters/ __init__.py FireBirdConnection.py Important file contents are: /Lib/Server/Db/__init__.py: import DatabaseConnection import Adapters /Lib/Server/Db/Data

Re: Python sleep doesn't work right in a loop?

2005-04-07 Thread ritterhaus
I appreciate all the responses. It IS possible that wx and/or python is whacked on my machine. I've got python 2.2 and 2.3 installed, I have installed and uninstalled 2.4, I've had about three versions of wx installed along the way for different programs, so it is possible that it is just my machin

Re: Best editor?

2005-04-07 Thread Colin J. Williams
Paul McGuire wrote: SciTE (Scintilla Text Editor) is just right for me too. Low overhead, great just as a Notepad alternative, but with good coding support too. -- Paul Yes, I use SciTE. Syntax marking and multiple buffers. Works with Windows and Linux. Boa-constructor (Scintilla based editor),

Re: Testing threading

2005-04-07 Thread Warren Postma
George Sakkis wrote: How one goes on testing a threaded program, apart from doing a few successful runs and crossing his fingers that it at least follows the 'correct 99.% of the time' rule ? If you haven't been in there and stepped through all the code, looked for a reasonable set of test ca

Re: Calling a Perl Module from Python ( future direction of Python)

2005-04-07 Thread Paul Boddie
Steve Holden <[EMAIL PROTECTED]> wrote in message news:<[EMAIL PROTECTED]>... > > You might also look at the work Richard Jones and others did on PyPI > during their PyCon sprint. Richard was confident that PyPI Hmmm. It would appear that this information wasn't "cleared" by the PSU. ;-) Paul -

struct enhancements?

2005-04-07 Thread lee_merrill
Hi everyone, I would like to be able to pack/unpack 8-byte longs, and have strings with null padding to be able to have the nulls trimmed off automatically. Just thought I would mention these two items on my wish list, since I searched a bit, and haven't yet found a mention of this... Regards, L

Re: struct enhancements?

2005-04-07 Thread Larry Bates
Can't address the 8-byte longs, but to strip off null padding in strings you merely do s=s.rstrip('\x00') Larry Bates [EMAIL PROTECTED] wrote: > Hi everyone, > > I would like to be able to pack/unpack 8-byte longs, and have strings > with null padding to be able to have the nulls trimmed off >

Re: cross platform printing

2005-04-07 Thread Warren Postma
David Isaac wrote: OK, I'll assume silence means "no", so new question: What is the current best practice for cross platform printing of PostScript files from Python? Well since printing postscript files on most Unix systems (probably including Mac OSX although I don't really know this for sure) i

Re: Calling a Perl Module from Python ( future direction of Python)

2005-04-07 Thread Leopold Toetsch
Greg Ewing <[EMAIL PROTECTED]> wrote: > By the way, is the Parrot project still alive, Of course. leo -- Apr 07 17:10:41 lux siggen[5353]: reading next random sig Apr 07 17:10:41 lux siggen[5353]: open: /usr/bin/fortun: Apr 07 17:10:41 lux siggen[5353]: No such file or directory -- http://mail.

Re: Lambda: the Ultimate Design Flaw

2005-04-07 Thread Aahz
In article <[EMAIL PROTECTED]>, =?iso-8859-1?Q?Fran=E7ois?= Pinard <[EMAIL PROTECTED]> wrote: >[Aahz] >> [François] >>> >>>Many of us are using Python today, week after week, year long. So >>>let's be pragmatic. Python is what it became and now is. Let's not >>>define it as a memory from the pa

Distributing Python Apps and MySQL

2005-04-07 Thread dcrespo
Hi there... I want to distribute my python apps and the MySQL Database in the easiest way possible. I mean a user just run the installation file and all is automaticly installed. Any suggestions? My knowledge: I know, as many of you, that there's py2exe for compiling python apps for running under

Re: Lambda: the Ultimate Design Flaw

2005-04-07 Thread Bill Mill
On Apr 7, 2005 1:15 AM, Greg Ewing <[EMAIL PROTECTED]> wrote: > Scott David Daniels wrote: > > Aahz wrote: > > > >> You just can't have your cake and eat it, too. > > > > I've always wondered about this turn of phrase. I seldom > > eat a cake at one sitting. > > You need to recursively subdivide

Re: import statement - package visibility problem

2005-04-07 Thread Laszlo Zsolt Nagy
Two solutions come into my mind: 1. Do not inherit from DatabaseConnection, but pass a DatabaseConnection object as a parameter to the FireBirdConnection's __init__function. After this you can delegate the necessary functionality to the DatabaseConnection (by using __getattr__). This introduce

Read 16 bit integer complex data

2005-04-07 Thread Greg
Hi, I'm new to python, I don't have a whole lot of programming experience aside from Matlab. I hope you'll excuse my ignorance. I'm trying to figure out how to read in 16 bit integer complex data. Each 16 bits alternate, first 16 bits represent the real part of the number, next 16 bits represent

Re: Best editor?

2005-04-07 Thread Brian
Yes, we vi/vim users are apparently extraordinary. Is that such a sad thing? ;-) -- http://mail.python.org/mailman/listinfo/python-list

Re: import statement - package visibility problem

2005-04-07 Thread Laszlo Zsolt Nagy
2. Maybe the layering of your application is wrong. If DatabaseConnection provides common functionality to the different Adapters, it should be on the same layer or one beneath the Adapters. Another notice. If I put 'DatabaseConnection' under 'Adapters' then it means that 'DatabaseConnection'

Re: import statement - package visibility problem

2005-04-07 Thread Laszlo Zsolt Nagy
' under 'Adapters' then it means that 'DatabaseConnection' is an adapter. But it is not. :-) In the other direction, Adapters are deeper, so adapters should can DatabaseConnection-s (and in fact they are). Spelled: In the other direction, Adapter is deeper, so adapters should _be_ DatabaseCon

Multiple inheritance: Interface problem workaround, please comment this

2005-04-07 Thread Axel Straschil
Hello! I'm working on an HTML/Cgi widget's class where multiple inheritance well be sometime a great thing. I solved all my problems for pythons multiple inheritance with this ng, thaks to all again, but there is one think I still dislike: class A(object): def __init__(self, a=None, **__

Re: Lambda: the Ultimate Design Flaw

2005-04-07 Thread François Pinard
[Aahz] > I'll agree that Python currently has many examples of more than one > way to do things (and even Python 3.0 won't remove every example > [...]). But I won't agree that Only One Way has been abandoned as a > design principle. To summarize, instead of saying "Python has only one way to do

Re: Read 16 bit integer complex data

2005-04-07 Thread Jeff Epler
You may want to use the 'numeric' or 'numarray' extensions for this. The page on numarray is here: http://www.stsci.edu/resources/software_hardware/numarray numarray doesn't support "complex 16-bit integer" as a type, but you can get a complex, floating-point valued array from your integer val

Re: client-client connection using socket

2005-04-07 Thread dcrespo
"Client" and "Server" are just definitions or convention names. If your program "listens" to connections, then it is a server. Just it. -- http://mail.python.org/mailman/listinfo/python-list

Problems extracting attachment from email

2005-04-07 Thread foten
Hi community, This is the task I'm struggling with: - A user sends me an email with the subject '*3gp*' including an attached .3gp-file. - I then fetch that email, extracts the attachement and stores it localy as a file. - I then run a python-script that parses the stored file and ge

Re: Multiple inheritance: Interface problem workaround, please comment this

2005-04-07 Thread Steven Bethard
Axel Straschil wrote: I solved all my problems for pythons multiple inheritance with this ng, thaks to all again, but there is one think I still dislike: class A(object): def __init__(self, a=None, **__eat): print "A" super(A, self).__init__() class B(object): def __init__(self, b=None, **_

Re: Lambda: the Ultimate Design Flaw

2005-04-07 Thread Ron_Adam
On 7 Apr 2005 11:11:31 -0400, [EMAIL PROTECTED] (Aahz) wrote: >You're conflating two different things: > >* Whether Python currently has only one way to do things > >* Whether Python has a design goal of only one way to do things > >I'll agree that Python currently has many examples of more than o

Re: Erroneous line number error in Py2.4.1 [Windows 2000+SP3]

2005-04-07 Thread Timo
Martin v. Löwis wrote: > Timo wrote: > > Does anyone have a clue what is going on? > > No. Please make a bug report to sf.net/projects/python. > Done: http://sourceforge.net/tracker/index.php?func=detail&aid=1178484&group_id=5470&atid=105470 BR, Timo -- http://mail.python.org/mailman/listin

Re: logging as root using python script

2005-04-07 Thread [EMAIL PROTECTED]
use the program called 'expect' it can be called via python. you can build a script using the 'autoexpect' tool. http://www.linuxjournal.com/article/3065 cheers Raghul wrote: > Hi >Is it possible to login as a root in linux using python script? > What I need is when I execute a script it shou

Re: Best editor?

2005-04-07 Thread Michael George Lerner
Nicolay A. Vasiliev <[EMAIL PROTECTED]> wrote: > Hello! > What do you think all about ActiveState Komodo? Is this specifically to me? I haven't tried it, but I'm tempted. I've recently begun teaching my wife some Python in order to help her write a useful GUI app, and that makes it look particu

Re: Lambda: the Ultimate Design Flaw

2005-04-07 Thread Robin Becker
Greg Ewing wrote: Scott David Daniels wrote: Aahz wrote: You just can't have your cake and eat it, too. I've always wondered about this turn of phrase. I seldom eat a cake at one sitting. You need to recursively subdivide the cake until you have a piece small enough to fit in your input buffer.

Re: Lambda: the Ultimate Design Flaw

2005-04-07 Thread Steve Holden
Robin Becker wrote: Greg Ewing wrote: Scott David Daniels wrote: Aahz wrote: You just can't have your cake and eat it, too. I've always wondered about this turn of phrase. I seldom eat a cake at one sitting. You need to recursively subdivide the cake until you have a piece small enough to fit in

Re: sorting a list and counting interchanges

2005-04-07 Thread Paul Rubin
Peter Nuttall <[EMAIL PROTECTED]> writes: > I would just write a quicksort and have a counter in the swap function. > A cunning way to do it would be to multiply the counter by -1 for each > swap. if you want I can write what I had in mind. Wikipedia has a good > article of quicksort. Writing a so

Re: Python backend binding to PAM, NSS or pppd

2005-04-07 Thread Gerald Klix
Well, I am actually playing, right now. For http://www.carelix.org I implemented a module that * adds a user to passwd and * authenticates that user given a certificate and some other info on removable media * it creates an encrypted loopback file, that is mounted as the user's home direct

Re: sorting a list and counting interchanges

2005-04-07 Thread bearophileHUGS
Tim's solution is very nice, it comes from basic things often taught in good computer science courses. In Python when you have to do many (-1)**n you can do: (1-2*(n%2)) This seems quite faster. Bearophile -- http://mail.python.org/mailman/listinfo/python-list

Re: Lambda: the Ultimate Design Flaw

2005-04-07 Thread Michael Spencer
Steve Holden wrote: Not at all - we just apply the same division techniques to the buffer space until we can map the pieces of cake one-to-one onto the buffers. That technique can be applied to layer cakes, but not all real cakes. Michael -- http://mail.python.org/mailman/listinfo/python-list

Re: Lambda: the Ultimate Design Flaw

2005-04-07 Thread Frank Wilde
Ulrich Hobelmann wrote: > alex goldman wrote: >> I personally think GOTO was unduly criticized by Dijkstra. With the >> benefit of hindsight, we can see that giving up GOTO in favor of >> other primitives failed to solve the decades-old software crisis. > The fault of goto in imperative languages

Re: sorting a list and counting interchanges

2005-04-07 Thread Tim Peters
[Paul Rubin] > Writing a sorting function from scratch for this purpose seems like > reinventing the wheel. Yup! list.sort() is going to be mounds faster. > Tim's answer of simply counting the cycles (without having to pay > attention to their length) is really clever. I didn't realize you coul

Re: sorting a list and counting interchanges

2005-04-07 Thread Bill Mill
On 7 Apr 2005 10:44:49 -0700, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Tim's solution is very nice, it comes from basic things often taught in > good computer science courses. I dunno, that comes from my Abstract Algebra course a heck of a lot more than it came from any of my CS classes (I g

Re: Read 16 bit integer complex data

2005-04-07 Thread Greg
That worked, thanks a lot. Greg -- http://mail.python.org/mailman/listinfo/python-list

Manipulating Peach Tree (accounting) Btrieve database

2005-04-07 Thread Dave Boland
Has anyone used Python (or other language) to query and report on data in the accounting program Peach Tree? Peach Tree uses a Btrieve database, but I can't be certain the database conforms to all of the Btrieve standards. Some companies take liberties with things like that ;-). When all is

Use string in URLs

2005-04-07 Thread Markus Franz
Hi. I want to use the string "rüffer" in a get-request, so I tried to encode it. My problem: But with urllib.quote I always get "r%FCffer", but I want to get "r%C3%BCffer" (with is correct in my opinion). Thanks. Markus -- http://mail.python.org/mailman/listinfo/python-list

Re: import statement - package visibility problem

2005-04-07 Thread Paul Clinch
Laszlo, For :- > Python 2.4.1 (#65, Mar 30 2005, 09:13:57) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>> import Lib > Traceback (most recent call last): > File "", line 1, in ? > File "Lib\__init__.py", line 1, in ? >

Re: How to detect windows shutdown

2005-04-07 Thread vincent wehren
"Austin" <[EMAIL PROTECTED]> schrieb im Newsbeitrag news:[EMAIL PROTECTED] |I wrote a GUI program with wxPython. | The error message is: | | Unhandled exception | An unhandled exception occured. Press "Abort" to terminate the program, | "Retry" to exit the program normally and "Ignore" to try to c

Re: struct enhancements?

2005-04-07 Thread lee_merrill
Thanks! I have 16 zillion ... well 16,000 strings that need trimming. Lee Larry Bates wrote: > Can't address the 8-byte longs, but to strip off null padding > in strings you merely do > > s=s.rstrip('\x00') > > Larry Bates -- http://mail.python.org/mailman/listinfo/python-list

Re: struct enhancements?

2005-04-07 Thread Tim Peters
[EMAIL PROTECTED] > I would like to be able to pack/unpack 8-byte longs, ... Have you tried struct's 'q' or 'Q' format codes? -- http://mail.python.org/mailman/listinfo/python-list

Re: Python & MySQL

2005-04-07 Thread Andy Dustman
[EMAIL PROTECTED] wrote: > Okay, > > I had the brilliant idea right after posting to google the newsgroups > on this. > > db = MySQLdb.connect(user=database_user,passwd=database_password) > > db.autocommit(True) <--- One little line! You would be better off executing db.commit() periodically (at

Re: sorting a list and counting interchanges

2005-04-07 Thread Bill Mill
> > I think it's harder for some people to see why the > > assert j not in seen > > must be true, although that's obvious after just a few hours' thought . That's where you get to leave comments like: #it follows logically that assert j not in seen or #by implication assert j not in see

Ply(LALR) and Yacc behaving differently

2005-04-07 Thread Åsmund Grammeltvedt
Hi. I am trying to implement a small compiler in python and, trying to use something a bit more pythonic than lex/yacc, ended up with ply (http://systems.cs.uchicago.edu/ply/). The only problem is that whereas yacc accepts the grammar and appears to parse it correctly, ply does not. Perhaps th

Re: Lambda: the Ultimate Design Flaw

2005-04-07 Thread Aahz
In article <[EMAIL PROTECTED]>, =?iso-8859-1?Q?Fran=E7ois?= Pinard <[EMAIL PROTECTED]> wrote: >[Aahz] >> >> I'll agree that Python currently has many examples of more than one >> way to do things (and even Python 3.0 won't remove every example >> [...]). But I won't agree that Only One Way has bee

Re: Web application toolkit recommendation?

2005-04-07 Thread Pierre Quentel
[EMAIL PROTECTED] a écrit : I have looked briefly at Karrigell. does it support user logins? S Yes, you can take a look at the "portal" demo to see how it works Regards, Pierre -- http://mail.python.org/mailman/listinfo/python-list

Re: math - need divisors algorithm

2005-04-07 Thread Peter Schorn
Philp Smith wrote: Hi Does anyone have suggested code for a compact, efficient, elegant, most of all pythonic routine to produce a list of all the proper divisors of an integer (given a list of prime factors/powers) What about # Returns a list of all divisors of n = a1^e1*a2^e2* ... *an^en whe

Re: import statement - package visibility problem

2005-04-07 Thread Laszlo Zsolt Nagy
Paul Clinch wrote: I get: import Lib Traceback (most recent call last): File "", line 1, in ? ImportError: No module named Lib I guess there's a Lib/__init__.py. You are totally right. I was trying to create an example but Python found something on my PYTHONPATH. Sorry for the

Re: oracle interface

2005-04-07 Thread M.-A. Lemburg
Andrew Dalke wrote: > In searching I find there several different ways to > connect to an Oracle server on MS Windows: > > mxODBC - http://www.egenix.com/files/python/mxODBC.html > built on top of the ODBC drivers for a given database mxODBC works nicely with Oracl on Windows. There are two

How to name Exceptions that aren't Errors

2005-04-07 Thread Leo Breebaart
I've recently become rather fond of using Exceptions in Python to signal special conditions that aren't errors, but which I feel are better communicated up the call stack via the exception mechanism than via e.g. return values. For instance, I'm thinking of methods such as: def run(self):

Re: Distributing Python Apps and MySQL

2005-04-07 Thread rbt
dcrespo wrote: Hi there... I want to distribute my python apps and the MySQL Database in the easiest way possible. I mean a user just run the installation file and all is automaticly installed. Any suggestions? My knowledge: I know, as many of you, that there's py2exe for compiling python apps for

Re: How to name Exceptions that aren't Errors

2005-04-07 Thread Steve Holden
Leo Breebaart wrote: I've recently become rather fond of using Exceptions in Python to signal special conditions that aren't errors, but which I feel are better communicated up the call stack via the exception mechanism than via e.g. return values. Absolutely. For instance, I'm thinking of methods

curious problem with large numbers

2005-04-07 Thread Chris Fonnesbeck
I have been developing a python module for Markov chain Monte Carlo estimation, in which I frequently compare variable values with a very large number, that I arbitrarily define as: inf = 1e1 However, on Windows (have tried on Mac, Linux) I get the following behaviour: >>> inf = 1e1 >>>

Re: How to name Exceptions that aren't Errors

2005-04-07 Thread F. Petitjean
Le 7 Apr 2005 19:23:21 GMT, Leo Breebaart a écrit : > I've recently become rather fond of using Exceptions in Python to > signal special conditions that aren't errors, but which I feel > are better communicated up the call stack via the exception > mechanism than via e.g. return values. > > For in

Re: Distributing Python Apps and MySQL

2005-04-07 Thread Jarek Zgoda
rbt napisał(a): I don't think one can distribute mysql within a software package w/o buying a commercial license to do so. Check out their licensing on their website here: "When your application is not licensed under either the GPL-compatible Free Software License as defined by the Free Softwar

Re: Problems extracting attachment from email

2005-04-07 Thread Lee Harr
On 2005-04-07, foten <[EMAIL PROTECTED]> wrote: > The problem I'm having is when I'm trying to extract the > attachement using > f=open(Filename, "wb") > f.write(msg.get_payload(decode=1)) > f.close() > Not the whole message is decoded and stored! > When only trying >

Re: import statement - package visibility problem

2005-04-07 Thread Laszlo Zsolt Nagy
Here is the example: http://designasign.biz/Lib2.zip Please extract the file and try to import Lib2 Although \Lib2\Client\Db\DatabaseConnection.py and \Lib2\Server\Db\DatabaseConnection.py have the same class name but they are in a different sub-package. From a programmer's view, I hope this is

Re: curious problem with large numbers

2005-04-07 Thread Jeff Epler
You may want to read http://www.python.org/peps/pep-0754.html Part of the text reads The IEEE 754 standard defines a set of binary representations and algorithmic rules for floating point arithmetic. Included in the standard is a set of constants for representing special values, in

Re: richcmpfunc semantics

2005-04-07 Thread David M. Cooke
harold fellermann <[EMAIL PROTECTED]> writes: > Thank you Greg, > > I figured most of it out in the meantime, myself. I only differ > from you in one point. > >>> What has to be done, if the function is invoked for an operator >>> I don't want to define? >> >> Return Py_NotImplemented. (Note that'

Re: How to name Exceptions that aren't Errors

2005-04-07 Thread Max
Leo Breebaart wrote: I've recently become rather fond of using Exceptions in Python to signal special conditions that aren't errors, but which I feel are better communicated up the call stack via the exception mechanism than via e.g. return values. Ummm... yeah, I quite agree. LOOK EVERYONE, it's L

Re: Lambda: the Ultimate Design Flaw

2005-04-07 Thread Terry Reedy
"Aahz" <[EMAIL PROTECTED]> > Pinard <[EMAIL PROTECTED]> wrote: >>Sure, of course. Yet, our friendly argument is sliding away from was it >>originally was. The point was about not asserting in this forum that >>Python "has only one way to do it", because this is not true anymore. >> >>The princ

Re: curious problem with large numbers

2005-04-07 Thread David M. Cooke
Chris Fonnesbeck <[EMAIL PROTECTED]> writes: > I have been developing a python module for Markov chain Monte Carlo > estimation, in which I frequently compare variable values with a very > large number, that I arbitrarily define as: > > inf = 1e1 > > However, on Windows (have tried on Mac, Lin

Re: Use string in URLs

2005-04-07 Thread Leif K-Brooks
Markus Franz wrote: I want to use the string "rüffer" in a get-request, so I tried to encode it. My problem: But with urllib.quote I always get "r%FCffer", but I want to get "r%C3%BCffer" (with is correct in my opinion). urllib.quote(u'rüffer'.encode('utf8')) -- http://mail.python.org/mailman/li

Re: curious problem with large numbers

2005-04-07 Thread Kristian Zoerhoff
On Apr 7, 2005 3:34 PM, David M. Cooke > > I don't do Windows, so I can't say this will work, but try > > >>> inf = 1e308*2 I *do* do Windows, and that does work. The value of inf then becomes '1.#INF' as expected. Strangely, doing float('1.#INF') still fails on Windows. Weird, weird. -- Kr

Re: curious problem with large numbers

2005-04-07 Thread Laszlo Zsolt Nagy
I thought it will be the same for FreeBSD, but here are the results: FreeBSD 4.8 with Python 2.3.4 Python 2.3.4 (#2, Nov 10 2004, 05:08:39) [GCC 2.95.4 20020320 [FreeBSD]] on freebsd4 Type "help", "copyright", "credits" or "license" for more information. >>> inf = 1e308*2 >>> inf Inf >>> float('Inf

Re: How to name Exceptions that aren't Errors

2005-04-07 Thread Aahz
In article <[EMAIL PROTECTED]>, Leo Breebaart <[EMAIL PROTECTED]> wrote: > >My question is twofold. First, I know that many programmers are >violently opposed to using exceptions in this fashion, i.e. for >anything other than, well, exceptional circumstances. But am I correct >in thinking that in

Re: How to name Exceptions that aren't Errors

2005-04-07 Thread Leo Breebaart
Max <[EMAIL PROTECTED]> writes: > LOOK EVERYONE, it's Leo Breebart. You are the same Leo > Breebart, right? Breeb*aa*rt. But otherwise, yeah -- I do frequent more than just one newsgroup. :-) > This guys famous in the alternative universe of > alt.fan.pratchett. I doubt anybody here cares! Who

'Address already in use' when using socket

2005-04-07 Thread Bearish
I get 'Address already in use' errors when using sockets. Am I properly shutting down all connections? What am I doing wrong? I've looked at the examples and I can't figure out what I'm missing. I already read the Python Socket HOWTO at http://py-howto.sourceforge.net/sockets/sockets.html but I see

dynamic loading of code, and avoiding package/module name collisions.

2005-04-07 Thread John Perks and Sarah Mount
Long story short: what I'm looking for is information on how have a Python app that: * embeds an editor (or wxNoteBook full of editors) * loads code from the editors' text pane into the app * executes bits of it * then later unloads to make way for an edited version of the code. The new version nee

Re: Lambda: the Ultimate Design Flaw

2005-04-07 Thread Terry Reedy
"François Pinard" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >To summarize, instead of saying "Python has only one way to do it", As I explained in response to Aahz, what Tim Peters wrote was that Python 'should preferably have only one obvious way to do it'. Omission of the

Re: Lambda: the Ultimate Design Flaw

2005-04-07 Thread Terry Reedy
"Ron_Adam" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Python has one obvious best way to do things. More exactly, 'should preferably have' rather than 'has'. > > Meaning that the most obvious and clearest way, the way that comes to > mind first, will in most cases, also be the

text processing problem

2005-04-07 Thread Maurice LING
Hi, I'm looking for a way to do this: I need to scan a text (paragraph or so) and look for occurrences of " ()". That is, if the text just before the open bracket is the same as the text in the brackets, then I have to delete the brackets, with the text in it. Does anyone knows any way to achie

Re: Lambda: the Ultimate Design Flaw

2005-04-07 Thread Philippa Cowderoy
On Thu, 7 Apr 2005, Frank Wilde wrote: Continuations rule! While continuations are a very interesting abstraction, the improvement of structured programming was to be able to prove properties of your programs in time linear to the size of the program instead of quadratic. I don't see how giving arg

Re: 'Address already in use' when using socket

2005-04-07 Thread Peter Hansen
Bearish wrote: I get 'Address already in use' errors when using sockets. Generally one can fix this using: sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) where "sock" is the server socket in question. Do this prior to attempting to bind to the port. -Peter -- http://mail.python.org/mai

Re: how can I extract all urls in a string by using re.findall() ?

2005-04-07 Thread Cappy2112
>>Reading the documentation on re might be helpfull here :-P Many times, the python docs can make the problem more complicated, espcecially with regexes. -- http://mail.python.org/mailman/listinfo/python-list

  1   2   >