Re: Why tuple with one item is no tuple

2005-03-18 Thread Kay Schluehr
Antoon Pardon wrote: > for instance I have written once somekind of vector class where > it was natural for these vectors to be added as well as te be > concatenated. Unfortunately python uses "+" for both so I had > no way to have both operators in a natural way in python. Yes this is a quite co

Re: Interface support?

2005-03-18 Thread Ville Vainio
> "Michael" == Michael Spencer <[EMAIL PROTECTED]> writes: Michael> Steve wrote: >> Is it possible to design interfaces that classes must implement >> in Python? Michael> PyProtocols: http://peak.telecommunity.com/PyProtocols.html, This (PyProtocols) seems to be the one with

Re: Is Python like VB?

2005-03-18 Thread Joe
On Thu, 17 Mar 2005 22:02:48 -0800, Tim Roberts <[EMAIL PROTECTED]> wrote: >Why on earth would >you choose to reimplement your software in a different language, rather >than just do the simple version upgrade? A lot of developers and companies are pondering this issue. The end-of-lifing of Classic

Re: PyGoogle featured on Google Code

2005-03-18 Thread Michael Hoffman
[EMAIL PROTECTED] wrote: Google has started a site Google Code http://code.google.com/ to showcase Open Source software, and the first featured project is PyGoogle, a Python module wrapper for the Google Web APIs. Also mentioned is goopy/functional, a library that brings functional language attribu

Re: fastest postgresql module

2005-03-18 Thread Josef Meile
my only issue with psycopg, is last time i looked they had no win32 port? Not completely true. Since long time ago there is a website with unofficial psycopg binaries: http://www.stickpeople.com/projects/python/psycopg/ Regards, Josef -- http://mail.python.org/mailman/listinfo/python-list

Re: (Tkinter) Adding delay to PopUpMsg

2005-03-18 Thread Eric Brunel
On 17 Mar 2005 23:40:20 -0800, Harlin Seritt <[EMAIL PROTECTED]> wrote: I am working on making something called a PopMsg widget which is actually identical to a Balloon widget from Pmw. Here is the code: ---code--- from Tkinter import * import time class PopMsg: def showmsg(self, event):

xmlproc maintainer?

2005-03-18 Thread Alban Hertroys
Hello all, We recently (about a week ago) sent a patch to the maintainer of xmlproc, but we didn't receive a reply yet. A look at the site reveals that the last update was somewhere in 2000. Does anybody know who the current maintainer is (if that changed), or what the status of xmlproc is? We

please help on installation process

2005-03-18 Thread Arindam
Hi I had downloaded python-2.4.msi and I have Windows Installer V2.00.2600.2 on my machine (my OS is Win 2K Professional). But every time I try to run python-2.4.msi I am getting the error message: "This installation package could not be opened..." I am a newsier in python, I would be grate

Re: how to handle repetitive regexp match checks

2005-03-18 Thread Duncan Booth
Matt Wette wrote: > I am having difficulty doing this cleanly in python. Can anyone help? > > rx1 = re.compile(r'struct {') > rx2 = re.compile(r'typedef struct {') > rx3 = re.compile(r'something else') > > m = rx1.match(line) > if m: >do something > else: >

help on installation

2005-03-18 Thread Arindam
Hi I had downloaded python-2.4.msi and I have Windows Installer V2.00.2600.2 on my machine (my OS is Win 2K Professional). But every time I try to run python-2.4.msi I am getting the error message: "This installation package could not be opened..." I am a newsier in python, I would be grat

Re: Proposal for adding Shallow Threads and a Main Loop to Python

2005-03-18 Thread Diez B. Roggisch
Hi, a few questions: > A shallow thread is just a generator modified in the most obvious way > possible. The yield statement is replaced with a waitfor expression. > You give it the object you wish to "wait for". Then when it's ready > you get back a return value or an exception. These waitfo

Re: Why tuple with one item is no tuple

2005-03-18 Thread Antoon Pardon
Op 2005-03-17, Diez B. Roggisch schreef <[EMAIL PROTECTED]>: >> So python choose a non-deterministic direction. To me (2,3) + (4,5) >> equals (6,8). I don't dispute that having an operator to combine >> (2,3) and (4,5) in (2,3,4,5) is usefull, but they should never have >> used the "+" for that. >

Re: Why tuple with one item is no tuple

2005-03-18 Thread Antoon Pardon
Op 2005-03-16, Daniel Dittmar schreef <[EMAIL PROTECTED]>: > Diez B. Roggisch wrote: >> I reread his example and have to admit I'm confused: He complains about >> having written his _own_ vector class - and concatenation and addition had >> to use both + ? > > I've interpreted it as: > If Python ha

[Job] London based Python / Zope web developer positions

2005-03-18 Thread Dr Jack Kreindler
Blueorange Technologies is on of the UK's leading Python and Zope development firms. Our range of advanced web-applications are used throughout the NHS and licensed by some of the largest names in the Healthcare, Retail and Insurance industries. We are expanding our small, highly experienced team

html escape sequences

2005-03-18 Thread Will McGugan
Hi, I'd like to replace html escape sequences, like   and ' with single characters. Is there a dictionary defined somewhere I can use to replace these sequences? Thanks, Will McGugan -- http://mail.python.org/mailman/listinfo/python-list

HELP:UnboundLocalError: local variable '_nntp' referenced before assignment

2005-03-18 Thread Peter Moscatt
Hi all, I am in the process of writing an app that will handle news feeds and therefore using the 'nntplib' When I issue the connect command all goes will but when I issue the 'quit()' command I get the following error message: Exception in Tkinter callback Traceback (most recent call last):

Re: HELP:UnboundLocalError: local variable '_nntp' referenced before assignment

2005-03-18 Thread Diez B. Roggisch
Peter Moscatt wrote: > UnboundLocalError: local variable '_nntp' referenced before assignment This pretty much says what your problem is: you haven't a variable called _nntp > def callconnect(): > if b["text"]=="Connect": > _nntp = > nntplib.NNTP(_global.servername,int(_gl

Re: RotatingFileHandler and logging config file

2005-03-18 Thread news.sydney.pipenetworks.com
Rob Cranfill wrote: news.sydney.pipenetworks.com wrote: You're looking in the wrong place. Try http://docs.python.org/lib/node333.html which isn't quite the page in question, but leads to the closest pertinent page, http://docs.python.org/lib/logging-config-fileformat.html which *still* has noth

Re: html escape sequences

2005-03-18 Thread Leif K-Brooks
Will McGugan wrote: I'd like to replace html escape sequences, like   and ' with single characters. Is there a dictionary defined somewhere I can use to replace these sequences? How about this? import re from htmlentitydefs import name2codepoint _entity_re = re.compile(r'&(?:(#)(\d+)|([^;]+));')

Re: please help on installation process

2005-03-18 Thread Simon Brunning
On Fri, 18 Mar 2005 15:05:07 +0530, Arindam <[EMAIL PROTECTED]> wrote: > I had downloaded python-2.4.msi and I have Windows Installer V2.00.2600.2 on > my machine (my OS is Win 2K Professional). But every time I try to run > python-2.4.msi I am getting the error message: "This installation package

GIL release

2005-03-18 Thread Alastair Basden
Hi, Does anyone know whether there is a way for a python thread to release the global interpreter lock, and let all other threads have a chance at running before re-acquiring it? Does the thread scheduling follow a round-robin method? Thanks, agb. -- http://mail.python.org/mailman/listinfo/pyt

Re: html escape sequences

2005-03-18 Thread Will McGugan
Leif K-Brooks wrote: Will McGugan wrote: I'd like to replace html escape sequences, like   and ' with single characters. Is there a dictionary defined somewhere I can use to replace these sequences? How about this? import re from htmlentitydefs import name2codepoint _entity_re = re.compile(r'&(?

raise takes a long time

2005-03-18 Thread Robin Becker
I'm trying to get a handle on a real world problem related to raising an exception. This is in the reportlab SimpleDoctemplate class. The following code takes a very long time (>60 seconds) in Python 2.2, 2.3, 2.4, but not in 2.1 (at least on windows). raise LayoutError("Flowable %s too large o

Re: Why tuple with one item is no tuple

2005-03-18 Thread Daniel Dittmar
Antoon Pardon wrote: My peeve is about having operators added to standard types. This increases the chances that using an object the wrong way leads to a bogus result, not a runtime error. A more common programming error I commit is passing a string where a list ist expected. And then I wonder

RE: COM connection point

2005-03-18 Thread Stefan Schukat
Just use obj = win32com.client.Dispatch(obj) Stefan > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] Behalf Of > Oy Politics > Sent: Wednesday, March 16, 2005 11:51 PM > To: python-list@python.org > Subject: COM connection point > > > Hello: > > I

type.__new__

2005-03-18 Thread Dirk Brenckmann
Hi there, I'm new to this list and currently tracing down a problem... Could anybody give me a hint, where I can find the implementation of type.__new__. This should be somewhere in the 'c' sources - right? I just want to read the code to see what this call "really" does. Thanx for your time and

Re: raise takes a long time

2005-03-18 Thread Robin Becker
Robin Becker wrote: I'm trying to get a handle on a real world problem related to raising an exception. This is in the reportlab SimpleDoctemplate class. The following code takes a very long time (>60 seconds) in Python 2.2, 2.3, 2.4, but not in 2.1 (at least on windows). raise LayoutError("Flo

Re: xmlproc maintainer?

2005-03-18 Thread Walter Dörwald
Alban Hertroys wrote: We recently (about a week ago) sent a patch to the maintainer of xmlproc, but we didn't receive a reply yet. A look at the site reveals that the last update was somewhere in 2000. Does anybody know who the current maintainer is (if that changed), or what the status of xmlp

Monadic Parser Combinators in Python

2005-03-18 Thread Dominic Fox
Python: Now More Like Haskell Than Ever Before! I've implemented a small monadic parser combinator library in Python (based on Haskell code in a paper by Graham Hutton and Eric Meijer). http://codepoetics.com/poetix/index.php?p=94 It enables you to write things like this: > token = isalpha |seq

boa can't connect to zope

2005-03-18 Thread Gijs Korremans
Hi, I want to debug python applications on a remote pc with Boa Constructor. To do this, I have to install Zope and install the remote module from boa to the roodfolder from the management interface (http://localhost:8080/manage). I've done this, set the username and password en clicked start.

Re: code for Computer Language Shootout

2005-03-18 Thread Bryan
import sys import string def show(seq, table=string.maketrans('ACBDGHK\nMNSRUTWVYacbdghkmnsrutwvy', 'TGVHCDM\nKNSYAAWBRTGVHCDMKNSYAAWBR')): seq = seq.translate(table)[::-1] for i in range(0, len(seq), 60): print seq[i:i+60] couldn't you chang

Re: newbie:unique problem

2005-03-18 Thread Brian van den Broek
Heiko Wundram said unto the world upon 2005-03-18 01:27: On Thursday 17 March 2005 23:31, Brian van den Broek wrote: Am I not right in thinking that with the dict approach there is no guarantee that the order from the original list will be preserved? Yup, absolutely right that the original orderin

Re: how to handle repetitive regexp match checks

2005-03-18 Thread Jonathan Giddy
GiddyJP wrote: # do this once import Trespass pattern = Trespass.Pattern() pattern.addRegExp(r'struct {', 1) pattern.addRegExp(r'typedef struct {', 2) pattern.addRegExp(r'something else', 3) Minor correction... in this module { always needs to be escaped if not indicating a

adding a path module to stdlib

2005-03-18 Thread Alia Khouri
This may have been discussed ad nauseaum before, but every time I use os.path manipulations I miss something like Jason Orrendorf's path.py being in the standard library. [http://www.jorendorff.com/articles/python/path/] Ruby has it: require 'pathname' path = Pathname.new("/tmp/f.log") What are

Re: GIL release

2005-03-18 Thread Armin Steinhoff
Alastair Basden wrote: Hi, Does anyone know whether there is a way for a python thread to release the global interpreter lock, and let all other threads have a chance at running before re-acquiring it? Does the thread scheduling follow a round-robin method? The thread itself are scheduled by th

wxPython and loading multiple panels (code included)

2005-03-18 Thread flupke
Hi, i need to develop a gui which will load several "windows" depending on what the users selects in the menu and i thought i could accomplish this with panels. What i'm trying to do to test this is load an initial panel and then when the user hits a button load a second panel. This doesn't seem

Re: Is Python like VB?

2005-03-18 Thread James
> You are right that VBA isn't being discontinued yet. My own interest in > learning python is to find a replacement for Excel VBA. I'm a > mathematician who likes to throw quick programs together for things > like statistical simulations. I liked the ability to get functioning > code quickly in VB

Re: Why tuple with one item is no tuple

2005-03-18 Thread Antoon Pardon
Op 2005-03-18, Daniel Dittmar schreef <[EMAIL PROTECTED]>: > Antoon Pardon wrote: >>>My peeve is about having operators added to standard types. This >>>increases the chances that using an object the wrong way leads to a >>>bogus result, not a runtime error. A more common programming error I >>>

Re: Python becoming less Lisp-like

2005-03-18 Thread Antoon Pardon
Op 2005-03-16, Jeff Shannon schreef <[EMAIL PROTECTED]>: > Bruno Desthuilliers wrote: > >> A few examples: > [...] >> - to get the length of a sequence, you use len(seq) instead of seq.len() >> - to call objects attributes by name, you use [get|set]attr(obj, name >> [,value]) instead of obj.[get|s

syntax incorrect with regex

2005-03-18 Thread sam
Hi, What is the correct syntax of declaring a regex syntax in Python 2.3? I got the following error: # python2.3 test.py File "test.py", line 10 macros_parser = re.compile (r""" (\s+)=\"(\s+)\"$ """,re.VERBOS) ^ SyntaxError: invalid syntax Thanks sam -- http://mail.python.org/mailman/list

Re: Proposal for adding Shallow Threads and a Main Loop to Python

2005-03-18 Thread Rhamphoryncus
Diez B. Roggisch wrote: > Hi, > > a few questions: > > > A shallow thread is just a generator modified in the most obvious way > > possible. The yield statement is replaced with a waitfor expression. > > You give it the object you wish to "wait for". Then when it's ready > > you get back a return

Database connection caching

2005-03-18 Thread lbolognini
Hi all, is there an alternative way of: - create a connection object - open the connection - close the connection every time one has to run a query. I assume that big sites do something to prevent the performance hit given by these operations, don't they? Would you kindly point me to some exam

Re: Why tuple with one item is no tuple

2005-03-18 Thread Steven Bethard
Kay Schluehr wrote: On the other hand i find Mathematicas list operators very appealing: In =: [1,2,3]^2 Out=: [1,4,9] Compared with this suggar the list comprehension [x**2 for x in [1,2,3]] is ugly. py> import numarray py> a = numarray.array([1, 2, 3]) py> a**2 array([1, 4, 9]) STeVe -- http://ma

Re: Simple account program

2005-03-18 Thread Peter Maas
wes weston schrieb: >Why have transactions not associated with accounts? > All transactions are related to an account; have > a self.TransActList in Account. >You have "amount" in both Withdrawl and Deposit > both derived from Transaction. If Transactions always > have an amount, why not pu

Re: How to create datetime object from DbiDate (win32.odbc)?

2005-03-18 Thread Frank Millman
Robert Brewer wrote: > Frank Millman wrote: > > > > First prize would be to have a datetime constructor that takes a > > DbiDate object as input, in the same way that mx does, but this does > > not seem to exist. > > Try: > > datetime.datetime.utcfromtimestamp(int(value)) > Thanks, Robert, this i

Re: how to handle repetitive regexp match checks

2005-03-18 Thread GiddyJP
Matt Wette wrote: Over the last few years I have converted from Perl and Scheme to Python. There one task that I do often that is really slick in Perl but escapes me in Python. I read in a text line from a file and check it against several regular expressions and do something once I find a match

Re: syntax incorrect with regex

2005-03-18 Thread Diez B. Roggisch
sam wrote: > Hi, > > What is the correct syntax of declaring a regex syntax in Python 2.3? > I got the following error: > > # python2.3 test.py >File "test.py", line 10 > macros_parser = re.compile (r""" (\s+)=\"(\s+)\"$ """,re.VERBOS) > ^ > SyntaxError: invalid syntax No problem

Re: list of unique non-subset sets

2005-03-18 Thread bearophileHUGS
Looking at all the hyperedges in the connected component is a big waste... You can look at just the hyperedges that share one or more nodes. (Nodes are the original letters contained in the sets, and they must be hashable). If nodes aren't integers in [0, len(l)) then you can use this simpler code

Re: Is Python like VB?

2005-03-18 Thread Jim Smith
Mike Cox wrote: Would Python meet our requirements? I need to make lots of GUI applications (message boxes, forms, etc.) and do the underlying business logic too. Python is my favorite language and I recommend that you experiment with it. However, if you want the quickest replacement for VB I wou

Re: syntax incorrect with regex

2005-03-18 Thread TZOTZIOY
On Fri, 18 Mar 2005 21:57:15 +0800, rumours say that sam <[EMAIL PROTECTED]> might have written: > macros_parser = re.compile (r""" (\s+)=\"(\s+)\"$ """,re.VERBOS) > ^ >SyntaxError: invalid syntax Like Diez already said, your problem is probably mixing of tabs with spaces or bad indentati

Re: create/access dynamic growth list

2005-03-18 Thread Larry Bates
sam wrote: > Hi, > > I have a configuration file need to be processed (read/write) by python. > Currently I the following method can only read and store data that > python read a line from a configuraiton file: > def _parse (self): > # parse message > m = self.FWShow_Command.match

Re: how to handle repetitive regexp match checks

2005-03-18 Thread Paul McGuire
Matt - Pyparsing may be of interest to you. One of its core features is the ability to associate an action method with a parsing pattern. During parsing, the action is called with the original source string, the location within the string of the match, and the matched tokens. Your code would lo

Re: Is Python like VB?

2005-03-18 Thread scattered
Tim Roberts wrote: > "Mike Cox" <[EMAIL PROTECTED]> wrote: > > > >As you may or may not know, Microsoft is discontinuing Visual Basic in favor > >of VB.NET and that means I need to find a new easy programming language. I > >heard that Python is an interpreted language similar to VB. > > This stat

Re: GIL release

2005-03-18 Thread Pierre Barbier de Reuille
Do you mean in Python or in C ? In C this is described in details in the documentation. In Python, I don't think there is a way ! If you want to do so you'll want to use a micro sleep ... Pierre Alastair Basden a écrit : Hi, Does anyone know whether there is a way for a python thread to release

Re: fastest postgresql module

2005-03-18 Thread Frank Miles
In article <[EMAIL PROTECTED]>, Timothy Smith <[EMAIL PROTECTED]> wrote: >Leif B. Kristensen wrote: > >>Timothy Smith skrev: >> >> >> >>>has anyone got some hard numbers on which pg access module is the >>>fastest, i currently use pypgsql, but i can't help but feel it's a >>>little slow. >>>3 se

Re: Database connection caching

2005-03-18 Thread Swaroop C H
On 18 Mar 2005 04:52:03 -0800, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Hi all, > > is there an alternative way of: > > - create a connection object > - open the connection > - close the connection > > every time one has to run a query. Why not use cursor objects with a single connection

Re: MySQL problem

2005-03-18 Thread wes weston
Dennis Lee Bieber wrote: On Thu, 17 Mar 2005 16:45:57 GMT, wes weston <[EMAIL PROTECTED]> declaimed the following in comp.lang.python: str = "INSERT INTO produkt1 (MyNumber) VALUES(%d)" % (MyNumber) cursor.execute(str) Think you meant "MyValue" for the second item... However... Try nei

Re: Is Python like VB?

2005-03-18 Thread Swaroop C H
On Fri, 18 Mar 2005 07:40:54 -0700, at lycos.com"@bag.python.org Jim Smith <"jbzsmith> wrote: > Mike Cox wrote: > > Would Python meet our requirements? I need to make lots of > > GUI applications (message boxes, forms, etc.) and do the underlying business > > logic too. > > Python is my favorite l

Re: PyGoogle featured on Google Code

2005-03-18 Thread Skip Montanaro
Michael> I took a look at goopy and I found that much of the stuff in it Michael> could be done more efficiently with an itertools recipe. But Michael> then again, it also had sum() and maximum() functions so it Michael> must have been written for an older version of Python. I th

Re: syntax incorrect with regex

2005-03-18 Thread Fredrik Lundh
"sam" wrote: > What is the correct syntax of declaring a regex syntax in Python 2.3? > I got the following error: > > # python2.3 test.py > File "test.py", line 10 > macros_parser = re.compile (r""" (\s+)=\"(\s+)\"$ """,re.VERBOS) > ^ > SyntaxError: invalid syntax compare and contrast:

Re: Database connection caching

2005-03-18 Thread Skip Montanaro
Lorenzo> is there an alternative way of: Lorenzo> - create a connection object Lorenzo> - open the connection Lorenzo> - close the connection Lorenzo> every time one has to run a query. Sure, create a Queue.Queue object and stuff a number of connections into it. When you wan

Re: Database connection caching

2005-03-18 Thread Simon Brunning
On 18 Mar 2005 04:52:03 -0800, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > is there an alternative way of: > > - create a connection object > - open the connection > - close the connection > > every time one has to run a query. It's actually morte like: create connection create cursor execut

Re: syntax incorrect with regex

2005-03-18 Thread Swaroop C H
On Fri, 18 Mar 2005 21:57:15 +0800, sam <[EMAIL PROTECTED]> wrote: > Hi, > > What is the correct syntax of declaring a regex syntax in Python 2.3? > I got the following error: > > # python2.3 test.py >File "test.py", line 10 > macros_parser = re.compile (r""" (\s+)=\"(\s+)\"$ """,re.VERB

Windows question from Mac guy

2005-03-18 Thread Charles Hartman
I'm sitting here (briefly!) with a Windows machine trying to build a distributable for my app. I'm using py2exe and Inno Setup. (This is Apple-framework Python 2.3, wxPython 2.5.3.8.) Everything works! Except . . . My app has a data file, scandictionary.txt, that it needs to load when it start

Re: MySQL problem

2005-03-18 Thread Kent Johnson
wes weston wrote: Dennis Lee Bieber wrote: Try neither, the recommended method is to let the execute() do the formatting... That way /it/ can apply the needed quoting of arguments based upon the type of the data. cursor.execute("insert into produkt1 (MyNumber) values (%d)", (MyValue)) Dennis,

Re: Is Python like VB?

2005-03-18 Thread Tom Willis
On 18 Mar 2005 07:22:05 -0800, scattered <[EMAIL PROTECTED]> wrote: > > Tim Roberts wrote: > > "Mike Cox" <[EMAIL PROTECTED]> wrote: > > > > > >As you may or may not know, Microsoft is discontinuing Visual Basic > in favor > > >of VB.NET and that means I need to find a new easy programming > langu

Import mechanism to support multiple Python versions

2005-03-18 Thread Nicolas Fleury
Hi, I'm trying to support two Python versions at the same time and I'm trying to find effective mechanisms to support modules compiled in C++ transparently. All my code in under a single package. Is it possible to override the import mechanism only for modules under that package and sub-packa

Re: Python becoming less Lisp-like

2005-03-18 Thread Jeff Shannon
Antoon Pardon wrote: Op 2005-03-16, Jeff Shannon schreef <[EMAIL PROTECTED]>: Bruno Desthuilliers wrote: - if x is a class attribute of class A and a is an instance of A, a.x=anyvalue create a new instance attribute x instead of modifying A.x This is very consistent with the way that binding a nam

Re: Simple account program

2005-03-18 Thread Igorati
Thank you all for your help. I am sorry that I am struggling with programming. I still am attempting to "get it". Yes, I do need to stop posting homework assignments, perhaps I will learn to write code through more studying. I have gone through some toutorials if that makes you feel any better. I d

[ANNOUNCE] Twenty-third release of PythonCAD now available

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

Re: Import mechanism to support multiple Python versions

2005-03-18 Thread Thomas Heller
Nicolas Fleury <[EMAIL PROTECTED]> writes: > I have also third party packages. Is it possible to make a package > point to another folder? For example: > > psyco23/... > psyco24/... > psyco/__init__.py => points to psyco23 or psyco24 depending on Python > version used. You may manipulate the p

OSX / Python 2.3 error"truncated or malformed object ..."

2005-03-18 Thread Ian A. York
MacOS 10.3.8, Python 2.3. I installed both Tkinter and appscript yesterday. Now when I open python (or pythonw) in the Terminal I get the following: Python 2.3 (#1, Sep 13 2003, 00:49:11) [GCC 3.3 20030304 (Apple Computer, Inc. build 1495)] on darwin Type "help", "copyright", "credits" or "lic

Re: adding a path module to stdlib

2005-03-18 Thread Michael Hoffman
Alia Khouri wrote: This may have been discussed ad nauseaum before, but every time I use os.path manipulations I miss something like Jason Orrendorf's path.py being in the standard library. [http://www.jorendorff.com/articles/python/path/] That is a great library. I wrote a distutils setup.py for i

Re: how to handle repetitive regexp match checks

2005-03-18 Thread Jeff Shannon
Matt Wette wrote: Over the last few years I have converted from Perl and Scheme to Python. There one task that I do often that is really slick in Perl but escapes me in Python. I read in a text line from a file and check it against several regular expressions and do something once I find a match

Re: sgmlop: malformed charrefs?

2005-03-18 Thread Magnus Lie Hetland
In article <[EMAIL PROTECTED]>, Fredrik Lundh wrote: >Martin v. Löwis wrote: > >>> are the PyXML folks shipping the latest sgmlop? I'm pretty sure >>> they've forked the code (there's no UnicodeParser in the >>> effbot.org edition), and I have no idea how things work in the >>> fork. >> >> As we'v

Re: Splitting with Regular Expressions

2005-03-18 Thread qwweeeit
I thank you for your help. The more flexible solution (Paul McGuire) is interesting but i don't need such a flexibility. In fact I am implementing a cross-reference tool and working on python sources, I don't need the '.' as separator in order to capture variables and commands. I thank nevertheles

Re: Windows question from Mac guy

2005-03-18 Thread Thomas Heller
Charles Hartman <[EMAIL PROTECTED]> writes: > I'm sitting here (briefly!) with a Windows machine trying to build a > distributable for my app. I'm using py2exe and Inno Setup. (This is > Apple-framework Python 2.3, wxPython 2.5.3.8.) Everything works! > Except . . . > > My app has a data file, sca

How to I restart an interactive session?

2005-03-18 Thread markscottwright
I'm trying to cobble together an IDLE equivalent using pyshell and VIM (My idea is just to pipe exec file commands from VIM to pyshell via a socket or something). The one feature that IDLE has that I would really like but can't seem to duplicate is the "Restart Shell" command. Delving through the

Re: Simple XML-to-Python conversion

2005-03-18 Thread [EMAIL PROTECTED]
Since I've exhausted every option except for Amara, I've decided to give it a try. However, this will only work if I can compile Amara and 4suite along with my application. I doubt 4suite will be able to be compiled, but I'll try it anyway. If I weren't set on using XML (I know, not every applic

Re: xmlproc maintainer?

2005-03-18 Thread "Martin v. Löwis"
Alban Hertroys wrote: We recently (about a week ago) sent a patch to the maintainer of xmlproc, but we didn't receive a reply yet. A look at the site reveals that the last update was somewhere in 2000. Does anybody know who the current maintainer is (if that changed), or what the status of xmlp

Re: Import mechanism to support multiple Python versions

2005-03-18 Thread Nicolas Fleury
Nicolas Fleury wrote: import cppmymodule would be equivalent to: if sys.version == "2.4": import cppmymodule24 as cppmymodule elif sys.version == "2.3": import cppmymodule23 as cppmymodule for all modules under the package and all modules with names beginning with cpp (or another way to id

Re: Database connection caching

2005-03-18 Thread Istvan Albert
[EMAIL PROTECTED] wrote: Hi all, is there an alternative way of: - create a connection object - open the connection - close the connection psycopg, a Postgresql database adapter does connection pooling automatically http://initd.org/projects/psycopg1 Most Zope database adapters also have implicit c

Re: Windows question from Mac guy

2005-03-18 Thread Charles Hartman
On Mar 18, 2005, at 1:36 PM, [EMAIL PROTECTED] wrote: Here is code that I use, it works both for the script and the exe: Though that does *not* work on Mac, it *does* work on Windows. Bless you sir! I just put a sys.platform condition in and do it your elegant way for 'win32' and the simple way f

Re: Python becoming less Lisp-like

2005-03-18 Thread Bengt Richter
On Fri, 18 Mar 2005 09:16:42 -0800, Jeff Shannon <[EMAIL PROTECTED]> wrote: >Antoon Pardon wrote: >> Op 2005-03-16, Jeff Shannon schreef <[EMAIL PROTECTED]>: >> >>>Bruno Desthuilliers wrote: >>> - if x is a class attribute of class A and a is an instance of A, a.x=anyvalue create a new i

Re: How to I restart an interactive session?

2005-03-18 Thread Diez B. Roggisch
markscottwright wrote: > I'm trying to cobble together an IDLE equivalent using pyshell and VIM > (My idea is just to pipe exec file commands from VIM to pyshell via a > socket or something). The one feature that IDLE has that I would > really like but can't seem to duplicate is the "Restart Shel

Re: Import mechanism to support multiple Python versions

2005-03-18 Thread Serge Orlov
Nicolas Fleury wrote: > Hi, > I'm trying to support two Python versions at the same time and I'm > trying to find effective mechanisms to support modules compiled in > C++ transparently. > > All my code in under a single package. Is it possible to override > the import mechanism only for mod

Re: Simple XML-to-Python conversion

2005-03-18 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > Since I've exhausted every option except for Amara, I've decided to > give it a try. why didn't xmltramp or elementtree work for your application? they're used all over the place, in all sorts of applications, so it would be interesting to know what's so special about

Re: Splitting with Regular Expressions

2005-03-18 Thread Fredrik Lundh
"qwweeeit" <[EMAIL PROTECTED]> wrote: > In fact I am implementing a cross-reference tool and working on > python sources, I don't need the '.' as separator in order to capture > variables and commands. if you're parsing Python source code, consider using the tokenize module: http://docs.pyt

Re: Is Python like VB?

2005-03-18 Thread Steve Horsley
scattered wrote: You are right that VBA isn't being discontinued yet. My own interest in learning python is to find a replacement for Excel VBA. I'm a mathematician who likes to throw quick programs together for things like statistical simulations. I liked the ability to get functioning code quickl

Re: COM connection point

2005-03-18 Thread Aaron Brady
That appears to do just the job! Much obliged, -OY - Original Message - From: "Stefan Schukat" <[EMAIL PROTECTED]> To: "Oy Politics" <[EMAIL PROTECTED]>; Sent: Friday, March 18, 2005 6:05 AM Subject: RE: COM connection point > Just use > > obj = win32com.client.Dispatch(obj) > >

setDocumentLocator in validating parser (xmlproc)

2005-03-18 Thread Cees Wesseling
Hi, it seems that xmlproc, the default Validating parser, in my setup does not call back to setDocumentLocator. Is there anyway to get a locator in my handler? Below you find an example and its output. Regards, Cees # base imports from xml.sax.handler import ContentHandler from xml.sax.handler i

Re: Is Python like VB?

2005-03-18 Thread Tom Willis
On Fri, 18 Mar 2005 15:45:10 -0500, Tom Willis <[EMAIL PROTECTED]> wrote: > On Fri, 18 Mar 2005 20:20:19 +, Steve Horsley <[EMAIL PROTECTED]> wrote: > > scattered wrote: > > > > > You are right that VBA isn't being discontinued yet. My own interest in > > > learning python is to find a replacem

Dr. Dobb's Python-URL! - weekly Python news and links (Mar 18)

2005-03-18 Thread Cameron Laird
QOTW: "Python's best feature is comp.lang.python." -- Joerg Schuster "I learn something valuable from comp.lang.python every week, and most of it has nothing to do with Python." -- Richie Hindle Google writes successful (if suboptimal) applications. Google relies on Python: htt

Dr. Dobb's Python-URL! - weekly Python news and links (Mar 18)

2005-03-18 Thread Cameron Laird
QOTW: "Python's best feature is comp.lang.python." -- Joerg Schuster "I learn something valuable from comp.lang.python every week, and most of it has nothing to do with Python." -- Richie Hindle Google writes successful (if suboptimal) applications. Google relies on Python: htt

Re: Is Python like VB?

2005-03-18 Thread scattered
Steve Horsley wrote: > Were you aware that OpenOffice.org version 2.0, which is due out soon > (beta is available for download), can have python macros, as well as > javascript and StarOffice Basic macros? > > Steve That looks promising, though not as tightly integrated as VBA is with Excel. For

Re: Is Python like VB?

2005-03-18 Thread Jeff Shannon
Tom Willis wrote: On Fri, 18 Mar 2005 15:45:10 -0500, Tom Willis <[EMAIL PROTECTED]> wrote: On Fri, 18 Mar 2005 20:20:19 +, Steve Horsley <[EMAIL PROTECTED]> wrote: Were you aware that OpenOffice.org version 2.0, which is due out soon (beta is available for download), can have python macros, as

Re: list of unique non-subset sets

2005-03-18 Thread Bengt Richter
On Thu, 17 Mar 2005 23:56:46 GMT, "Raymond Hettinger" <[EMAIL PROTECTED]> wrote: > >"Kent Johnson" <[EMAIL PROTECTED]> wrote in message >news:[EMAIL PROTECTED] >> Raymond Hettinger wrote: >> > [EMAIL PROTECTED] >> > >> >>I have many set objects some of which can contain same group of object >> >>w

Re: How to I restart an interactive session?

2005-03-18 Thread markscottwright
But, by deleting their namespace entries haven't I effectively unloaded them? In other words, from the point of the interpreter, isn't the state at point A and point B the same? --- point A: import os del __main__.__dict__['os'] --- point B I guess my question boils down to,

Re: Simple account program

2005-03-18 Thread M.E.Farmer
Igorati wrote: > Thank you all for your help. I am sorry that I am struggling with > programming. I still am attempting to "get it". Yes, I do need to stop > posting homework assignments, perhaps I will learn to write code through > more studying. I have gone through some toutorials if that makes y

Re: wxPython vs. pyQt

2005-03-18 Thread RM
Of course, the licensing terms may still be too restrictive for those that want to create comercial closed source applications and can't afford the comercial license of Qt. That is why, for many, wxPython will remain the preferred choice. Being that you are inclined use Xemacs and xterm for your

  1   2   >