Re: injecting set into 2.3's builtins?

2005-03-11 Thread and-google
Skip Montanaro wrote: I use sets a lot in my Python 2.3 code at work and have been using this hideous import to make the future move to 2.4's set type transparent: try: x = set (Surely just 'set' on its own is sufficient? This avoids the ugly else clause.) __builtin__.set

Re: Python 2.4, distutils, and pure python packages

2005-03-11 Thread Fuzzyman
Thomas Heller wrote: [CC to python-dev] Fuzzyman [EMAIL PROTECTED] writes: Python 2.4 is built with Microsoft Visiual C++ 7. This means that it uses msvcr7.dll, which *isn't* a standard part of the windows operating system. Nitpicking - it's MSVC 7.1, aka MS Visual Studio .NET 2003,

Re: PyAsm

2005-03-11 Thread Fuzzyman
Won't docstrings be removed in optimised bytecode ? that would stuff things up. Regards, Fuzzy http://www.voidspace.org.uk/python/index.shtml -- http://mail.python.org/mailman/listinfo/python-list

Re: [Python- xxxxxxxxxxxxxx Dev] RELEASED Python 2.4.1, release candidate 1

2005-03-11 Thread Richie Hindle
[Martin] I'd like to encourage feedback on whether the Windows installer works for people. It worked fine for me, upgrading from 2.4 on XPsp2. The only glitch was that it hung for 30 seconds between hitting Next on the directory-choosing page and the feature-choosing page. -- Richie Hindle

Re: Web framework

2005-03-11 Thread Gianluca Sartori
Well, my concern here was mostly about SSL support. It seems it's not supported natively. Anyway, I'm looking at all those frameworks by a 'pre-evaluation' point of you. so I'm fully trusting what I can read on their websites... -- http://mail.python.org/mailman/listinfo/python-list

Re: [Python-Dev] RELEASED Python 2.4.1, release candidate 1

2005-03-11 Thread Richie Hindle
[Martin] I'd like to encourage feedback on whether the Windows installer works for people. [Me] It worked fine for me, upgrading from 2.4 on XPsp2. Gah! I didn't mean to send that. It *didn't* work, as it turns out. It didn't overwrite python24.dll. It's possible that there was a process

Re: How to launch pdf viewer on Mac?

2005-03-11 Thread has
Paul McNett wrote: On Windows, os.startfile() does what I want: os.startfile(myDocument.pdf) But on Mac, what do I do? os.system(open myDocument.pdf) HTH has -- http://mail.python.org/mailman/listinfo/python-list

Re: Is there a short-circuiting dictionary get method?

2005-03-11 Thread Steve Holden
Terry Reedy wrote: Skip Montanaro [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] value = d.get('x') or bsf() Of course, this bsf() will get called if d['x'] evaluates to false, not just None, value = (d.get('x') is not None) or bsf() #?? Unfortunately this will set value to True

Setting sizes of widgets (PyGTK)

2005-03-11 Thread Harlin Seritt
I have the following code and I would like to know how to set the length and width of widgets like Buttons. When the window opens the button fills up the space even though I have told it not to. Anyone know how I can accomplish this? : import pygtk, gtk class Greeter: def

Re: shuffle the lines of a large file

2005-03-11 Thread Simon Brunning
On Fri, 11 Mar 2005 06:59:33 +0100, Heiko Wundram [EMAIL PROTECTED] wrote: On Tuesday 08 March 2005 15:55, Simon Brunning wrote: Ah, but that's the clever bit; it *doesn't* store the whole list - only the selected lines. But that means that it'll only read several lines from the file,

Re: os.walk(entire filesystem)

2005-03-11 Thread Simon Brunning
On Thu, 10 Mar 2005 20:11:10 +0100, Uwe Becher [EMAIL PROTECTED] wrote: You would need a wrapper to retrieve all logical drives using win32api.GetLogicalDriveStrings(),check the drive type with win32file.GetDriveType() and then os.walk() those local fixed drives.

Re: Is there a short-circuiting dictionary get method?

2005-03-11 Thread Bengt Richter
On Fri, 11 Mar 2005 04:12:19 -0500, Steve Holden [EMAIL PROTECTED] wrote: Terry Reedy wrote: Skip Montanaro [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] value = d.get('x') or bsf() Of course, this bsf() will get called if d['x'] evaluates to false, not just None, value

Re: modifiable config files in compiled code?

2005-03-11 Thread Thomas Heller
Stephen Thorne [EMAIL PROTECTED] writes: On 10 Mar 2005 06:02:22 -0800, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi All, I've been trying to come up with an elegant solution to this problem, but can't seem to think of anything better than my solution below. I have a Python program

Re: i18n: looking for expertise

2005-03-11 Thread Martin v. Löwis
klappnase wrote: On my box (mandrake-10.1) sys.getfilesystemencoding() returns 'ISO-8859-15', however : locale.nl_langinfo(locale.CODESET) 'ANSI_X3.4-1968' In the locale API, you have to do locale.setlocale(locale.LC_ALL, ) to activate the user's preferences. Python does that on startup, but then

Re: RELEASED Python 2.4.1, release candidate 1

2005-03-11 Thread Tim N. van der Leeuw
Sorry, but I don't know what you mean with 'workaround for the crash'... The interpreter no longer crashes when trying to compile this file. In Python2.4.0 I never saw any syntax error, there was just crash. Now there is a syntax error, and I when I look at the code I don't spot it. regards,

Re: i18n: looking for expertise

2005-03-11 Thread Martin v. Löwis
klappnase wrote: Oh, from the reading docs I had thought XP would use unicode: It depends on the API that the application uses. Windows has the ANSI (*) API (e.g. CreateFileExA) and the Unicode API (CreateFileExW). The ANSI API uses what Python calls the mbcs encoding; Windows calls it the ANSI

Re: [Python-Dev] RELEASED Python 2.4.1, release candidate 1

2005-03-11 Thread Martin v. Löwis
Richie Hindle wrote: Gah! I didn't mean to send that. It *didn't* work, as it turns out. It didn't overwrite python24.dll. It's possible that there was a process running at the time that was using python24.dll (I have a bunch of scheduled jobs that run in the background), but the installer

Re: modifiable config files in compiled code?

2005-03-11 Thread Maarten Sneep
In article [EMAIL PROTECTED], [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Since this utility will also be ported to the linux world, does anyone know what the linux/unix counterpart of a Windows .INI configuration file is? ConfigParser works on Linux and Mac as well. Configuration files on

Re: Is there a short-circuiting dictionary get method?

2005-03-11 Thread Duncan Booth
Bengt Richter wrote: then there's always if 'x' in d: value = d['x'] else: value = bsf() or try: value = d['x'] except KeyError: value = bsf() Its worth remembering that the first of those two suggestions is also faster than using get, so you aren't losing on speed if

Re: HC Library and *attributes parameter

2005-03-11 Thread Steve Holden
Efrat Regev wrote: Hello, I'm a really new (and quite bad) Python programmer. While trying to use the HC HTML-Generating library, I couldn't figure out how to set a table's width to some given width. Moreover, the constructors interface is def __init__(self, object = None, align = None, border

Re: HC Library and *attributes parameter

2005-03-11 Thread Peter Hansen
Efrat Regev wrote: def __init__(self, object = None, align = None, border = None, cellspacing = None, cellpaddding = None, *attributes) So, what does *attribute stand for (being a C++ programmer, it looks like a pointer, probably not the case). Is it like the C++ ellipsis? If so, how can I use

Re: Working on a log in script to my webpage

2005-03-11 Thread Pete.....
Hi all. Unfortunaly it looks like I dont have to skill to make a secure log in, cant figure out how the code has to look like, so guess my webpage has to live with a security issue. Thanks for the effort you put into teaching me the use of cookies. Best wishes Pete Pete. [EMAIL

Re: modifiable config files in compiled code?

2005-03-11 Thread Fuzzyman
Tom Willis wrote: ConfigParser works on linux I'm pretty sure. I just ran Ipython imported it and loaded a config file. I don't remember anything in the docs that said otherwise. ConfigParser is pure python - so it's cross platform. ConfigObj is nicer though :-)

Re: modifiable config files in compiled code?

2005-03-11 Thread [EMAIL PROTECTED]
There are a lot of good options here. Much more than I thought I had. Since my program's configuration file will need to be read/writeable from an existing Java Netbeans GUI, I'll most likely move the Python module to an INI or XML document. The deciding factor will be whichever the other

Wishlist item: itertools.flatten

2005-03-11 Thread Ville Vainio
For quick-and-dirty stuff, it's often convenient to flatten a sequence (which perl does, surprise surprise, by default): [1,2,[3,hello,[[4 - [1, 2, 3, 'hello', 4] One such implementation is at http://aspn.activestate.com/ASPN/Mail/Message/python-tutor/2302348 but something like this

(Newbie) Restricting inherited methods to operate on element from same subclass

2005-03-11 Thread andy2o
Hi all, Sorry if the post's title is confusing... I'll explain: I have a class, called A say, and N1 subclasses of A, called A1, A2, A3, ..., AN say. Instances of each subclass can sensibly be joined together with other instances of the *same subclass*. The syntax of the join method is

Confused with classmethods

2005-03-11 Thread jfj
Hi. Suppose this: def foo (x): print x f = classmethod (foo) class A: pass a=A() a.f = f a.f() # TypeError: 'classmethod' object is not callable! ### I understand that this is a very peculiar use of classmethods but is this error intentional? Or did

Re: (Newbie) Restricting inherited methods to operate on element from same subclass

2005-03-11 Thread Duncan Booth
andy2o wrote: But I want to raise an exception if my code finds: f = A1() g = A2() f.join(g) #should raise exception, as cannot join an #instance of A1 to an instance of A2. How can I verify in a method defined in class A that the subclasses I am joining are exactly the

Re: HC Library and *attributes parameter

2005-03-11 Thread Efrat Regev
Efrat Regev [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hello, ... Many thanks for the useful replies!! -- http://mail.python.org/mailman/listinfo/python-list

Re: Setting sizes of widgets (PyGTK)

2005-03-11 Thread Franck Pommereau
Harlin Seritt wrote: I have the following code and I would like to know how to set the length and width of widgets like Buttons. When the window opens the button fills up the space even though I have told it not to. Your button is stretched horizontally because there is nothing to put around it

Re: Confused with classmethods

2005-03-11 Thread Diez B. Roggisch
I understand that this is a very peculiar use of classmethods but is this error intentional? Or did I completely missed the point somewhere? A little bit: classmethods are defined in a class context. def foo(cls): print cls class A: foo = classmethod(foo) The error you observe

Re: Working on a log in script to my webpage

2005-03-11 Thread Steve Holden
Pete: Don;t give up, load Webware or similar and use that! regards Steve Pete. wrote: Hi all. Unfortunaly it looks like I dont have to skill to make a secure log in, cant figure out how the code has to look like, so guess my webpage has to live with a security issue. Thanks for the effort

pythonwx with database starting point

2005-03-11 Thread David Pratt
Hi, I am looking for some example code or open source project that involves pythonwx and a database. I am wanting to store images and data on the filesystem and transmit thumbnailed images and subsets of records to the web using xmlrpc preferably. I am wanting the application to be able to

Re: Confused with classmethods

2005-03-11 Thread jfj
Diez B. Roggisch wrote: I understand that this is a very peculiar use of classmethods but is this error intentional? Or did I completely missed the point somewhere? A little bit: classmethods are defined in a class context. def foo(cls): print cls class A: foo = classmethod(foo) The error

Will presentations at PyCon be recorded/streamed?

2005-03-11 Thread [EMAIL PROTECTED]
Howdy, I sure hope so. I don't get around much, so I love to be able to hear what I'm missing. I bet lots of folks would appreciate audio/video download/stream. Though video may be prefered, I've found that listening to a Powerpoint presentation is fine. Thanks, Kent --

Logging global assignments

2005-03-11 Thread Jacek Generowicz
I am dealing with an application which reads in configurations by calling (a wrapper around) execfile. Any configuration file may itself execfile other configuration files in the same manner. I would like to create a log containing all global assignments made in these files. Comparing the globals

Re: injecting set into 2.3's builtins?

2005-03-11 Thread Sion Arrowsmith
Stephen Thorne [EMAIL PROTECTED] wrote: I have: try: set except NameError: from sets import Set as set in my code in a few places. Is there any reason to prefer this over the idiom I have: if sys.version_info (2, 4): from sets import Set as set ? (I've also used the same kind of

Re: Confused with classmethods

2005-03-11 Thread Diez B. Roggisch
Not necessarily: def foo(cls): print cls f=classmethod(foo) class A: pass A.f = f a=A() a.f() Ahhh, yes, I see the minor difference - I didn't recognize it before. This works. Anyway, the confusion starts from the documentation of classmethod(). Since classmethod is a

Re: (Newbie) Restricting inherited methods to operate on element from same subclass

2005-03-11 Thread andy2O
Assuming that A is a new-style class then if they have to be exactly the same type compare the types Ah-ha! I didn't know that. if the 'other' value can be a subclass of self: def join(self, other): if not isinstance(other, type(self)): raise whatever Simple and neat! If A

Re: RELEASED Python 2.4.1, release candidate 1

2005-03-11 Thread Tim N. van der Leeuw
Hi, The new installer worked fine for me (WinXP1), but I wasn't sure if I could install over the old version and have it work properly / remove the old version from the 'Add / remove programs' list. It suggested a default location on the C: drive but the old version was installed on the D: drive

a RegEx puzzle

2005-03-11 Thread Charles Hartman
I'm still shaky on some of sre's syntax. Here's the task: I've got strings (never longer than about a dozen characters) that are guaranteed to be made only of characters 'x' and '/'. In each string I want to find the longest continuous stretch of pairs whose first character is 'x' and the

Re: Wishlist item: itertools.flatten

2005-03-11 Thread TZOTZIOY
On 11 Mar 2005 13:32:45 +0200, rumours say that Ville Vainio [EMAIL PROTECTED] might have written: For quick-and-dirty stuff, it's often convenient to flatten a sequence (which perl does, surprise surprise, by default): [1,2,[3,hello,[[4 - [1, 2, 3, 'hello', 4] One such implementation is

hotshot ??

2005-03-11 Thread Charles Hartman
(I asked this a day or two ago; if there was an answer, I missed it. Anybody using hotshot?) I've used profile before, but wanted to get more information so I thought I'd try hotshot instead. It works fine when used like profile. But when I run it using this line, prof =

Re: Logging global assignments

2005-03-11 Thread Larry Bates
Jacek Generowicz wrote: I am dealing with an application which reads in configurations by calling (a wrapper around) execfile. Any configuration file may itself execfile other configuration files in the same manner. I would like to create a log containing all global assignments made in

Re: Logging global assignments

2005-03-11 Thread Jacek Generowicz
Larry Bates [EMAIL PROTECTED] writes: Suggestion: Use ConfigParser to set your globals instead and you can track your assignments over each file, section and option in the file. I would dearly love to go down this sort of route but, unfortunately, they are not _my_ configuration files, and it

Re: Will presentations at PyCon be recorded/streamed?

2005-03-11 Thread Steve Holden
[EMAIL PROTECTED] wrote: Howdy, I sure hope so. I don't get around much, so I love to be able to hear what I'm missing. I bet lots of folks would appreciate audio/video download/stream. Though video may be prefered, I've found that listening to a Powerpoint presentation is fine. Thanks, Kent A

Re: Logging global assignments

2005-03-11 Thread Peter Otten
Jacek Generowicz wrote: Inspecting the implementation of execfile suggests to me that the assignments are performed by a hard-wired call to PyDict_SetItem, in the opcode implementations, so it looks like ideas based on giving execfile a globals dictionary with an instrumented __setitem__ are

Re: PyAsm

2005-03-11 Thread olsongt
I haven't checked PyPy out lately. I was under the impression the Pyrex/C backend was still doing static compilation. Guess I'll have to take a look. -- http://mail.python.org/mailman/listinfo/python-list

Re: a RegEx puzzle

2005-03-11 Thread Roy Smith
Charles Hartman [EMAIL PROTECTED] wrote: I'm still shaky on some of sre's syntax. Here's the task: I've got strings (never longer than about a dozen characters) that are guaranteed to be made only of characters 'x' and '/'. One possibility is to cheat completely, and depending on memory

Re: Confused with classmethods

2005-03-11 Thread jfj
Diez B. Roggisch wrote: Moreover the documentation sais that if the first argument is an instance, its class will be used for the classmethod. OTOH, class scope is not a real thing in python. It is just some code which is executed and then we get its locals and use it on Class(localsDict,

Re: Will presentations at PyCon be recorded/streamed?

2005-03-11 Thread Steve Holden
Steve Holden wrote: [EMAIL PROTECTED] wrote: Howdy, I sure hope so. I don't get around much, so I love to be able to hear what I'm missing. I bet lots of folks would appreciate audio/video download/stream. Though video may be prefered, I've found that listening to a Powerpoint presentation is

Re: Logging global assignments

2005-03-11 Thread [EMAIL PROTECTED]
In 2.4 at least, it looks like execfile can take an arbirary mapping object for globals, so something like this may work: class LoggedDict(dict): def __setitem__(self, item, val): dict.__setitem__(self, item, val) # Do whatever logging is needed here print Assignment

Re: [perl-python] a program to delete duplicate files

2005-03-11 Thread TZOTZIOY
On Fri, 11 Mar 2005 01:24:59 +0100, rumours say that Patrick Useldinger [EMAIL PROTECTED] might have written: Have you found any way to test if two files on NTFS are hard linked without opening them first to get a file handle? No. And even then, I wouldn't know how to find out. MSDN is our

Re: pre-PEP: Print Without Intervening Space

2005-03-11 Thread Duncan Booth
Marcin Ciura wrote: None of the more efficient solutions is particularly straightforward, either: result = [] for x in seq: result.append(fn(x)) print ''.join(result) print ''.join([fn(x) for x in seq]) print

Re: help with warning formatting

2005-03-11 Thread jasmin
import warnings warnings.warn('foo') % python t.py t.py:2: UserWarning: foo warnings.warn('foo') Is there a way to just issue the warning message itself, or to at least suppress printing the line where the warning occurred ( warnings.warn('foo') in the example)? In case anyone else is

executing non-Python conde

2005-03-11 Thread Earl Eiland
I need to repeatedly execute an .exe program, changing the command line arguments, and log the output. My search of Python documentation and O'Reilly texts hasn't uncovered how I do this. Both exec and execfile seem to only run Python code. Also, neither seem to be able to pass parameters.

Re: [perl-python] a program to delete duplicate files

2005-03-11 Thread TZOTZIOY
On Fri, 11 Mar 2005 01:12:14 +0100, rumours say that Patrick Useldinger [EMAIL PROTECTED] might have written: On POSIX filesystems, one has also to avoid comparing files having same (st_dev, st_inum), because you know that they are the same file. I then have a bug here - I consider all files

wxPtyhon 2.4 non trivial problems :D

2005-03-11 Thread Michal Raburski
Hi to everybody :) I use Boa-constructor 0.3.1, wx 2.4 and python 2.3. I'have 2 big problems in my application : 1. My EVT_KEY_UP on wxTextCtrl works only when mouse pointer is on the active window. If i'll move it outside the window (with no clicking) it doesn't work. And if i move mouse

Re: SimpleHTTPRequestHandler handling long lasting requests problem

2005-03-11 Thread Andy Leszczynski
Sorry for questioning Python :-) - it turned out that this is a problem with Mozilla. For some reason it holds up with opening second connection to given host until the previous one is completed. Interestingly enough, IE works better with Python multi threaded server in that regard. Thx, A. --

Re: a RegEx puzzle

2005-03-11 Thread Charles Hartman
Charles Hartman [EMAIL PROTECTED] wrote: I'm still shaky on some of sre's syntax. Here's the task: I've got strings (never longer than about a dozen characters) that are guaranteed to be made only of characters 'x' and '/'. One possibility is to cheat completely, and depending on memory

Re: pre-PEP: Print Without Intervening Space

2005-03-11 Thread Marcin Ciura
Duncan Booth wrote: import sys def nospace(value, stream=None): '''Suppress output of space before printing value''' stream = stream or sys.stdout stream.softspace = 0 return str(value) I'm teaching Python as the first programming language to non-computer scientists. Many of the

Re: executing non-Python conde

2005-03-11 Thread Simon Brunning
On Fri, 11 Mar 2005 07:36:03 -0700, Earl Eiland [EMAIL PROTECTED] wrote: I need to repeatedly execute an .exe program, changing the command line arguments, and log the output. http://docs.python.org/lib/module-subprocess.html -- Cheers, Simon B, [EMAIL PROTECTED],

PEP 309 (Partial Function Application) Idea

2005-03-11 Thread Chris Perkins
Random idea of the day: How about having syntax support for currying/partial function application, like this: func(..., a, b) func(a, ..., b) func(a, b, ...) That is: 1) Make an Ellipsis literal legal syntax in an argument list. 2) Have the compiler recognize the Ellipsis literal and transform

Re: pre-PEP: Print Without Intervening Space

2005-03-11 Thread Larry Bates
Marcin Ciura wrote: Here is a pre-PEP about print that I wrote recently. Please let me know what is the community's opinion on it. Cheers, Marcin PEP: XXX Title: Print Without Intervening Space Version: $Revision: 0.0 $ Author: Marcin Ciura marcin.ciura at polsl.pl Status: Draft

Re: executing non-Python conde

2005-03-11 Thread Larry Bates
Earl Eiland wrote: I need to repeatedly execute an .exe program, changing the command line arguments, and log the output. My search of Python documentation and O'Reilly texts hasn't uncovered how I do this. Both exec and execfile seem to only run Python code. Also, neither seem to be able

Re: executing non-Python conde

2005-03-11 Thread Steve Holden
Earl Eiland wrote: I need to repeatedly execute an .exe program, changing the command line arguments, and log the output. My search of Python documentation and O'Reilly texts hasn't uncovered how I do this. Both exec and execfile seem to only run Python code. Also, neither seem to be able to

Re: pre-PEP: Print Without Intervening Space

2005-03-11 Thread Marcin Ciura
Larry Bates wrote: I fail to see why your proposed solution of: for x in seq: print fn(x),, print is clearer than: print ''.join([fn(x) for x in seq]) Thank you for your input. The latter form is fine with me personally, but you just can't explain it to complete novices. My

smtplib / solaris (newbie problem?)

2005-03-11 Thread chuck
I've good luck with this on a Linux system (foolproof), and now I'm trying to get the same thing to run on a Solaris box. pythonpath, or env or..? Any help much appreciated. Thanks Chuck Python 2.3.2 (#1, Oct 17 2003, 19:06:15) [C] on sunos5 Type help, copyright, credits or license for more

Re: [perl-python] a program to delete duplicate files

2005-03-11 Thread Patrick Useldinger
Christos TZOTZIOY Georgiou wrote: The relevant parts from this last page: st_dev - dwVolumeSerialNumber st_ino - (nFileIndexHigh, nFileIndexLow) I see. But if I am not mistaken, that would mean that I (1) had to detect NTFS volumes (2) use non-standard libraries to find these information (like the

Re: [perl-python] a program to delete duplicate files

2005-03-11 Thread Patrick Useldinger
David Eppstein wrote: You need do no comparisons between files. Just use a sufficiently strong hash algorithm (SHA-256 maybe?) and compare the hashes. That's not very efficient. IMO, it only makes sense in network-based operations such as rsync. -pu --

Re: pre-PEP: Print Without Intervening Space

2005-03-11 Thread Bill Mill
On Fri, 11 Mar 2005 10:00:03 -0600, Larry Bates [EMAIL PROTECTED] wrote: I also don't miss a no-space option on print. I've always believed that print statements with commas in them were for simple output with little or no regard for formatting (like for debugging statements). If I want

Re: a RegEx puzzle

2005-03-11 Thread Peter Otten
Charles Hartman wrote: pat = sre.compile('(x[x/])+') (longest, startlongest) = max([(fnd.end()-fnd.start(), fnd.start()) for i in range(len(marks)) for fnd in pat.finditer(marks,i)]) If I'm understanding that correctly, the only way for you to get different best matches are at offsets 0 and

Re: shuffle the lines of a large file

2005-03-11 Thread Peter Otten
Simon Brunning wrote: I couldn't resist. ;-) Me neither... import random def randomLines(filename, lines=1): selected_lines = list(None for line_no in xrange(lines)) for line_index, line in enumerate(open(filename)): for selected_line_index in xrange(lines):

Re: Confused with classmethods

2005-03-11 Thread Jong ruuddotdedotjongatconsunet dot
jfj schreef: Diez B. Roggisch wrote: I understand that this is a very peculiar use of classmethods but is this error intentional? Or did I completely missed the point somewhere? Note that this is not really related to classmethods. A similar problem exists if you want to use an ordinary function

Re: executing non-Python conde

2005-03-11 Thread Earl Eiland
So where do I find win32process. It's not a builtin (at least import win32process fails) A search of python.org fails. A search of sourceforge fails. A google search brings up lots of stuff, but I didn't find the module. Earl Eiland On Fri, 2005-03-11 at 09:02, Larry Bates wrote: Earl Eiland

Re: [perl-python] a program to delete duplicate files

2005-03-11 Thread Patrick Useldinger
Christos TZOTZIOY Georgiou wrote: A minor nit-pick: `fdups.py -r .` does nothing (at least on Linux). Changed. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python 2.4, distutils, and pure python packages

2005-03-11 Thread Thomas Heller
Martin v. Löwis [EMAIL PROTECTED] writes: Thomas Heller wrote: This means that if you build a windows installer using distutils - it *requires* msvcr7.dll in order to run. This is true even if your package is a pure python package. This means that when someone tries to use a windows installer

Re: a RegEx puzzle

2005-03-11 Thread Jeremy Bowers
On Fri, 11 Mar 2005 08:38:36 -0500, Charles Hartman wrote: I'm still shaky on some of sre's syntax. Here's the task: I've got strings (never longer than about a dozen characters) that are guaranteed to be made only of characters 'x' and '/'. In each string I want to find the longest

Re: SimpleHTTPRequestHandler handling long lasting requests problem

2005-03-11 Thread Steve Holden
Andy Leszczynski wrote: Sorry for questioning Python :-) - it turned out that this is a problem with Mozilla. For some reason it holds up with opening second connection to given host until the previous one is completed. Interestingly enough, IE works better with Python multi threaded server in

Re: a RegEx puzzle

2005-03-11 Thread Kent Johnson
Charles Hartman wrote: I'm still shaky on some of sre's syntax. Here's the task: I've got strings (never longer than about a dozen characters) that are guaranteed to be made only of characters 'x' and '/'. In each string I want to find the longest continuous stretch of pairs whose first

Re: [Python-Dev] RELEASED Python 2.4.1, release candidate 1

2005-03-11 Thread Vincent Wehren
Martin v. Löwis wrote: Anthony Baxter wrote: On behalf of the Python development team and the Python community, I'm happy to announce the release of Python 2.4.1 (release candidate 1). Python 2.4.1 is a bug-fix release. See the release notes at the website (also available as Misc/NEWS in the

pyparsing: parseString confusion

2005-03-11 Thread Peter Fein
My understanding of parseString seems flawed: I thought the grammar must match the string in its entirety, based on the following from the howto: scanString allows you to scan through the input source string for random matches, instead of exhaustively defining the grammar for the entire source

Re: a RegEx puzzle

2005-03-11 Thread Charles Hartman
If I'm understand you right, then I still didn't explain clearly. (Surprise!) If the string is '//xx//' then possible matches are at position 6 and 7 (both length 2, so longest doesn't even come into it). My code searches from position 0, then 1, then 2, and so on, to catch every possible

Re: Confused with classmethods

2005-03-11 Thread Steve Holden
jfj wrote: Diez B. Roggisch wrote: Moreover the documentation sais that if the first argument is an instance, its class will be used for the classmethod. OTOH, class scope is not a real thing in python. It is just some code which is executed and then we get its locals and use it on

Re: pyparsing: parseString confusion

2005-03-11 Thread infidel
I've notice the same thing. It seems that it will return as much as it can that matches the grammar and just stop when it encounters something it doesn't recognize. -- http://mail.python.org/mailman/listinfo/python-list

Re: executing non-Python conde

2005-03-11 Thread Steve Holden
Earl Eiland wrote: So where do I find win32process. It's not a builtin (at least import win32process fails) A search of python.org fails. A search of sourceforge fails. A google search brings up lots of stuff, but I didn't find the module. Earl Eiland [...]

Re: Will presentations at PyCon be recorded/streamed?

2005-03-11 Thread Grig Gheorghiu
Is there an official procedure for signing up for presenting a Lightning Talk, except for editing the PyCon05 Wiki page? Grig -- http://mail.python.org/mailman/listinfo/python-list

Pygame - jerky motion

2005-03-11 Thread donn
Hi- just installed pygame, not sure where to go for some help. I am on Fedora 3 running an ATI card but without the GL drivers installed. When I run any of the examples they work fine but they are very jerky. The animation is smooth for a few seconds and then the entire thing pauses for a

RE: Will presentations at PyCon be recorded/streamed?

2005-03-11 Thread Batista, Facundo
Title: RE: Will presentations at PyCon be recorded/streamed? [Grig Gheorghiu] #- Is there an official procedure for signing up for presenting a #- Lightning Talk, except for editing the PyCon05 Wiki page? Don't know. I just edited it today and a mail was generated automatically to some

RE: hotshot ??

2005-03-11 Thread Robert Brewer
Charles Hartman wrote: (I asked this a day or two ago; if there was an answer, I missed it. Anybody using hotshot?) I've used profile before, but wanted to get more information so I thought I'd try hotshot instead. It works fine when used like profile. But when I run it using this

Re: Pygame - jerky motion

2005-03-11 Thread donn
donn wrote: Hi- just installed pygame, not sure where to go for some help. I am on Fedora 3 running an ATI card but without the GL drivers installed. When I run any of the examples they work fine but they are very jerky. The animation is smooth for a few seconds and then the entire thing

Re: [perl-python] a program to delete duplicate files

2005-03-11 Thread David Eppstein
In article [EMAIL PROTECTED], Patrick Useldinger [EMAIL PROTECTED] wrote: You need do no comparisons between files. Just use a sufficiently strong hash algorithm (SHA-256 maybe?) and compare the hashes. That's not very efficient. IMO, it only makes sense in network-based operations

Help Installing Python 2.3.5

2005-03-11 Thread Greg Lindstrom
I've been running python for years and have never had trouble installing until today. I am trying to install Python 2.3.5 from python.org on my windows 2000 box. I uninstalled everything from the previous Python, downloaded and ran the exe and everything appeared to run correctly (even got

Re: How to turn a variable name into a string?

2005-03-11 Thread Lonnie Princehouse
Any given Python object may be bound to multiple names or none at all, so trying to find the symbol(s) which reference an object is sort of quixotic. In fact, you've got None referenced by both my and c in this example, and in a more complicated program None will be referenced by dozens symbols

storing large amounts of data in a list/dictionary

2005-03-11 Thread flamesrock
Hi, Basically, what I'm trying to do is store large amounts of data in a list or dictionary and then convert that to a custom formatted xml file. My list looks roughly like this: (d[],r[c[d[p[],p[R,C,I) My question is, would it be faster to use a dictionary if the elements of the lists have

Re: multiple buffers management

2005-03-11 Thread Scott David Daniels
Bengt Richter wrote: On 10 Mar 2005 15:18:08 -0800, [EMAIL PROTECTED] wrote: Hello, I need to create 6 buffers in python and keep track of it. I need to pass this buffer, say buffer 1 as an index to a test app. Has Take a look at Blocks Views: http://members.dsl-only.net/~daniels/Block.html

Re: pre-PEP: Print Without Intervening Space

2005-03-11 Thread John Roth
I'm against further tinkering with Print on a number of grounds, not least of which is that it's going away in Python 3.0. It seems like wasted effort. I don't see much difficulty with the current behavior: if you want to get rid of the spaces, there are alternatives. I don't buy the novice

Re: pre-PEP: Print Without Intervening Space

2005-03-11 Thread Steve Holden
Marcin Ciura wrote: Duncan Booth wrote: import sys def nospace(value, stream=None): '''Suppress output of space before printing value''' stream = stream or sys.stdout stream.softspace = 0 return str(value) I'm teaching Python as the first programming language to non-computer

Re: pre-PEP: Print Without Intervening Space

2005-03-11 Thread Marcin Ciura
In view of Duncan's response, which invalidates the premises of my proposal, I announce the end of its short life. I will add Duncan's solution to my bag of tricks - thank you! Marcin -- http://mail.python.org/mailman/listinfo/python-list

Re: How to turn a variable name into a string?

2005-03-11 Thread Paolo G. Cantore
Hi Stewart, what about the other way, string - var and not var - string? My suggestion: mylist = [a, b, c] for my in mylist: if locals()[my] == None: print you have a problem with %s % my Paolo Stewart Midwinter wrote: I'd like to do something like the following: a = 1; b = 2; c = None

  1   2   >