Portland area Code Sprint on April 9-10

2005-04-05 Thread Arlo
XP / PYTHON CODE SPRINT XPDX will be hosting a code sprint on April 9-10, 2005 in downtown Portland, Oregon. We're all meeting in one big room, where we'll code and talk smack until beer-thirty. Come pair with long-time XPers to learn their techniques while working on nifty Python projects. If

[ANN] Release 0.27 of Task Coach

2005-04-05 Thread Frank Niessink
Hi all, I am pleased to announce release 0.27 of Task Coach. This release adds one feature: - Tasks can have a budget. You can set a time budget for tasks. If you also track effort for that task you can tack how much of the budget is still left. What is Task Coach? Task Coach is a simple task

monitoring folder in python

2005-04-05 Thread Raghul
Is it possible to monitor a folder in the python?My question is if I put any file in it that particular folder my script should monitor the folder and read the file name.If so what function can I use? Thanx in advance -- http://mail.python.org/mailman/listinfo/python-list

Re: How to merge two binary files into one?

2005-04-05 Thread Andrew Dalke
Grant Edwards wrote: For large files, something like this is probably a better idea: Or with the little-used shutil module, and keeping your nomenclature and block size of 65536 import shutil fout = file('C', 'wb') for n in ['A', 'B']: fin = file(n, 'rb') shutil.copyfileobj(fin, fout,

EOL created by .write or .encode

2005-04-05 Thread Xah Lee
Why is that some of my files written out by outF.write(outtext.encode('utf-8')) has ascii 10 as EOL, while others has ascii 13 as EOL? both of these files's EOL are originally all ascii 10. If i remove the EOL after the tt below in the place string, then this doesn't happen. findreplace = [

Re: copying a file in the python script

2005-04-05 Thread Fouff
Raghul a écrit : hi I am having a problem. I want to copy a file from the folder and paste it or move it to another folder. Is it possible in python? Actually I need to implement this in the zope for my site. When I click any file it should move or copied to another folder in the same machine

Good day

2005-04-05 Thread rlmorgan
The message cannot be represented in 7-bit ASCII encoding and has been sent as a binary attachment. -- http://mail.python.org/mailman/listinfo/python-list

Re: re module non-greedy matches broken

2005-04-05 Thread André Malo
* lothar [EMAIL PROTECTED] wrote: no - in the non-greedy regex 1st-patnot-1st-pat*?follow-pat 1st-pat, not-1st-pat and follow-pat are arbitrarily complex patterns. The not is the problem. Regex patterns are expressed positive by definition (meaning, you can say, what you expect, but not

Re: Decorator Base Class: Needs improvement.

2005-04-05 Thread Steve Holden
Ron_Adam wrote: Ok, that post may have a few(dozen?) problems in it. I got glitched by idles not clearing variables between runs, so it worked for me because it was getting values from a previous run. This should work better, fixed a few things, too. The decorators can now take more than one

Re: How to merge two binary files into one?

2005-04-05 Thread could ildg
I'm so glad that this this problem has so many recipes. On Apr 5, 2005 1:57 PM, Andrew Dalke [EMAIL PROTECTED] wrote: Grant Edwards wrote: For large files, something like this is probably a better idea: Or with the little-used shutil module, and keeping your nomenclature and block size of

Re: Insert database rows from CSV file

2005-04-05 Thread Steve Holden
Dennis Lee Bieber wrote: On Mon, 4 Apr 2005 15:54:37 -0700, 3c273 [EMAIL PROTECTED] declaimed the following in comp.lang.python: Thanks for the link, but this is the step I am trying to save (for someone else). Every time he goes to run a report, he must stop and import any new csv files. Since

Re: Decorator Maker is working. What do you think?

2005-04-05 Thread Kay Schluehr
Ron_Adam wrote: Ok... it's works! :) So what do you think? Not much. As long as You do not present any nontrivial examples like Guidos MultiMethod decorator or an implementation of the dispatching case decorator I proposed that would benefit from factoring into pre- and postprocessing the

Re: the bugs that try men's souls

2005-04-05 Thread Jordan Rastrick
Sean McIlroy wrote: later Wow again. I had a real V8 moment when I looked at your solution (smacking my forhead, groaning ruefully, etc). You were right: my intention was simply to hide the trivial cases from view; I completely missed the fact that I was now testing for membership in a

Re: Gnuplot.py and, _by far_, the weirdest thing I've ever seen on my computer

2005-04-05 Thread Fernando Perez
syd wrote: I don't even know where to begin. This is just bizarre. I just picked up the Gnuplot.py module (a light interface to gnuplot commands) and was messing around with it today. I've got a tiny script, but it only works from the command line about half the time! In the python

Re: Decorator Base Class: Needs improvement.

2005-04-05 Thread Kay Schluehr
Steve Holden wrote: You have several times mentioned the possibility of a decorator taking more than one argument, but in my understanding of decorators this just wouldn't make sense. A decorator should (shouldn't it) take precisely one argument (a function or a method) and return precisely

Re: Eric3 under WinXP

2005-04-05 Thread Phil Thompson
Hello NG, (Win XP) I have successfully installed pyqt, but not qtext, which I need to run Eric3. The PyQT demo files run fine. I've downloaded QScintilla, compiled via MS-VC, but (I suppose I need the SIG), to translate or provide the Python interface with pyd Files. Eric complains,

Placing Toplevel over the parent ?

2005-04-05 Thread Pete Moscatt
When calling a dialog box using the Toplevel widget, how do I place it over the calling parent ? Currently when I call the dialog it appears to the side of the calling parent. Pete -- http://mail.python.org/mailman/listinfo/python-list

How to read a wxTreeCtrl

2005-04-05 Thread danielpm72
Hi, I want to read a wxTreeCtrl from the root since I want to store all the information in it in a python dictionary. I know that the methods I have to use are ItemHasChildren, GetFirstChild and GetNextChild and I have been success in getting the first node in this manner: while

Re: monitoring folder in python

2005-04-05 Thread André Søreng
Raghul wrote: Is it possible to monitor a folder in the python?My question is if I put any file in it that particular folder my script should monitor the folder and read the file name.If so what function can I use? Thanx in advance If you do not want to poll (check for changes yourself regularly),

Re: StopIteration in the if clause of a generator expression

2005-04-05 Thread Simon Brunning
On Apr 5, 2005 2:04 AM, Raymond Hettinger [EMAIL PROTECTED] wrote: [Steven Bethard] So do I read this right in preferring [x for y in z] over list(x for y in z) Yes! Why? (Serious question. I'm sure that you have a good reason - I just can't figure out what it is.) The

Re: Eric3 under WinXP

2005-04-05 Thread Franz Steinhaeusler
On Tue, 5 Apr 2005 09:17:05 +0100 (BST), Phil Thompson [EMAIL PROTECTED] wrote: Hello NG, (Win XP) I have successfully installed pyqt, but not qtext, which I need to run Eric3. The PyQT demo files run fine. I've downloaded QScintilla, compiled via MS-VC, but (I suppose I need the SIG),

Re: Eric3 under WinXP

2005-04-05 Thread Phil Thompson
On Tue, 5 Apr 2005 09:17:05 +0100 (BST), Phil Thompson [EMAIL PROTECTED] wrote: Hello NG, (Win XP) I have successfully installed pyqt, but not qtext, which I need to run Eric3. The PyQT demo files run fine. I've downloaded QScintilla, compiled via MS-VC, but (I suppose I need the

Re: DIY Spam Filter in Python

2005-04-05 Thread Peter Ballard
Damien Wyart [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED]... * [EMAIL PROTECTED] (Peter Ballard) in comp.lang.python: Source code, and a bit of documentation, is at: http://members.ozemail.com.au/~pballard/diyspamfilter.html BTW, 2 of the 3 files are links, so missing from the

Is it possible to distinguish between system environment variables and the user ones?

2005-04-05 Thread could ildg
To a environment variable in Windows, can python know if it is a system environment variable or a current-user environment variable? -- -- http://mail.python.org/mailman/listinfo/python-list

Re: setup distributed computing for two computer only

2005-04-05 Thread Irmen de Jong
Heiko Wundram wrote: Am Montag, 4. April 2005 21:27 schrieb [EMAIL PROTECTED]: snip Google for: Python Remote Objects ^^^ what Heiko said :) This is, assuming that the 'function' on the other computer is implemented in Python too. --Irmen -- http://mail.python.org/mailman/listinfo/python-list

Re: StopIteration in the if clause of a generator expression

2005-04-05 Thread Duncan Booth
Simon Brunning wrote: On Apr 5, 2005 2:04 AM, Raymond Hettinger [EMAIL PROTECTED] wrote: [Steven Bethard] So do I read this right in preferring [x for y in z] over list(x for y in z) Yes! Why? (Serious question. I'm sure that you have a good reason - I just can't figure

Re: Change between Python 2.3 and 2.4 under WinXP

2005-04-05 Thread Franz Steinhaeusler
On Tue, 05 Apr 2005 01:53:25 +0200, Martin v. Löwis [EMAIL PROTECTED] wrote: Fredrik Lundh wrote: I'm not aware of any other tool that solves that specific problem. notepad does a fine job at creating batch files, IMO. Of course, it is not all that clear what the OP actually wanted. [...]

Re: Super Newbie Question

2005-04-05 Thread Joey C.
To reply to many of your messages (I'm using Google right now due to lack of a better newsreader at the moment), the issue with the temporary file is that when I write something new to it, if the old contents of the file was larger, not all of it will be overwritten. So, the truncate() method will

Re: Simple thread-safe counter?

2005-04-05 Thread Michael Hudson
Paul Rubin http://[EMAIL PROTECTED] writes: Tim Peters [EMAIL PROTECTED] writes: The GIL is your friend here: import itertools f = itertools.count().next Thanks, I was hoping something like this would work but was not sure I could rely on it. A similar thing can be done

Re: setup distributed computing for two computer only

2005-04-05 Thread Heiko Wundram
Am Dienstag, 5. April 2005 11:22 schrieb Irmen de Jong: Python Remote Objects ^^^ what Heiko said :) *biggrin* -- --- Heiko. listening to: Tool - Lateralus - 1 The Grudge.mp3 see you at: http://www.stud.mh-hannover.de/~hwundram/wordpress/ pgpKv3ALoPbZi.pgp Description: PGP signature --

Re: Eric3 under WinXP

2005-04-05 Thread Franz Steinhaeusler
On Tue, 5 Apr 2005 10:14:48 +0100 (BST), Phil Thompson [EMAIL PROTECTED] wrote: On Tue, 5 Apr 2005 09:17:05 +0100 (BST), Phil Thompson [EMAIL PROTECTED] wrote: What steps are missing? If you are using the evaluation version of Qt then you need the evaluation version of PyQt. This already

Python Google Server

2005-04-05 Thread fuzzyman
I've hacked together a 'GoogleCacheServer'. It is based on SimpleHTTPServer. Run the following script (hopefully google groups won't mangle the indentation) and set your browser proxy settings to 'localhost:8000'. It will let you browse the internet using google's cache. Obviously you'll miss

passing dictionary objects with soap

2005-04-05 Thread vivek khurana
Hi! all, How can i return dictionary type element from a soap server to a client. What should be the entry message section of a wsdl file. Regards VK Hug the REALITY ;-) Disclaimer The facts expressed here belong to everybody, the opinions to me. The distinction is yours to draw...

Re: monitoring folder in python

2005-04-05 Thread Davide Salomoni
A straw-man solution in Python that monitors a directory for changes (Linux only): #!/usr/bin/env python2 import sys import os if sys.platform not in (linux2,): sys.exit(%s only runs on Linux % os.path.basename(sys.argv[0])) # TODO: we should check that kernel version = 2.4.19 # e.g. with

Re: Eric3 under WinXP

2005-04-05 Thread Phil Thompson
On Tue, 5 Apr 2005 10:14:48 +0100 (BST), Phil Thompson [EMAIL PROTECTED] wrote: On Tue, 5 Apr 2005 09:17:05 +0100 (BST), Phil Thompson [EMAIL PROTECTED] wrote: What steps are missing? If you are using the evaluation version of Qt then you need the evaluation version of PyQt. This already

Re: Python Google Server

2005-04-05 Thread vegetax
[EMAIL PROTECTED] wrote: lol ,cool hack!! make a slashdot article about it!! I've hacked together a 'GoogleCacheServer'. It is based on SimpleHTTPServer. Run the following script (hopefully google groups won't mangle the indentation) and set your browser proxy settings to 'localhost:8000'.

Re: Eric3 under WinXP

2005-04-05 Thread Franz Steinhaeusler
On Tue, 5 Apr 2005 11:43:38 +0100 (BST), Phil Thompson [EMAIL PROTECTED] wrote: [...] Or doesn't it fit with Qt 3.3.4 Evaluation Any hints? What version of Python do you have installed? The binary is built against v2.4. Oh sorry, I think, there was a mix between Python2.3 and Python2.4

Re: Decorator Base Class: Needs improvement.

2005-04-05 Thread Bengt Richter
On 5 Apr 2005 00:54:25 -0700, Kay Schluehr [EMAIL PROTECTED] wrote: Steve Holden wrote: You have several times mentioned the possibility of a decorator taking more than one argument, but in my understanding of decorators this just wouldn't make sense. A decorator should (shouldn't it) take

Re: Python Google Server

2005-04-05 Thread vegetax
it works on opera and firefox on linux, but you cant search in the cached google! it would be more usefull if you could somehow search only in the cache instead of putting the straight link. maybe you could put a magic url to search in the cache, like search:search terms [EMAIL PROTECTED] wrote:

Python IDE like NetBeans/Delphi IDE

2005-04-05 Thread [EMAIL PROTECTED]
Hi ! I search for an IDE that working in Windows, and knows these functions: A.) Automatic name searching/showing/extending on classes with keypressing (like Netbeans, or Delphi Ctrl+Space). B.) Debugging: breakpoints, step on lines (code), watch variables. Or A and B both. Please help me.

Re: playing with pyGoogle - strange codec error

2005-04-05 Thread Richard Brodie
Brian Blazer [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Everything works fine until I get to r.snippet. Here is the error: UnicodeEncodeError: 'ascii' codec can't encode character '\ua9' in position 119: ordinal not in range(128) You have a character there (the copyright

Re: Change between Python 2.3 and 2.4 under WinXP

2005-04-05 Thread rbt
Martin v. Löwis wrote: Of course, it is not all that clear what the OP actually wanted. For all we know, he wanted to alternate quickly (with batch file or similary) between python23 and python24... Maybe off-topic for this thread, but I noticed that when installing 2.4.1 that 2.4.0 is

Re: copying a file in the python script

2005-04-05 Thread Larry Bates
If you are moving the file to another directory on the same hard drive (e.g. same filesystem) you can use os.rename(old, new) and the file doesn't have to be copied at all. This is more efficient. If you are copying to another filesystem, you must use shutil.copy and os.remove (or os.unlink).

Re: Python IDE like NetBeans/Delphi IDE

2005-04-05 Thread Larry Bates
Take a look at ActiveState: http://www.activestate.com/Products/ActivePythonFamily/?_x=1 or for something more general: http://www.eclipse.org/ Larry Bates [EMAIL PROTECTED] wrote: Hi ! I search for an IDE that working in Windows, and knows these functions: A.) Automatic name

check interpreter version before running script

2005-04-05 Thread rbt
Is there a recommended or 'Best Practices' way of checking the version of python before running scripts? I have scripts that use the os.walk() feature (introduced in 2.3) and users running 2.2 who get errors. Instead of telling them, 'Upgrade you Python Install, I'd like to use sys.version or

Re: copying a file in the python script

2005-04-05 Thread Peter Otten
Larry Bates wrote: If you are moving the file to another directory on the same hard drive (e.g. same filesystem) you can use os.rename(old, new) and the file doesn't have to be copied at all. This is more efficient. If you are copying to another filesystem, you must use shutil.copy and

Re: Python IDE like NetBeans/Delphi IDE

2005-04-05 Thread Franz Steinhaeusler
On Tue, 05 Apr 2005 14:07:14 +0200, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I search for an IDE that working in Windows, and knows these functions: A.) Automatic name searching/showing/extending on classes with keypressing (like Netbeans, or Delphi Ctrl+Space). B.) Debugging: breakpoints,

Re: check interpreter version before running script

2005-04-05 Thread Peter Otten
rbt wrote: Is there a recommended or 'Best Practices' way of checking the version of python before running scripts? I have scripts that use the os.walk() feature (introduced in 2.3) and users running 2.2 who get errors. Instead of telling them, 'Upgrade you Python Install, I'd like to use

Re: check interpreter version before running script

2005-04-05 Thread F. Petitjean
Le Tue, 05 Apr 2005 08:57:12 -0400, rbt a écrit : Is there a recommended or 'Best Practices' way of checking the version of python before running scripts? I have scripts that use the os.walk() feature (introduced in 2.3) and users running 2.2 who get errors. Instead of telling them,

Re: Eric3 under WinXP

2005-04-05 Thread Phil Thompson
On Tue, 5 Apr 2005 11:43:38 +0100 (BST), Phil Thompson [EMAIL PROTECTED] wrote: [...] Or doesn't it fit with Qt 3.3.4 Evaluation Any hints? What version of Python do you have installed? The binary is built against v2.4. Oh sorry, I think, there was a mix between Python2.3 and Python2.4

Re: Super Newbie Question

2005-04-05 Thread Peter Hansen
Joey C. wrote: To reply to many of your messages (I'm using Google right now due to lack of a better newsreader at the moment), the issue with the temporary file is that when I write something new to it, if the old contents of the file was larger, not all of it will be overwritten. That's not

Re: raw sockets please

2005-04-05 Thread Peter Hansen
ionel wrote: anyone got any idea how the get raw sockets working on win32 ? (on python 2.4) No, but I'm certain this has been asked and answered many times in the past. Maybe you could use Google Groups and search the list archives, posting here only when you get insufficient results (and telling

Re: Placing Toplevel over the parent ?

2005-04-05 Thread Peter Hansen
Pete Moscatt wrote: When calling a dialog box using the Toplevel widget, how do I place it over the calling parent ? Currently when I call the dialog it appears to the side of the calling parent. What framework? What versions? What platform? -Peter --

Re: Python Google Server

2005-04-05 Thread Fuzzyman
vegetax wrote: it works on opera and firefox on linux, but you cant search in the cached google! it would be more usefull if you could somehow search only in the cache instead of putting the straight link. maybe you could put a magic url to search in the cache, like search:search terms

Re: Python IDE like NetBeans/Delphi IDE

2005-04-05 Thread Markus Wankus
More specifically, check out the pydev plugin for Eclipse. pydev.sourceforge.net M. Larry Bates wrote: Take a look at ActiveState: http://www.activestate.com/Products/ActivePythonFamily/?_x=1 or for something more general: http://www.eclipse.org/ Larry Bates [EMAIL PROTECTED] wrote: Hi ! I search

Re: Is it possible to distinguish between system environment variables and the user ones?

2005-04-05 Thread Peter Hansen
could ildg wrote: To a environment variable in Windows, can python know if it is a system environment variable or a current-user environment variable? Not just by using the os.environ approach. You would have to resort to the pywin32 extensions. Check the Python Cookbook using Google for

Re: check interpreter version before running script

2005-04-05 Thread Peter Hansen
rbt wrote: Is there a recommended or 'Best Practices' way of checking the version of python before running scripts? I have scripts that use the os.walk() feature (introduced in 2.3) and users running 2.2 who get errors. Instead of telling them, 'Upgrade you Python Install, I'd like to use

Re: check interpreter version before running script

2005-04-05 Thread Martin Franklin
F. Petitjean wrote: Le Tue, 05 Apr 2005 08:57:12 -0400, rbt a écrit : Is there a recommended or 'Best Practices' way of checking the version of python before running scripts? I have scripts that use the os.walk() feature (introduced in 2.3) and users running 2.2 who get errors. Instead of

start python web programming

2005-04-05 Thread Andre Nobre
I should implement a simple http/database page, based on python. I read some texts and it´s strange how python deal with html output. It´s something like Servlet... is there any diferent way to do that? Something like just bussiness code, applied in an MVC framework, or just like it. Thanks and

Re: Python IDE like NetBeans/Delphi IDE

2005-04-05 Thread JZ
Dnia Tue, 05 Apr 2005 14:07:14 +0200, [EMAIL PROTECTED] napisa(a): Hi ! I search for an IDE that working in Windows, and knows these functions: A.) Automatic name searching/showing/extending on classes with keypressing (like Netbeans, or Delphi Ctrl+Space). B.) Debugging: breakpoints,

Re: boring the reader to death (wasRe: Lambda: the Ultimate DesignFlaw

2005-04-05 Thread Warren Postma
Donn Cave wrote: That's an odd thing to say. Poetry is verbose, florid? Python is Dutch. Ha. I'm vaguely dutch, whatever that means. I would say if there is a sister word for Programming in the english language, it isn't Poetry and it surely isn't Prose. It's Dialectic. I appreciate the idea of

Re: How to merge two binary files into one?

2005-04-05 Thread Grant Edwards
On 2005-04-05, Andrew Dalke [EMAIL PROTECTED] wrote: Grant Edwards wrote: For large files, something like this is probably a better idea: Or with the little-used shutil module, and keeping your nomenclature and block size of 65536 I knew I should have looked through shutil to see if there

Re: Python Google Server

2005-04-05 Thread Fuzzyman
Another change - change the line `dotloc = url.find('.') + 1` to `dotloc = url.rfind('.') + 1` This makes it find the last '.' in the url Best Regards, Fuzzy http://www.voidspace.org.uk/python -- http://mail.python.org/mailman/listinfo/python-list

Re: Change between Python 2.3 and 2.4 under WinXP

2005-04-05 Thread Thomas Heller
rbt [EMAIL PROTECTED] writes: Martin v. Löwis wrote: Of course, it is not all that clear what the OP actually wanted. For all we know, he wanted to alternate quickly (with batch file or similary) between python23 and python24... Maybe off-topic for this thread, but I noticed that when

Class, object question.

2005-04-05 Thread Jeffrey Maitland
Hello folks, The question I am having is something like this. # ignore the precursing . I am using them for easy message formatting from point import * Class vector(point): ..def __init___(self, point1, point2): ..self.i = point2.get_x() - point1.get_x() ..self.j

SSL and Proxy problem with urllib2 ?

2005-04-05 Thread Robert
using a proxy and https/SSL together I get the following SSL error : File dscore.pyo, line 2257, in UrlOpenEx File ClientCookie\_urllib2_support.pyo, line 572, in open File ClientCookie\_urllib2_support.pyo, line 472, in http_response File ClientCookie\_urllib2_support.pyo, line 589, in

Re: unittest vs py.test?

2005-04-05 Thread Michael Hudson
Roy Smith [EMAIL PROTECTED] writes: In article [EMAIL PROTECTED], [EMAIL PROTECTED] (Bengt Richter) Is there a package that is accessible without svn? That seems to be its weak point right now. Fortunately, you can get pre-built svn clients for many platforms

unknown protocol error in httplib using HTTPS

2005-04-05 Thread Robert
did you solve this problem? It seems to be still present here with py2.3.5. Robert -- From: Manish Jethani [EMAIL PROTECTED] User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.6b) Gecko/20031205 Thunderbird/0.4 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups:

Re: unittest vs py.test?

2005-04-05 Thread Michael Hudson
Peter Hansen [EMAIL PROTECTED] writes: Raymond Hettinger wrote: [Peter Hansen] This is pretty, but I *want* my tests to be contained in separate functions or methods. In py.test, those would read: def test1(): assert a == b def test2(): raises(Error, func, args)

Re: IronPython 0.7 released!

2005-04-05 Thread Thomas Gagne
Does the Python community think Microsoft's embrace is a good or bad thing? James wrote: http://www.gotdotnet.com/workspaces/workspace.aspx?id=ad7acff7-ab1e-4bcb-99c0-57ac5a3a9742 -- http://mail.python.org/mailman/listinfo/python-list

cross platform printing

2005-04-05 Thread David Isaac
Alan Isaac [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I'd like to try personal financial management using Python. I just found PyCheckbook, but it does not support check printing. Is there a Python check printing application kicking around? OK, I'll assume silence means no, so

Re: pagecrawling websites with Python

2005-04-05 Thread writeson
Swaroop, Thanks for the reply, I'll take a look at HarvestMan and see if we can use it directly, or get some ideas from the source code. :) Doug -- http://mail.python.org/mailman/listinfo/python-list

Re: change extensions

2005-04-05 Thread Peter Hansen
Bob Then wrote: how can i change all files from one extension to another within a direcory? Using Jason Orendorff's path.py module: # change all .py files in '.' to extension .new from path import path for f in path('.').files(): if f.endswith('.py'): f.rename(f.splitext()[0] + '.new')

Python MySQL

2005-04-05 Thread [EMAIL PROTECTED]
Hi all, I've got a weird problem. I was running Python 2.3 and MySQLdb and had everything running fine. Cutting to the chase: After upgrading to 2.4 (and latest modules) the MySQLdb functions in Python can connect to the database, do queries and do inserts. Or rather, it seems to do inserts.

RE: change extensions

2005-04-05 Thread Jeffrey Maitland
That approach works, but so does this one. import os, glob input_file_list = glob.glob('*.txt') for in_file in input_file_list: name = in_file.split('.') os.rename(in_file, str(name[0]) + '.' + 'text')) # I could have put the text extension with the period but if you use a variable

authentication in zope server Python

2005-04-05 Thread Raghul
Hi I am trying to execute a sample python script using zope server.The problem is I need to execute a python script in the linux machine. When I call that function through the zope server,It shows me the error regarding authentication that is 'access denied for myfunction' In my function

Re: unittest vs py.test?

2005-04-05 Thread Peter Hansen
Michael Hudson wrote: Peter Hansen [EMAIL PROTECTED] writes: Where was all that weight that unittest supposedly has? For PyPy we wanted to do some things that the designers of unittest obviously hadn't expected[1], such as formatting tracebacks differently. This was pretty tedious to do[2], I'd

Re: Change between Python 2.3 and 2.4 under WinXP

2005-04-05 Thread Brian van den Broek
rbt said unto the world upon 2005-04-05 08:39: Martin v. Löwis wrote: Of course, it is not all that clear what the OP actually wanted. For all we know, he wanted to alternate quickly (with batch file or similary) between python23 and python24... Maybe off-topic for this thread, but I noticed that

Re: change extensions

2005-04-05 Thread Bill Mill
On Apr 5, 2005 10:43 AM, Jeffrey Maitland [EMAIL PROTECTED] wrote: That approach works, but so does this one. import os, glob input_file_list = glob.glob('*.txt') for in_file in input_file_list: name = in_file.split('.') os.rename(in_file, str(name[0]) + '.' + 'text')) you

Re: Python MySQL

2005-04-05 Thread Steve Holden
[EMAIL PROTECTED] wrote: Hi all, I've got a weird problem. I was running Python 2.3 and MySQLdb and had everything running fine. Cutting to the chase: After upgrading to 2.4 (and latest modules) the MySQLdb functions in Python can connect to the database, do queries and do inserts. Or rather, it

Re: Python MySQL

2005-04-05 Thread Steve Holden
[EMAIL PROTECTED] wrote: Hi all, I've got a weird problem. I was running Python 2.3 and MySQLdb and had everything running fine. Cutting to the chase: After upgrading to 2.4 (and latest modules) the MySQLdb functions in Python can connect to the database, do queries and do inserts. Or rather, it

Re: Insert database rows from CSV file

2005-04-05 Thread 3c273
Dennis Lee Bieber [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] On Mon, 4 Apr 2005 15:54:37 -0700, 3c273 [EMAIL PROTECTED] declaimed the following in comp.lang.python: Thanks for the link, but this is the step I am trying to save (for someone else). Every time he goes to run a

Re: Insert database rows from CSV file

2005-04-05 Thread 3c273
Steve Holden [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Dennis Lee Bieber wrote: On Mon, 4 Apr 2005 15:54:37 -0700, 3c273 [EMAIL PROTECTED] declaimed the following in comp.lang.python: Thanks for the link, but this is the step I am trying to save (for someone else).

Re: check interpreter version before running script

2005-04-05 Thread djo
Josef Meile wrote: What's about: import sys print sys.version_info (2, 1, 3, 'final', 0) Python 1.5.2 (#1, Mar 3 2001, 01:35:43) [GCC 2.96 2731 (Red Hat Linux 7.1 2 on linux-i386 Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam import sys sys.version_info Traceback

Re: Python Google Server

2005-04-05 Thread vegetax
Fuzzyman wrote: Add the follwoing two lines to the start of the code : import urllib2 txheaders = { 'User-agent' : 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)' } Then change the start of the send_head method to this : def send_head(self):

Real ython Poetry [was: Re: boring the reader to death...]

2005-04-05 Thread Steve Holden
Scott David Daniels wrote: Sunnan wrote: ...Because what is boring? The opposite of dense, tense, intense. Utterly predictable; it's like the combination of all my prejudices. Even before I knew, I thought Bet Python separates statements from expressions. Python is for terse, pithy prose;

Re: Python Google Server

2005-04-05 Thread Fuzzyman
Of course - sorry. Thanks for the fix. Out of interest - why are you using this... just for curiosity, or is it helpful ? Regards, Fuzzy http://www.voidspace.org.uk/python -- http://mail.python.org/mailman/listinfo/python-list

Re: Web application toolkit recommendation?

2005-04-05 Thread PA
On Apr 05, 2005, at 02:01, Stewart Midwinter wrote: I don't want to hear anything about Zope - it's way too complex for my needs or desires. Other than that, fire away! I have an inexplicable attraction to CherryPy. Perhaps something to do with its name 8^) http://www.cherrypy.org/

Re: re module non-greedy matches broken

2005-04-05 Thread Fredrik Lundh
lothar wrote: with respect to the documentation, the module is broken. nope. the module does not necessarily deliver a minimal length match for a non-greedy pattern. it isn't supposed to: a regular expression describes a *set* of matching strings, and the engine is free to return any string

Re: Change between Python 2.3 and 2.4 under WinXP

2005-04-05 Thread Fredrik Lundh
Martin v. Löwis wrote: I'm not aware of any other tool that solves that specific problem. notepad does a fine job at creating batch files, IMO. have you used exemaker? have you compared the behaviour of the resulting executables to batch files using different environments, shells, and OS

regexp weirdness (bug?)

2005-04-05 Thread Sergey Schetinin
Here's the session log: _re_pair=(?(plus).|-) _re1=((?Pplus\+)+_re_pair) _re2=(((?Pplus\+))+_re_pair) _re3=((?:(?Pplus\+))+_re_pair) _re4=(%s)%_re3 import re print [re.match(_re, +a) and 'match' for _re in [_re1, _re2, _re3, _re4]] ['match', None, 'match', None] this is not the supposed

Re: Python Google Server

2005-04-05 Thread Paul Rubin
[EMAIL PROTECTED] writes: (This is actually an 'inventive' short term measure to get round a restrictive internet policy at work :-) If that means what I think, you're better off setting up a url-rewriting proxy server on some other machine, that uses SSL on the browser side. There's one

Re: Python MySQL

2005-04-05 Thread [EMAIL PROTECTED]
Okay, I had the brilliant idea right after posting to google the newsgroups on this. db = MySQLdb.connect(user=database_user,passwd=database_password) db.autocommit(True) --- One little line! There ya go. Works like a champ. I swear I was pulling my hair out yesterday over this. --

Re: terminating an inactive process

2005-04-05 Thread fred.dixon
if you have pywin32 then check out a download from MS download called script-o-matic2. it will write some boilerplate code that is usefull for killing processes. its wmi based but works nicely. i have a script that i run on my home computer if you want a sample. --

Re: Python Google Server

2005-04-05 Thread Fuzzyman
The difficulty is 'on some other machine'... there's a fantastic python CGI proxy called approx - http://www.voidspace.org.uk/python/cgi.shtml#approx The trouble is the current policy is 'whitelist only'... so I need the proxy installed on a server that is *on the whitelist*... which will take a

os.path query functions behavior incorrect?

2005-04-05 Thread Beman Dawes
The docs for os.path.exists(), isdir(), and the like, do not describe behavior when an I/O error occurs. Testing on Windows XP SP2 with Python 2.4.1 (#65, Mar 30 2005, 09:13:57) [MSC v.1310 32 bit (Intel)] on win32, on a machine with no a: drive, c: is a hard disk with a top level directory

Re: re module non-greedy matches broken

2005-04-05 Thread lothar
a non-greedy match - as implicitly defined in the documentation - is a match in which there is no proper substring in the return which could also match the regex. you are skirting the issue as to why a matcher should not be able to return a non-greedy match. there is no theoretical reason why it

Re: re module non-greedy matches broken

2005-04-05 Thread lothar
give an re to find every innermost table element: innertabdoc = table border=0 cellspacing=0 cellpadding=0 trtd table border=0 cellspacing=0 cellpadding=0 trtd an/a /td/tr /table /td/tr /table table border=0 cellspacing=0 cellpadding=0 trtd table border=0 cellspacing=0 cellpadding=0

Re: regexp weirdness (bug?)

2005-04-05 Thread Andr Malo
* Sergey Schetinin wrote: Here's the session log: _re_pair=(?(plus).|-) _re1=((?Pplus\+)+_re_pair) _re2=(((?Pplus\+))+_re_pair) _re3=((?:(?Pplus\+))+_re_pair) _re4=(%s)%_re3 import re print [re.match(_re, +a) and 'match' for _re in [_re1, _re2, _re3, _re4]] ['match', None, 'match',

Re: re module non-greedy matches broken

2005-04-05 Thread lothar
a non-greedy match is implicitly defined in the documentation to be one such that there is no proper substring in the return which could also match the regex. the documentation implies the module will return a non-greedy match. the module does not return a non-greedy match. Fredrik Lundh

  1   2   >