mail.python.org down

2005-04-29 Thread webmaster
Please be patient while we fix it. -- Aahz ([EMAIL PROTECTED]) * http://www.pythoncraft.com/ It's 106 miles to Chicago. We have a full tank of gas, a half-pack of cigarettes, it's dark, and we're wearing sunglasses. Hit it. --

[ANNOUNCE] Twenty-fourth release of PythonCAD now available

2005-04-29 Thread Art Haas
I'm pleased to announce the twenty-fourth 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

[ANN] Voidspace Python Guestbook 1.4.1 (etc)

2005-04-29 Thread Fuzzyman
My Honoured Guests = Yup... the time has come, **The Voidspace Python Guestbook 1.4.1** has been released into the wild. * `The Guestbook Homepage`__ * `Quick Download Link (120k)`__ * `Plain Guestbook Example`__ * `Voidspace Guestbook`__ [#]_ __

Llearn a Little About Artificial Neural Networks and TKinter

2005-04-29 Thread I. Myself
The VizANN package is a free download from annevolve.sf.net. It contains a python program that graphically demonstrates a recurrent binary neural network. There is also an explanatory text file. Mitchell Timin -- In theory, there is no difference between theory and practice. In practice,

large dictionary creation takes a LOT of time.

2005-04-29 Thread possibilitybox
this code here: def wordcount(lines): for i in range(len(lines)/8): words = lines[i].split( ) if not locals().has_key(frequency): frequency = {} for word in words: if frequency.has_key(word): frequency[word] += 1

Re: logging problems

2005-04-29 Thread [EMAIL PROTECTED]
I probably did not mention it, but I've used traceback module in other places, and it works fine. We've been planning to upgrade to 2.4 but unfortunately I cannot do that right now, and no, I have not messed with any other system modules. -- http://mail.python.org/mailman/listinfo/python-list

Re: large dictionary creation takes a LOT of time.

2005-04-29 Thread Paul Rubin
possibilitybox [EMAIL PROTECTED] writes: this code here: def wordcount(lines): for i in range(len(lines)/8): words = lines[i].split( ) if not locals().has_key(frequency): frequency = {} for word in words: if frequency.has_key(word):

Re: regex over files

2005-04-29 Thread Peter Otten
Robin Becker wrote: #sscan1.py thanks to Skip import sys, time, mmap, os, re fn = sys.argv[1] fh=os.open(fn,os.O_BINARY|os.O_RDONLY) s=mmap.mmap(fh,0,access=mmap.ACCESS_READ) l=n=0 t0 = time.time() for mat in re.split(X, s): re.split() returns a list, not a generator, and this list

Webbrowser On Windows

2005-04-29 Thread andrea . gavana
Hello NG, I am using the webbrowser module (on Windows 2000/XP), and I am wondering if anyone knows how to use the input arguments new. On Windows, it seems to be ignored. By looking at the commands it does on Windows: class WindowsDefault: def open(self, url, new=0, autoraise=1):

__del__ and logging

2005-04-29 Thread flupke
Hi, i have a class and a class attribute log which is a logger object. In the __del__() function i want to log a message but it fails even if i use self.__class__.log. The error i get is this: Traceback (most recent call last): File C:\Python24\lib\logging\__init__.py, line 712, in emit

Re: why import wx doesn't work?

2005-04-29 Thread monkey
They both work, thanks for your instruction ( : I suspect you are mixing program code for the namespace version (import wx) with the old method of importing (from wxPython.wx import *). Here are two version of a very simple app... try both and see if you get any errors. And if so, _please_

Python C API version mismatch for module pytspc ---Gyach voice chat problems

2005-04-29 Thread jeremy fleming
(EXPAND|FILL) -- http://mail.python.org/mailman/listinfo/python-list

Re: tkinter text width

2005-04-29 Thread Eric Brunel
On Thu, 28 Apr 2005 16:14:02 GMT, Dennis Lee Bieber [EMAIL PROTECTED] wrote: On Thu, 28 Apr 2005 10:36:18 +0200, Eric Brunel [EMAIL PROTECTED] declaimed the following in comp.lang.python: This is the case on all platforms, but far more sensible on Windows: Windows attempts to be clever and

Re: regex over files

2005-04-29 Thread Robin Becker
Peter Otten wrote: Robin Becker wrote: #sscan1.py thanks to Skip import sys, time, mmap, os, re fn = sys.argv[1] fh=os.open(fn,os.O_BINARY|os.O_RDONLY) s=mmap.mmap(fh,0,access=mmap.ACCESS_READ) l=n=0 t0 = time.time() for mat in re.split(X, s): re.split() returns a list, not a generator, and

Re: why import wx doesn't work?

2005-04-29 Thread monkey
Bright ( ; You show me a crystal clear explaination. As a newbie in python and even oop, I find the python documentation is not easy to figure out. That's great with you guys so nice here. This is very good! wxApp is never defined if you use import wx. You must use wx.wxApp instead. If you

Re: OOP

2005-04-29 Thread monkey
Although I am a newbie in programming, I read from a java book (in my native language) saying that the purpose of Object Oriented Programming are: 1. Use a real world concept in constructing program (here everything are objects with there properties and methods/actions); 2. Simplify coding; 3.

Re: Which IDE is recommended?

2005-04-29 Thread Franz Steinhaeusler
On 28 Apr 2005 09:48:25 -0700, Matt [EMAIL PROTECTED] wrote: Sorry about that Frank. You have to create a project (New -- Project) and add your file to it then Run--Run. This is a bug that slipped past because we do all of our development using projects and hadn't even tried the obvious: open

Re: Trying to write CGI script with python...

2005-04-29 Thread Fuzzyman
If you just want to wrap an existing python script - but pass arguments from a web interface, it ought to be very easy. You'll need to understand CGI of course. There's a good free article about getting started with CGI over at PyZine ( http://www.pyzine.com ) ;-) Can you confirm that your CGI

Re: regex over files

2005-04-29 Thread Robin Becker
Peter Otten wrote: Robin Becker wrote: #sscan1.py thanks to Skip import sys, time, mmap, os, re fn = sys.argv[1] fh=os.open(fn,os.O_BINARY|os.O_RDONLY) s=mmap.mmap(fh,0,access=mmap.ACCESS_READ) l=n=0 t0 = time.time() for mat in re.split(X, s): re.split() returns a list, not a generator, and

SWIG char** to Python list

2005-04-29 Thread Chris
Hi I have a C function that builds a list of null terminated strings: void buildStringList(char **asStrings, int n); The number of elements in the list is given in input. I'd like to have this function available in Python. I use SWIG but I'm a complete newbie with it. I've only found an example

Re: Persistent python object and the Web

2005-04-29 Thread ramon . aragues
Thanks to all for your help. My graphs are huge (and contain much more information than the list of nodes and their edges... I am working with protein-protein interaction networks) so I have decided to have a persistent object on the server. I first had to make my objects pickable (which was not

Getting PID for process

2005-04-29 Thread Harlin Seritt
Let's say I have a simple script on Windows NT. I would like for that script to find its own PID once it's started and store that as a value within the script. Also, down the road I'd like to kill that process by its PID. How is this done? Thanks, Harlin Seritt --

Re: Getting PID for process

2005-04-29 Thread John Abel
try: import os myPID = os.getpid() So you can kill it at a later date, it would be worth writing that out to a file somewhere - C:\temp? I'm sure you can get a kill command for Win32. HTH J Harlin Seritt wrote: Let's say I have a simple script on Windows NT. I would like for that script to

Re: large dictionary creation takes a LOT of time.

2005-04-29 Thread Kent Johnson
possibilitybox wrote: this code here: def wordcount(lines): for i in range(len(lines)/8): words = lines[i].split( ) if not locals().has_key(frequency): frequency = {} for word in words: if frequency.has_key(word): frequency[word]

Re: large dictionary creation takes a LOT of time.

2005-04-29 Thread Ville Vainio
Kent == Kent Johnson [EMAIL PROTECTED] writes: Kent if frequency.has_key(word): Kent frequency[word] += 1 Kent else: Kent frequency[word] = 1 This is a good place to use 'get' method of dict: frequency[word] = frequency.get(word,0) + 1 -- Ville Vainio

Re: large dictionary creation takes a LOT of time.

2005-04-29 Thread bearophileHUGS
Ville Vainio: This is a good place to use 'get' method of dict: frequency[word] = frequency.get(word,0) + 1 I think Kent Johnson is longer, but a bit faster... Bye, Bearophile -- http://mail.python.org/mailman/listinfo/python-list

Re: Can .py be complied?

2005-04-29 Thread Simon Brunning
On 28 Apr 2005 07:01:50 -0700, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: IMO the fact that so many people ask How can I create executables in Python on Windows indicates that standard batteries included Windows Python distribution is missing a vital battery. It indicates to *me* that

Re: Python site-packages and import

2005-04-29 Thread Jorge Godoy
[EMAIL PROTECTED] (Peter Saffrey) writes: [EMAIL PROTECTED]:~$ ls /usr/lib/python2.3/site-packages/id3 ID3.py ID3.pyc ID3.pyo import id3.ID3 Traceback (most recent call last): File stdin, line 1, in ? ImportError: No module named id3.ID3 It is missing a file named

Re: interactive web graphics

2005-04-29 Thread Diez B. Roggisch
In case anyone is interested... The initial plan was to use a GTK+ GUI to monitor these models and the GIMP library to create an indexed image from the pressure field, overlayed with vectors depicting winds (or currents, for the ocean). Think I'll take another look at pygtk. Take qt if you

Best way to create temporary file?

2005-04-29 Thread Frank Millman
Hi all I need to generate potentially large reports from a database, and I want to offer the option of print preview before actually printing (using wxPython). I figure that the best way to achieve this is to write the report to a temporary file, or more likely to a temporary directory with a

Re: anonymous function objects?

2005-04-29 Thread Uwe Mayer
Friday 29 April 2005 05:40 am Michele Simionato wrote: Uwe Mayer: Why does the print statement return a syntax error here? Google for Python regrets where Guido admits that 'print' should have been a function. :) Will this change in future - and if not, why not? Ciao Uwe --

Re: anonymous function objects?

2005-04-29 Thread Bengt Richter
On Thu, 28 Apr 2005 20:57:51 -0400, Peter Hansen [EMAIL PROTECTED] wrote: Uwe Mayer wrote: Unfortunately I want to assign a handler function to an object and something like this does not work: class Foobar(object): pass ... a = Foobar() def a.handler(): File stdin, line 1 def

Re: OOP

2005-04-29 Thread Kent Johnson
[EMAIL PROTECTED] wrote: Hey yall, I'm new to Python and I love it. Now I can get most of the topics covered with the Python tutorials I've read but the one thats just stumping me is Object Orientation. I can't get the grasp of it. Does anyone know of a good resource that could possibly put things

Re: Ron Grossi: God is not a man

2005-04-29 Thread sheltech
MC05 [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Donald L McDaniel [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] 4) I doubt seriously whether God plays a guitar, since guitars are made by men, for men. His Son could theoretically play a guitar. Perhaps He

Re: large dictionary creation takes a LOT of time.

2005-04-29 Thread Roy Smith
In article [EMAIL PROTECTED], possibilitybox [EMAIL PROTECTED] wrote: this code here: def wordcount(lines): for i in range(len(lines)/8): words = lines[i].split( ) if not locals().has_key(frequency): frequency = {} for word in words:

Re: Best way to create temporary file?

2005-04-29 Thread Fabio Pliger
Frank Millman [EMAIL PROTECTED] ha scritto nel messaggio news:[EMAIL PROTECTED] Hi all I need to generate potentially large reports from a database, and I want to offer the option of print preview before actually printing (using wxPython). I figure that the best way to achieve this is to

Re: anonymous function objects?

2005-04-29 Thread Michele Simionato
I have not access to Guido's time machine! M. S. -- http://mail.python.org/mailman/listinfo/python-list

Re: large dictionary creation takes a LOT of time.

2005-04-29 Thread Maksim Kasimov
Kent Johnson wrote: Here is a little cleaner version. It takes about a second to run on my PC. What hardware are you running on? path = 'DonQuixote.txt' frequency = {} for line in open(path): for word in line.split(): if frequency.has_key(word): frequency[word] += 1

undefined symbol: PyUnicodeUCS4_AsUTF8String

2005-04-29 Thread Michael Ströder
HI! I have the following problem after system upgrade to SuSE Linux 9.3: $ python -c import cPickle Traceback (most recent call last): File string, line 1, in ? ImportError: /usr/lib/python2.4/lib-dynload/cPickle.so: undefined symbol: PyUnicodeUCS4_AsUTF8String The Python 2.4.1 installation

Re: undefined symbol: PyUnicodeUCS4_AsUTF8String

2005-04-29 Thread Diez B. Roggisch
Michael Ströder wrote: HI! I have the following problem after system upgrade to SuSE Linux 9.3: $ python -c import cPickle Traceback (most recent call last): File string, line 1, in ? ImportError: /usr/lib/python2.4/lib-dynload/cPickle.so: undefined symbol: PyUnicodeUCS4_AsUTF8String

Re: New Python website

2005-04-29 Thread lpe
Hi maurice thanks for your interest, that surely looks interesting (and promising) I had no experience with any of the packages you mentioned, but it may well be usefull. Please email me with more details of what you had in mind. -- http://mail.python.org/mailman/listinfo/python-list

Re: Ron Grossi: God is not a man

2005-04-29 Thread MC05
sheltech [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] MC05 [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Donald L McDaniel [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] 4) I doubt seriously whether God plays a guitar, since guitars are made by

Re: Getting PID for process

2005-04-29 Thread runes
On XP/2003 at least, os.system('taskkill /pid le pid') will do. -- http://mail.python.org/mailman/listinfo/python-list

ANN: python-ldap-2.0.7

2005-04-29 Thread Michael Ströder
Find a new release of python-ldap: http://python-ldap.sourceforge.net/ python-ldap provides an object-oriented API to access LDAP directory servers from Python programs. It mainly wraps the OpenLDAP 2.x libs for that purpose. Additionally it contains modules for other LDAP-related stuff (e.g.

[ANN] Voidspace Python Guestbook 1.4.1 (etc)

2005-04-29 Thread Fuzzyman
My Honoured Guests = Yup... the time has come, **The Voidspace Python Guestbook 1.4.1** has been released into the wild. * `The Guestbook Homepage`__ * `Quick Download Link (120k)`__ * `Plain Guestbook Example`__ * `Voidspace Guestbook`__ [#]_ __

Re: Ron Grossi: God is not a man

2005-04-29 Thread Donald L McDaniel
MC05 wrote: sheltech [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] MC05 [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Donald L McDaniel [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] 4) I doubt seriously whether God plays a guitar, since guitars are

Need some help to understand Python program..

2005-04-29 Thread Jaeho Kim
Hi,,, I am very interested about the following Python program, but I am very beginner on Python.. I do not understand this algorithm,, I would appreciated if you give me this algorithm to some other popular programming language. filename=Karp.py from __future__ import nested_scopes import

Sockets SO_RCVBUF

2005-04-29 Thread Josh
I have written a simple TCP client/server. I would like to change the TCP receive buffer on the server side, to see performance differences. I am trying err = sock.setsockopt(socket.SOL_SOCKET, socket.SO_RCVBUF, 4096) but that doesn't seem to actual change the buffer size. The code

WSDL.Proxy newbie question

2005-04-29 Thread dresserd
Hello, I am new to implementing and consuming web services with Python. I have had some success setting up a simple SOAPServer and connecting to it and also using some of the simpler (one parameter) web services available from xmethods.org. I am currently stuck trying to use a simple hashing

Re: Can .py be complied?

2005-04-29 Thread Steve Holden
steve.leach wrote: python -o foo.exe foo.py at the command line, and get an executable, without any further effort. Hence making the resulting program useless to users of most operating systems. Let's ignore for the moment whether including py2exe as a battery is a desirable thing from an

doctest's ELLIPSIS

2005-04-29 Thread Sébastien Boisgérault
Hi, Can anybody come up with a sensible argument that would explain why the following test should fail ? (Expected: nothing, Got: 42). cheers, S.B. #!/usr/bin/env python import doctest def test(): print 42 #doctest: +ELLIPSIS ...

Re: how to pass an array to a VB array via COM

2005-04-29 Thread jelle
Hi Stefan, Thanks for your insightful and in-depth response! Wonderful to hear that a solution is in the works, that's absolutely wonderful news. If I can help you out beta-testing the PySafeArray implementation, I'd be delighted to do so. Thanks again, Jelle. --

Re: large dictionary creation takes a LOT of time.

2005-04-29 Thread Kent Johnson
Maksim Kasimov wrote: Kent Johnson wrote: for line in open(path): the line of your example raise another question: opened file will be read at once time, as method readlines() do, or it will be read line by line as method readline() do. It will be read line by line as readline() does. as far i

Re: doctest's ELLIPSIS

2005-04-29 Thread Michele Simionato
I think doctest believes the line starting with ... is a continuation line in a multiline statement. -- http://mail.python.org/mailman/listinfo/python-list

Re: Ron Grossi: God is not a man

2005-04-29 Thread AKA
Donald L McDaniel [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] MC05 wrote: sheltech [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] MC05 [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Donald L McDaniel [EMAIL PROTECTED] wrote in message news:[EMAIL

Re: Can'r run BLT twice?

2005-04-29 Thread Ron Adam
Todd Krein wrote: I'm running PythonWin on XP. When I run my plotter program the first time, it works fine. The second time I run it, I get the following error. If I exit PythonWin, and restart, I can again run it once. Any ideas? Error: 1 TclError Exception in Tk callback Function: bound method

RE: Problem with embedded python - bug?

2005-04-29 Thread Ugo Di Girolamo
I have been having a few more discussions around about this, and I'm starting to think that this is a bug. My take is that, when I call Py_Finalize, the python thread should be shut down gracefully, closing the file and everything. Maybe I'm missing a call to something

Re: doctest's ELLIPSIS

2005-04-29 Thread Sébastien Boisgérault
Doh ! Obviously ... too bad. I guess that I could set doctest.ELLIPSIS_MARKER to [...] to distinguish the two usages of (The ... used for multiline statements is hard-coded into a regular expression pattern). But it feels too hackish, ELLIPSIS_MATKER being not described in the docs ...

Re: doctest's ELLIPSIS

2005-04-29 Thread Michele Simionato
I would file a bug report/documentation bug/feature request or whatever to sourceforge. Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: doctest's ELLIPSIS

2005-04-29 Thread Sébastien Boisgérault
Done. -- http://mail.python.org/mailman/listinfo/python-list

Re: how can I sort a bunch of lists over multiple fields?

2005-04-29 Thread Lonnie Princehouse
key and cmp are equivalent for non-trivial cases (defined below), and for trivial cases the performance will be a trade-off between more function calls with cmp versus more memory use with key. Granted, for the smallish lists that the majority of Python sorts are done on, key is probably the

Re: logging problems

2005-04-29 Thread Vinay Sajip
Simon Dahlbacka simon.dahlbacka at gmail.com writes: This is a known problem, and a patch was put into CVS. I would suggest that you either check out the version from CVS, or move the import traceback to the top of the module. The problem is caused by a threading deadlock which occurs when an

Re: __del__ and logging

2005-04-29 Thread Vinay Sajip
flupke flupke at nonexistingdomain.com writes: Hi, i have a class and a class attribute log which is a logger object. In the __del__() function i want to log a message but it fails even if i use self.__class__.log. The error i get is this: Traceback (most recent call last): File

module exports a property instead of a class -- Evil?

2005-04-29 Thread gry
I often find myself wanting an instance attribute that can take on only a few fixed symbolic values. (This is less functionality than an enum, since there are no *numbers* associated with the values). I do want the thing to fiercely object to assignments or comparisons with inappropriate values.

Re: Reusing object methods?

2005-04-29 Thread Jp Calderone
On Fri, 29 Apr 2005 19:45:54 +0200, Ivan Voras [EMAIL PROTECTED] wrote: Can this be done: (this example doesn't work) class A: def a_lengthy_method(self, params): # do some work depending only on data in self and params class B: def __init__(self):

[newbie] Embedding Flash OCX object

2005-04-29 Thread Exeem
Hi All, I'm trying to find a way to embbed the flash.ocx object in a Windows Python application, I've successfully integrated a flash object with the ocx already installed on the system using the Activex Wrapper, but i would like to embbed it inside my application in order to distribute my

Re: Reusing object methods?

2005-04-29 Thread Ivan Voras
Jp Calderone wrote: I want to 'reuse' the same method from class A in class B, and without introducing a common ancestor for both of them - is this possible in an elegant, straightforward way? This is what sub-classing is for. If it makes you feel better, call it mixing in instead. You can

Re: Reusing object methods?

2005-04-29 Thread Leif K-Brooks
Ivan Voras wrote: I want to 'reuse' the same method from class A in class B, and without introducing a common ancestor for both of them - is this possible in an elegant, straightforward way? import new class A: ... def foo(self): ... print Hello, %s! % self.__class__.__name__ ...

tkinter OptionMenu column break

2005-04-29 Thread erikober
I'm creating a OptionMenu button for a gui and I'm having a problem where the drop down list is so long that most of the options are off screen. The correct behavior would be that another drop down menu list would be created next to it with the continued options. Here is the small code snippet

Re: Best way to parse file into db-type layout?

2005-04-29 Thread Peter A.Schott
That looks promising. The field numbers are pre-defined at the mainframe level. This may help me get to my ultimate goal which is to pump these into a DB on a row-by-row basis ( :-P ) I'll have to do some playing around with this. I knew that it looked like a dictionary, but wasn't sure how

Tkinter weirdness item count

2005-04-29 Thread phil
Using Tkinter Canvas to teach High School Geometry with A LOT of success. My drawing gets very slow after a lot of actions. For instance I have created code to rotate a set of objects about a rotation point. rotate 360 degrees starts to get slow after 720 degrees its crawling. I checked the item

Re: Data smoothing algorithms?

2005-04-29 Thread Larry Bates
Sounds like what you are looking for is spline interpolation. Given a set of datapoints is passes spline curves through each point giving you smooth transitions. Did a lot of this in Fortran MANY years ago. Google turned up:

Re: Which IDE is recommended?

2005-04-29 Thread John J. Lee
Dave Cook [EMAIL PROTECTED] writes: On 2005-04-27, monkey [EMAIL PROTECTED] wrote: [...] Pydev has some compelling features, but I wish I didn't have to run eclipse [...] What are those compelling features of Pydev, for an emacs user? John --

Re: module exports a property instead of a class -- Evil?

2005-04-29 Thread Lonnie Princehouse
The property factory is nice, but have you considered subclassing property? class Mode(property): def __init__(self, *vals): if [v for v in vals if not isinstance(v,str)]: raise ValueError, 'Mode values must be strings' else: self.values = list(vals)

Llearn a Little About Artificial Neural Networks and TKinter

2005-04-29 Thread I. Myself
The VizANN package is a free download from annevolve.sf.net. It contains a python program that graphically demonstrates a recurrent binary neural network. There is also an explanatory text file. Mitchell Timin -- In theory, there is no difference between theory and practice. In practice,

Re: Can .py be complied?

2005-04-29 Thread John J. Lee
Steve Holden [EMAIL PROTECTED] writes: [...] There's nothing wrong with open source projects catering to a market, and there's nothing wrong with running open source software on a proprietary operating system. To behave otherwise might reduce the growth opportunities for Python and its

Re: large dictionary creation takes a LOT of time.

2005-04-29 Thread Caleb Hattingh
In fact, as one of the Peter's (either Otten or Hansen) explained to me, for line in open(file): is actually both faster (being buffered) and generally better for very large files because it doesn't read the whole file into memory, like readlines does (if you have a memory limitation). On

Re: Trying to write CGI script with python...

2005-04-29 Thread M.E.Farmer
Just in case you don't have a clue what they are talking about ;) import traceback try: #your stuff here except: traceback.print_exc() That should return any exceptions you may be throwing. -- http://mail.python.org/mailman/listinfo/python-list

Re: Can .py be complied?

2005-04-29 Thread John J. Lee
jfj [EMAIL PROTECTED] writes: [...] /* small program in C in self extracting archive */ if (have_application (Python)) { have_python: system (python.exe my_application.py) } else { printf (This software requires python. Wait until all the necessary components are being

Re: Reusing object methods?

2005-04-29 Thread Peter Otten
Ivan Voras wrote: I want to 'reuse' the same method from class A in class B, and without introducing a common ancestor for both of them - is this possible in an elegant, straightforward way? Straightforward, if not elegant: def method(self, params): ... print self, params ... class A:

Re: Which IDE is recommended?

2005-04-29 Thread Ville Vainio
John == John J Lee [EMAIL PROTECTED] writes: John Dave Cook [EMAIL PROTECTED] writes: John What are those compelling features of Pydev, for an emacs John user? http://pydev.sourceforge.net/features.html Code completion and debugger are the most obvious ones. Eclipse itself is also

Re: Working with method-wrapper objects

2005-04-29 Thread Bengt Richter
On Thu, 28 Apr 2005 11:33:04 +0200, Dr. Peer Griebel [EMAIL PROTECTED] wrote: Peer Dr. Griebel wrote: [..] Why has [].__str__ a different type than object.__str__? Why is object.__str__ a routine while object().__str__ not? Why wouldn't you expect different types? Those are different

Re: Trying to write CGI script with python...

2005-04-29 Thread M.E.Farmer
I found an excellent example that was posted by the F-bot. Fredrik Lundh May 26 2000 From: Fredrik Lundh [EMAIL PROTECTED] Date: 2000/05/26 richard_chamberl...@ wrote: I'm having great difficulties getting Python to work via CGI. Is there anyway I can get the traceback on to the web page

Python Challenge ahead [NEW] for riddle lovers

2005-04-29 Thread pythonchallenge
For the riddles' lovers among you, you are most invited to take part in the Python Challenge, the first python programming riddle on the net. You are invited to take part in it at: http://www.pythonchallenge.com -- http://mail.python.org/mailman/listinfo/python-list

Re: OOP

2005-04-29 Thread GMane Python
As with most things, you have to understand 'why' you want to do something before you can really understand how it applies. Ok. Go to amazon. They've setup a 'shopping cart'. That cart is made of variables, name, cred.card num, items, quantity of items, ship-to address, state, shipping cost,

Re: interactive web graphics

2005-04-29 Thread Eckhoff, Michael A
On 2005-04-29 Diez Roggisch wrote: Take qt if you can - the upcoming version qt4 will be GPLed for windows (which means better binary support for windows), but recently the qt3 x11 free edition got adapted to windows. I use that myself, and have to say that I'm pretty impressed - apart from

Re: module exports a property instead of a class -- Evil?

2005-04-29 Thread gry
Hmm, I had no idea that property was a class. It's listed in the library reference manual under builtin-functions. That will certainly make things neater. Thanks! -- George -- http://mail.python.org/mailman/listinfo/python-list

Re: Can'r run BLT twice?

2005-04-29 Thread Ron Adam
Todd Krein wrote: I'm running PythonWin on XP. When I run my plotter program the first time, it works fine. The second time I run it, I get the following error. If I exit PythonWin, and restart, I can again run it once. Any ideas? Error: 1 TclError Exception in Tk callback Function: bound method

Sorting an Edge List

2005-04-29 Thread Anthony D'Agostino
I need to sort this list: [('A','Y'), ('J','A'), ('Y','J')] like this: [('A','Y'), ('Y','J'), ('J','A')]. Note how the Ys and Js are together. All I need is for the second element of one tuple to equal the first element of the next tuple. Another valid solution is [('J','A'), ('A','Y'),

Re: large dictionary creation takes a LOT of time.

2005-04-29 Thread R. C. James Harlow
On Friday 29 April 2005 11:53, Ville Vainio wrote: Kent == Kent Johnson [EMAIL PROTECTED] writes: Kent if frequency.has_key(word): Kent frequency[word] += 1 Kent else: Kent frequency[word] = 1 This is a good place to use 'get' method of dict: frequency[word] =

Re: Reusing object methods?

2005-04-29 Thread Bengt Richter
On Fri, 29 Apr 2005 19:45:54 +0200, Ivan Voras [EMAIL PROTECTED] wrote: Can this be done: (this example doesn't work) class A: def a_lengthy_method(self, params): # do some work depending only on data in self and params class B: def __init__(self):

Re: Sorting an Edge List

2005-04-29 Thread Lonnie Princehouse
Sort demands a unique ordering, which isn't present in your case. You're constructing an Eulerian path. See Fleury's algorithm: http://en.wikipedia.org/wiki/Eulerian_path -- http://mail.python.org/mailman/listinfo/python-list

Re: Best way to parse file into db-type layout?

2005-04-29 Thread John Machin
On Fri, 29 Apr 2005 18:54:54 GMT, Peter A. Schott [EMAIL PROTECTED] wrote: That looks promising. The field numbers are pre-defined at the mainframe level. Of course. Have you managed to acquire a copy of the documentation, or do you have to reverse-engineer it? This may help me get to my

Re: Sorting an Edge List

2005-04-29 Thread Roy Smith
In article [EMAIL PROTECTED], Anthony D'Agostino [EMAIL PROTECTED] wrote: I need to sort this list: [('A','Y'), ('J','A'), ('Y','J')] like this: [('A','Y'), ('Y','J'), ('J','A')]. Note how the Ys and Js are together. All I need is for the second element of one tuple to equal the first

Re: Best way to parse file into db-type layout?

2005-04-29 Thread Michael Hoffman
John Machin wrote: [Michael Hoffman]: for row in csv.reader(fileinput.input()): csv.reader requires that if the first arg is a file that it be opened in binary mode. fileinput.input() is not a file. I have tested this code and it works fine for the provided example. -- Michael Hoffman --

Re: I forgot to wind up my example .... ; (

2005-04-29 Thread Dave Rose
So, I forgot the last part of my example that might gel in your mind why Objects are useful in certain situations. Ok so you maybe followed my example of the shopping cart. Let's just forget for a moment the use for shopping carts is for websites. Let's just say you were going to write the

Re: Best way to parse file into db-type layout?

2005-04-29 Thread John Machin
On Fri, 29 Apr 2005 23:21:43 +0100, Michael Hoffman [EMAIL PROTECTED] wrote: John Machin wrote: [Michael Hoffman]: for row in csv.reader(fileinput.input()): csv.reader requires that if the first arg is a file that it be opened in binary mode. fileinput.input() is not a file.

Re: Fast plotting?

2005-04-29 Thread [EMAIL PROTECTED]
Are you sure about these numbers? Most monitors refresh at 70-80Hz, so unless you have special display hardware, I'm suspicious of these numbers doubt . I once had a user post to the matplotlib mailing list that xplt was refreshing at 1000 Hz. I think xplt drops plot requests while requests are

Re: Best way to parse file into db-type layout?

2005-04-29 Thread Michael Hoffman
John Machin wrote: [Michael Hoffman]: John Machin wrote: [Michael Hoffman]: for row in csv.reader(fileinput.input()): csv.reader requires that if the first arg is a file that it be opened in binary mode. fileinput.input() is not a file. Hair-splitter. Is name-calling really necessary? It's an awk

Re: Python Challenge ahead [NEW] for riddle lovers

2005-04-29 Thread Shane Hathaway
pythonchallenge wrote: For the riddles' lovers among you, you are most invited to take part in the Python Challenge, the first python programming riddle on the net. You are invited to take part in it at: http://www.pythonchallenge.com That was pretty fun. Good for a Friday. Too bad it

  1   2   >