adodb with mysql - connection string syntax for filepath

2007-09-16 Thread Mridula Ramesh
Dear all, Hi. I am not very tech-savvy so please pardon me if this is a stupid question: so far I have been googling for about 4 days to find help for this, so now I am desperate! :) How do you use adodb with mysql to connect to a file that is on your machine? Also, could you please recommend to

Re: Try this

2007-09-16 Thread Neil Hodgson
GeorgeRXZ: > Then Open the Notepad and type the following sentence, and save the > file and close the notepad. Now reopen the file and you will find out > that, Notepad is not able to save the following text line. This is a known issue with Notepad. See the "Unicode detection" section of htt

Re: Tkinter pack difficulty

2007-09-16 Thread Simon Forman
Thanks everyone for the incredibly helpful replies! I got the effect I wanted, no problem. I don't know why I didn't think to remove the expand option. I thought the sticky option would constrain the expansion. Thanks again, ~Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: Can't see the arguements when use Python in WSH.

2007-09-16 Thread GaryLee
On 9 16 , 9 09 , Duncan Booth <[EMAIL PROTECTED]> wrote: > GaryLee <[EMAIL PROTECTED]> wrote: > > Does anyone have the same situation? Is it my pywin32 package > > corrupted? I've downloaded the last pywin32 package and executed the > > site-packages\win32comext\axscript\client\pyscript.py to reg

Re: Coming from Perl

2007-09-16 Thread Bryan Olson
Amer Neely wrote: > I don't have shell access but I can run 'which python' from a Perl > script, and I will try the different shebang line you suggested. And after trying it, Amer Neely reported: > I tried `which python` and `whereis python` and got 0 back as a result. > So it seems Python is n

Re: Try this

2007-09-16 Thread [EMAIL PROTECTED]
On Sep 16, 9:27?pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Sun, 16 Sep 2007 21:58:09 -0300, [EMAIL PROTECTED] > <[EMAIL PROTECTED]> escribi : > > >> I'm eagerly awaiting publication of your professional specification > >> for correctly detecting the encoding of an arbitrary stream of

Re: Try this

2007-09-16 Thread [EMAIL PROTECTED]
On Sep 16, 8:59?pm, "J. Cliff Dyer" <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > The very presence of an algorithm to detect encoding is a bug. > > Files with they .txt extension should always be treated as ANSI > > even if they contain binary data. Notepad should never be > > allowed

Re: Python statements not forcing whitespace is messy?

2007-09-16 Thread James Stroud
Peter Decker wrote: > On 9/15/07, Steve Holden <[EMAIL PROTECTED]> wrote: >> John Machin wrote: >>> On 16/09/2007 8:11 AM, James Stroud wrote: Steve Holden wrote: > I don't know why you have a bug up your ass about it, as the > Americans say. I think most Americans say "wild hare

Re: A short question about non-ascii characters in list

2007-09-16 Thread Dan Bishop
On Sep 17, 12:08 am, js <[EMAIL PROTECTED]> wrote: > >>> print u"äöü" > äöü > >>> print [u"äöü"] > > [u'\xe4\xf6\xfc'] > > Python seems to treat non-ASCII chars in a list differently from the > one in the outside of a list. > I think this behavior is so inconvenient and actually makes debugging > w

A short question about non-ascii characters in list

2007-09-16 Thread js
>>> print u"äöü" äöü >>> print [u"äöü"] [u'\xe4\xf6\xfc'] Python seems to treat non-ASCII chars in a list differently from the one in the outside of a list. I think this behavior is so inconvenient and actually makes debugging work harder. Is this an intentional? Is there any doc discussing about

Re: Needless copying in iterations?

2007-09-16 Thread BJörn Lindqvist
On 9/16/07, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > Maybe I'm being unfair, but it seems to me that the attitude is similar: > 'there's no point optimizing the common case of printing (say) ints > stored in a list, Just In Case the programmer wants the incredibly rare > case of setting sys.std

Re: Python Unicode to String conversion

2007-09-16 Thread Richard Levasseur
> On 1 sep, 09:17, iapain <[EMAIL PROTECTED]> wrote: > > > First make sure your DB encoding is UTF-8 not the latin1 > It took me days to figure out what was going on when dealing with unicode, ascii, latin1, utf8, decodeerrors, etc, so I'm just chiming in to echo something similar iapain's comment

Re: curses: x, y positioning

2007-09-16 Thread Tim Roberts
7stud <[EMAIL PROTECTED]> wrote: >I can't see to get any y, x coordinates to work with curses. Here is >an example: > >import curses > >def my_program(screen): >while True: >ch = screen.getch() >if ch == ord("q"): >break >if ch <= 255: >screen.a

Re: Try this

2007-09-16 Thread Gabriel Genellina
En Sun, 16 Sep 2007 21:58:09 -0300, [EMAIL PROTECTED] <[EMAIL PROTECTED]> escribi�: >> I'm eagerly awaiting publication of your professional specification >> for correctly detecting the encoding of an arbitrary stream of >> bytes > > The very presence of an algorithm to detect encoding is a bug.

Re: Try this

2007-09-16 Thread J. Cliff Dyer
[EMAIL PROTECTED] wrote: > The very presence of an algorithm to detect encoding is a bug. > Files with they .txt extension should always be treated as ANSI > even if they contain binary data. Notepad should never be > allowed to try to decide what the encoding is if the the open > dialog has the en

Re: where are the .pyc files?

2007-09-16 Thread Steve Holden
Summercool wrote: > On Sep 16, 10:36 am, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: >> The `*.pyc` files are usually only created when you import a module, not >> when a module is run directly. > > how come a program that runs directly doesn't need to be optimized > into bytecode first?

Re: where are the .pyc files?

2007-09-16 Thread Summercool
On Sep 16, 10:36 am, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > > The `*.pyc` files are usually only created when you import a module, not > when a module is run directly. how come a program that runs directly doesn't need to be optimized into bytecode first? Or... is it that the inter

Re: adding a static class to another class

2007-09-16 Thread James Stroud
Nathan Harmston wrote: > And also preventing more than one Manager instance instantiated at one > time. Forgot to answer this. You want the singleton pattern: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52558 James -- http://mail.python.org/mailman/listinfo/python-list

Re: adding a static class to another class

2007-09-16 Thread James Stroud
Nathan Harmston wrote: > HI, > > I m trying to start an api in a similar way to the djangic way of > Class.objects.all(). Ie objects is a "Manager" class. > > So: > > class Foo(object): >def __init__(self): > self.test = "NEE" > > class Manager(object): > def __init__(self): >

Re: Try this

2007-09-16 Thread [EMAIL PROTECTED]
On Sep 16, 6:21?pm, John Machin <[EMAIL PROTECTED]> wrote: > On Sep 17, 8:53 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > > > > > > > On Sep 16, 5:28?pm, John Machin <[EMAIL PROTECTED]> wrote: > > > > On Sep 17, 7:54 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > > > > > On Sep 16, 2:

Re: Python "with"

2007-09-16 Thread Dustan
On Sep 16, 3:07 pm, Ivan Voras <[EMAIL PROTECTED]> wrote: > Hi, > > I'm looking for a construct that's similar to (Turbo) Pascal's "with" > statement. I read about the Python's new "with" statement, but I was > dissapointed to learn that it does something different (I still don't > see how it's bet

Re: Python "with"

2007-09-16 Thread Ben Finney
Ivan Voras <[EMAIL PROTECTED]> writes: > I know it can be almost always done by using a temporary variable: > > tmp = some.big.structure.or.nested.objects.element > tmp.member1 = something > tmp.member2 = something > > but this looks ugly to me.) To me, it looks explicit. Python programmers val

CherryPy support (was: The path '/' was not found.)

2007-09-16 Thread Ben Finney
PFGCIO <[EMAIL PROTECTED]> writes: > I've checked for space/tab problems twice. Any ideas? For CherryPy support, you might want to instead try the mailing lists for that project: http://www.cherrypy.org/wiki/CherryPyInvolved#Howtocontactus> -- \ "Professionalism has no place in

Re: Try this

2007-09-16 Thread [EMAIL PROTECTED]
On Sep 16, 6:25?pm, Steve Holden <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > On Sep 16, 5:28?pm, John Machin <[EMAIL PROTECTED]> wrote: > >> On Sep 17, 7:54 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > > >>> On Sep 16, 2:22?pm, Steve Holden <[EMAIL PROTECTED]> wrote: > [E

Re: Needless copying in iterations?

2007-09-16 Thread Ben Finney
Steven D'Aprano <[EMAIL PROTECTED]> writes: > On Sun, 16 Sep 2007 15:05:55 +1000, Ben Finney wrote: > > The compiler for a dynamic language like Python has very little > > absolute "no significant side-effect in these specific cases" > > guarantee of the kind you're assuming even in the cases you

Re: adding a static class to another class

2007-09-16 Thread thebjorn
On Sep 17, 1:14 am, "Nathan Harmston" <[EMAIL PROTECTED]> wrote: > HI, > > I m trying to start an api in a similar way to the djangic way of > Class.objects.all(). Ie objects is a "Manager" class. > > So: > > class Foo(object): >def __init__(self): > self.test = "NEE" > > class Manager(

Re: Try this

2007-09-16 Thread Steve Holden
[EMAIL PROTECTED] wrote: > On Sep 16, 5:28?pm, John Machin <[EMAIL PROTECTED]> wrote: >> On Sep 17, 7:54 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: >> >> >> >> >> >>> On Sep 16, 2:22?pm, Steve Holden <[EMAIL PROTECTED]> wrote: [EMAIL PROTECTED] wrote: > On Sep 16, 1:10?pm, Dennis L

Re: Try this

2007-09-16 Thread John Machin
On Sep 17, 8:53 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > On Sep 16, 5:28?pm, John Machin <[EMAIL PROTECTED]> wrote: > > > > > On Sep 17, 7:54 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > > > > On Sep 16, 2:22?pm, Steve Holden <[EMAIL PROTECTED]> wrote: > > > > > [EMAIL PROTECTED

Re: Needless copying in iterations?

2007-09-16 Thread Steve Holden
Steven D'Aprano wrote: > On Sun, 16 Sep 2007 11:49:15 -0400, Steve Holden wrote: > >>> It seems to me that the "consenting adults" philosophy of Python >>> doesn't extend to the compiler, and perhaps it should. Maybe Python >>> could optimize common cases, and if developers wanted to do wacky >>>

adding a static class to another class

2007-09-16 Thread Nathan Harmston
HI, I m trying to start an api in a similar way to the djangic way of Class.objects.all(). Ie objects is a "Manager" class. So: class Foo(object): def __init__(self): self.test = "NEE" class Manager(object): def __init__(self): pass def all(self): return "COCONU

Re: Free Python Ebook

2007-09-16 Thread Nathan Harmston
Theres a few python ebooks listed on the wiki http://wiki.python.org/moin/PythonBooks Hope this helps, Nathan On 16/09/2007, Marco <[EMAIL PROTECTED]> wrote: > Hi George, > > > Please tell me from which website I will get the free Python Ebook. > which one do you mean? > > I o

Re: Try this

2007-09-16 Thread [EMAIL PROTECTED]
On Sep 16, 5:28?pm, John Machin <[EMAIL PROTECTED]> wrote: > On Sep 17, 7:54 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > > > > > > > On Sep 16, 2:22?pm, Steve Holden <[EMAIL PROTECTED]> wrote: > > > > [EMAIL PROTECTED] wrote: > > > > On Sep 16, 1:10?pm, Dennis Lee Bieber <[EMAIL PROTECTED]

Re: Needless copying in iterations?

2007-09-16 Thread Steven D'Aprano
On Sun, 16 Sep 2007 11:49:15 -0400, Steve Holden wrote: >> It seems to me that the "consenting adults" philosophy of Python >> doesn't extend to the compiler, and perhaps it should. Maybe Python >> could optimize common cases, and if developers wanted to do wacky >> things, let them turn optimizat

Re: Processing drag & drop on the desktop

2007-09-16 Thread Steve Holden
Thomas Jollans wrote: > On Sunday 16 September 2007, Pierre Quentel wrote: >> Hi all, >> >> I would like to create an application on a Windows machine, such that >> when a document is dragged and dropped on the application icon on the >> desktop, the document is processed by the application >> >> F

Re: how to join array of integers?

2007-09-16 Thread Steven D'Aprano
On Sun, 16 Sep 2007 19:25:22 +0100, Paul Rudin wrote: >> The generator expression takes about twice as long to run, and in my >> opinion it is no more readable. So what's the advantage? > > If you do it with a decent size list they take more or less the same > time. Did you try it, or are you g

Re: Needless copying in iterations?

2007-09-16 Thread Steven D'Aprano
On Sun, 16 Sep 2007 09:12:56 -0700, Paul Rubin wrote: > Steven D'Aprano <[EMAIL PROTECTED]> writes: >> > What do you mean by Haskell is a dynamic language? It is statically >> > and strict typed and the compiler usually knows all the functions. >> > No "surprises", no side effects, no duck typin

ANNOUNCE: pprocess 0.3

2007-09-16 Thread Paul Boddie
Announcing the release of pprocess 0.3 (previously known as parallel/ pprocess), available from... http://www.python.org/pypi/pprocess/0.3 Note that only POSIX-like platforms are supported in this release, although improvements in portability and all other areas are welcome. What is it?

Re: Try this

2007-09-16 Thread John Machin
On Sep 17, 7:54 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > On Sep 16, 2:22?pm, Steve Holden <[EMAIL PROTECTED]> wrote: > > > > > [EMAIL PROTECTED] wrote: > > > On Sep 16, 1:10?pm, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > > >> On Sun, 16 Sep 2007 01:46:34 -0700, GeorgeRXZ <[EMAIL PRO

Re: Parsing problems: A journey from a text file to a directory tree

2007-09-16 Thread Neil Cerutti
On 2007-09-16, Martin M. <[EMAIL PROTECTED]> wrote: > Hi everybody, > > Some of my colleagues want me to write a script for easy folder and > subfolder creation on the Mac. > > The script is supposed to scan a text file containing directory trees > in the following format: > > [New client] >|-Invoi

Re: Try this

2007-09-16 Thread [EMAIL PROTECTED]
On Sep 16, 2:22?pm, Steve Holden <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > On Sep 16, 1:10?pm, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > >> On Sun, 16 Sep 2007 01:46:34 -0700, GeorgeRXZ <[EMAIL PROTECTED]> > >> declaimed the following in comp.lang.python: > > >>> Then Open the

Re: Python "with"

2007-09-16 Thread Bjoern Schliessmann
Ivan Voras wrote: > I'm looking for a construct that's similar to (Turbo) Pascal's > "with" statement. Please have a look at the archives -- this is discussed here from time to time. I think last time it was a Visual BASIC fan that asked a similar question. > I know it can be almost always done

Re: Saving parameters between Python applications?

2007-09-16 Thread Sebastian Bassi
On 9/16/07, Stodge <[EMAIL PROTECTED]> wrote: > python app1.py --location=c:\test1 > What I want to do is save the location parameter, so I can then do (in > the same window): > python app2.py > And have app2.py automatically have access to the value of "location". Do app1.py to save a pickle of t

Re: Python "with"

2007-09-16 Thread J. Cliff Dyer
Ivan Voras wrote: > Hi, > > I'm looking for a construct that's similar to (Turbo) Pascal's "with" > statement. I read about the Python's new "with" statement, but I was > dissapointed to learn that it does something different (I still don't > see how it's better than try..except..finally, but that'

Re: Try this

2007-09-16 Thread John Machin
On Sep 16, 6:46 pm, GeorgeRXZ <[EMAIL PROTECTED]> wrote: > If you have Microsoft windows 98/2000/ME/XP/2003 Operating System on > your PC. > Then Open the Notepad and type the following sentence, and save the > file and close the notepad. Now reopen the file and you will find out > that, Notepad is

Python "with"

2007-09-16 Thread Ivan Voras
Hi, I'm looking for a construct that's similar to (Turbo) Pascal's "with" statement. I read about the Python's new "with" statement, but I was dissapointed to learn that it does something different (I still don't see how it's better than try..except..finally, but that's not my question). Is there

The path '/' was not found.

2007-09-16 Thread PFGCIO
I've checked for space/tab problems twice. Any ideas? Thanks ahead of time. 404 Not Found The path '/' was not found. Page handler: "The path '/' was not found." Traceback (most recent call last): File "c:\python25\lib\site-packages\cherrypy-2.2.1-py2.5.egg\cherrypy \_cphttptools.py", line 10

Re: Python 3K or Python 2.9?

2007-09-16 Thread Bruno Desthuilliers
Erik Jones a écrit : > On Sep 14, 2007, at 11:54 PM, David Trudgett wrote: > >> TheFlyingDutchman <[EMAIL PROTECTED]> writes: >> (snip) >> >> Several languages use the "object.method(args)" form, which is syntactic >> sugar for "method(object, other_args)" which Ada, for instance, uses. >> Knowi

Re: Processing drag & drop on the desktop

2007-09-16 Thread Thomas Jollans
On Sunday 16 September 2007, Pierre Quentel wrote: > Hi all, > > I would like to create an application on a Windows machine, such that > when a document is dragged and dropped on the application icon on the > desktop, the document is processed by the application > > For instance, if I drag & drop a

Re: Try this

2007-09-16 Thread Steve Holden
[EMAIL PROTECTED] wrote: > On Sep 16, 1:10?pm, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: >> On Sun, 16 Sep 2007 01:46:34 -0700, GeorgeRXZ <[EMAIL PROTECTED]> >> declaimed the following in comp.lang.python: >> >>> Then Open the Notepad and type the following sentence, and save the >>> file and cl

Re: how to join array of integers?

2007-09-16 Thread Alex Martelli
Paul Rudin <[EMAIL PROTECTED]> wrote: ... > Isn't it odd that the generator isn't faster, since the comprehension > presumably builds a list first and then iterates over it, whereas the > generator doesn't need to make a list? The generator doesn't, but the implementation of join then does (alm

Re: Python 3K or Python 2.9?

2007-09-16 Thread Bruno Desthuilliers
John Roth a écrit : > On Sep 12, 11:35 am, TheFlyingDutchman <[EMAIL PROTECTED]> wrote: > >>On Sep 12, 4:40 am, Bjoern Schliessmann <[EMAIL PROTECTED]> wrote: >> >>>Ivan Voras wrote: >>> What does "self" have to do with an object model? It's an function/method argument that might as well b

Re: Probstat Combination Objects and Persistence

2007-09-16 Thread Sidd
On Sep 16, 8:01 am, dohertywa <[EMAIL PROTECTED]> wrote: > Hi: > > I'm working with probstat module which does an excellent job for the > project I'm working on. > > I am passing the Combination objects I generate to generator functions > that allow me to scale down the results. > > I am trying to

Saving parameters between Python applications?

2007-09-16 Thread Stodge
I'm trying to do the following. I have a Python application that is run: python app1.py --location=c:\test1 What I want to do is save the location parameter, so I can then do (in the same window): python app2.py And have app2.py automatically have access to the value of "location". Now, the di

Re: Try this

2007-09-16 Thread [EMAIL PROTECTED]
On Sep 16, 1:10?pm, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > On Sun, 16 Sep 2007 01:46:34 -0700, GeorgeRXZ <[EMAIL PROTECTED]> > declaimed the following in comp.lang.python: > > > Then Open the Notepad and type the following sentence, and save the > > file and close the notepad. Now reopen th

Re: (curses) issue about inch()

2007-09-16 Thread Jimmy
On Sep 17, 2:25 am, Steve Holden <[EMAIL PROTECTED]> wrote: > Jimmy wrote: > > On Sep 17, 12:07 am, Steve Holden <[EMAIL PROTECTED]> wrote: > >> Jimmy wrote: > >>> hi, all > >>> I attempt to use the function inch() to get the character at the > >>> current position, and compare it with a particular

Re: how to join array of integers?

2007-09-16 Thread Paul Rudin
Steven D'Aprano <[EMAIL PROTECTED]> writes: > On Sat, 15 Sep 2007 15:56:40 +0200, Arnau Sanchez wrote: > >> js escribió: >> On 9/15/07, Summercool <[EMAIL PROTECTED]> wrote: >> in Python... is the method to use ",".join() ? but then it must take a list of strings... not integers

best site for hacking tricks , computer tweaks

2007-09-16 Thread [EMAIL PROTECTED]
check this out buddies... a kool site for anti hacking and hacking tips and tricks , computer tweaks to enhance ur pc,small virus creation ,etc it's the best site ... www.realm-of-tricks.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Re: (curses) issue about inch()

2007-09-16 Thread Steve Holden
Jimmy wrote: > On Sep 17, 12:07 am, Steve Holden <[EMAIL PROTECTED]> wrote: >> Jimmy wrote: >>> hi, all >>> I attempt to use the function inch() to get the character at the >>> current position, and compare it with a particular character like : >>> if screen.inch(x,y) == 'F' >>> but this method doe

Re: SVG to raster conversion.

2007-09-16 Thread J. Cliff Dyer
Stefan Behnel wrote: > J. Cliff Dyer wrote: > >> Does anybody know a good solution (preferably in python) for rasterizing >> SVG or other vector graphics. >> >> I'm thinking something like >> >> vector_image = SVGFile(path_to_image) >> raster_image = vector_image.rasterize(format, (width, height

Re: where are the .pyc files?

2007-09-16 Thread Marc 'BlackJack' Rintsch
On Sun, 16 Sep 2007 17:28:30 +, Summercool wrote: > so i have always heard of the .pyc files but for some reason i > don't see them on the Windows platform... when i have a program > called try.py and after running it for ages, i still don't have a > try.pyc file in my folder even if i

Re: where are the .pyc files?

2007-09-16 Thread Dustan
On Sep 16, 12:28 pm, Summercool <[EMAIL PROTECTED]> wrote: > so i have always heard of the .pyc files but for some reason i > don't see them on the Windows platform... when i have a program > called try.py and after running it for ages, i still don't have a > try.pyc file in my folder even

where are the .pyc files?

2007-09-16 Thread Summercool
so i have always heard of the .pyc files but for some reason i don't see them on the Windows platform... when i have a program called try.py and after running it for ages, i still don't have a try.pyc file in my folder even if i turn the "show hidden file" to on. -- http://mail.python.org

Re: SVG to raster conversion.

2007-09-16 Thread Phil Thompson
On Sunday 16 September 2007, J. Cliff Dyer wrote: > Does anybody know a good solution (preferably in python) for rasterizing > SVG or other vector graphics. > > I'm thinking something like > > vector_image = SVGFile(path_to_image) > raster_image = vector_image.rasterize(format, (width, height), dpi

Re: Coming from Perl

2007-09-16 Thread Amer Neely
Paddy wrote: > On Sep 13, 1:30 am, Amer Neely <[EMAIL PROTECTED]> wrote: >> I'm a complete newbie with Python, but have several years experience >> with Perl in a web environment. >> >> A question I have, if someone here is familiar with Perl, does Python >> have something like Perl's 'here documen

Re: Python Database Apps

2007-09-16 Thread Prateek
On Sep 14, 1:00 am, Jonathan Gardner <[EMAIL PROTECTED]> wrote: > On Sep 12, 9:38 pm, Prateek <[EMAIL PROTECTED]> wrote: > > > Have you checked out Brainwave?http://www.brainwavelive.com > > > We provide a schema-free non-relational database bundled with an app > > server which is basically CherryP

Re: Python Unicode to String conversion

2007-09-16 Thread thijs . braem
Sorry for answering so late. Thanks a million! This code snippet helped me solve the problem. I think I will be using SQLAlchemy for these sorts of things from now on though, it seems to be taking care of these things itself, on top of being one hell of a handy ORM of course :) thijs On 1 sep, 0

Re: Try this

2007-09-16 Thread Dustan
On Sep 16, 3:46 am, GeorgeRXZ <[EMAIL PROTECTED]> wrote: > If you have Microsoft windows 98/2000/ME/XP/2003 Operating System on > your PC. > Then Open the Notepad and type the following sentence, and save the > file and close the notepad. Now reopen the file and you will find out > that, Notepad is

Re: SVG to raster conversion.

2007-09-16 Thread Stefan Behnel
J. Cliff Dyer wrote: > Does anybody know a good solution (preferably in python) for rasterizing > SVG or other vector graphics. > > I'm thinking something like > > vector_image = SVGFile(path_to_image) > raster_image = vector_image.rasterize(format, (width, height), dpi) > raster_image.write(out_

Processing drag & drop on the desktop

2007-09-16 Thread Pierre Quentel
Hi all, I would like to create an application on a Windows machine, such that when a document is dragged and dropped on the application icon on the desktop, the document is processed by the application For instance, if I drag & drop an Outlook message or a PPT presentation, the application would

Re: (curses) issue about inch()

2007-09-16 Thread Jimmy
On Sep 17, 12:07 am, Steve Holden <[EMAIL PROTECTED]> wrote: > Jimmy wrote: > > hi, all > > I attempt to use the function inch() to get the character at the > > current position, and compare it with a particular character like : > > if screen.inch(x,y) == 'F' > > but this method doesn't seem work,

Re: We need PIGs :)

2007-09-16 Thread Marc 'BlackJack' Rintsch
On Sun, 16 Sep 2007 10:17:18 -0400, Colin J. Williams wrote: > Marc 'BlackJack' Rintsch wrote: > >> `getFoo()` is discouraged by PEP 8. […] > > Perhaps PEP 8 needs rethinking. I prefer getFoo(). Yeah, *your* preference is a very good reason to rethink PEP 8… ;-) Ciao, Marc 'BlackJack'

Re: generate list of partially accumulated values

2007-09-16 Thread Paul Rubin
cesco <[EMAIL PROTECTED]> writes: > I have the following list: > l = [1, 2, 3, 4] > and I'd like to obtain a list like the following: > l_partial_sum = [1, 3, 6, 10] (that is [1, 1+2, 1+2+3, 1+2+3+4]) > > Is there a simple way to accomplish this? I won't show explicit code since you are apparentl

Re: generate list of partially accumulated values

2007-09-16 Thread Vadim Radionov
cesco пишет: > Hi, > > I have the following list: > l = [1, 2, 3, 4] > and I'd like to obtain a list like the following: > l_partial_sum = [1, 3, 6, 10] (that is [1, 1+2, 1+2+3, 1+2+3+4]) >>> def iscan(f, seq, acc=0): ... for i in seq: ...acc = f(acc,i) ...yield acc ... >>>

Re: Needless copying in iterations?

2007-09-16 Thread Paul Rubin
Steven D'Aprano <[EMAIL PROTECTED]> writes: > > What do you mean by Haskell is a dynamic language? It is statically and > > strict typed and the compiler usually knows all the functions. No > > "surprises", no side effects, no duck typing. > > Haskell's IO monad (and possibly the do monad?) allo

Re: (curses) issue about inch()

2007-09-16 Thread Steve Holden
Jimmy wrote: > hi, all > I attempt to use the function inch() to get the character at the > current position, and compare it with a particular character like : > if screen.inch(x,y) == 'F' > but this method doesn't seem work, can anyone tell me the reason and > how to corrent it > thanks > The rea

Re: Cannot formulate regex

2007-09-16 Thread Dotan Cohen
On 16/09/2007, Roel Schroeven <[EMAIL PROTECTED]> wrote: > FYI Kodos (http://kodos.sourceforge.net/) can be very useful for > developing, testing and debugging such regexes. Thanks, it's even in the Ubuntu repos. > If I have been able to see further, it was only because I stood > on the shoulders

Re: Cannot formulate regex

2007-09-16 Thread Dotan Cohen
On 16/09/2007, Paul McGuire <[EMAIL PROTECTED]> wrote: > On Sep 16, 10:18 am, "Dotan Cohen" <[EMAIL PROTECTED]> wrote: > > I'd like to filter spam from a certain company. Here are examples of > > strings found in their spam: > > Mega Dik > > Mega D1k > > MegaDik > > Mega. Dik > > M eg ad ik > > M E

Re: generating list of sub lists

2007-09-16 Thread Steve Holden
Rustom Mody wrote: > On 9/16/07, cesco <[EMAIL PROTECTED]> wrote: >> Hi, >> >> is there a one-liner to accomplish the following task? >> >From the list >> l = ['string1', 'string2', 'string3'] >> generate the list of lists >> l = [['string1'], ['string1', 'string2'], ['string1', 'string2', >> 'stri

SVG to raster conversion.

2007-09-16 Thread J. Cliff Dyer
Does anybody know a good solution (preferably in python) for rasterizing SVG or other vector graphics. I'm thinking something like vector_image = SVGFile(path_to_image) raster_image = vector_image.rasterize(format, (width, height), dpi) raster_image.write(out_file) Thanks for any pointers you mi

Parsing problems: A journey from a text file to a directory tree

2007-09-16 Thread Martin M.
Hi everybody, Some of my colleagues want me to write a script for easy folder and subfolder creation on the Mac. The script is supposed to scan a text file containing directory trees in the following format: [New client] |-Invoices |-Offers |--Denied |--Accepted |-Delivery notes As you can see,

Re: Needless copying in iterations?

2007-09-16 Thread Steve Holden
Steven D'Aprano wrote: > On Sun, 16 Sep 2007 15:05:55 +1000, Ben Finney wrote: > >> Steven D'Aprano <[EMAIL PROTECTED]> writes: >> >>> In *general* the compiler can't tell, but in specific cases it could. A >>> (hypothetical) optimizing compiler would tell the difference between: >>> >>> for item

Re: Cannot formulate regex

2007-09-16 Thread Roel Schroeven
Dotan Cohen schreef: > I'd like to filter spam from a certain company. Here are examples of > strings found in their spam: > Mega Dik > Mega D1k > MegaDik > Mega. Dik > M eg ad ik > M E _G_A_D_ IK > M_E_G. ADI. K > > I figured that this regex would match all but the second example, yet > it matche

Re: Needless copying in iterations?

2007-09-16 Thread Steve Holden
Steven D'Aprano wrote: > On Sun, 16 Sep 2007 15:05:55 +1000, Ben Finney wrote: > >> Steven D'Aprano <[EMAIL PROTECTED]> writes: >> >>> In *general* the compiler can't tell, but in specific cases it could. A >>> (hypothetical) optimizing compiler would tell the difference between: >>> >>> for item

Re: Cannot formulate regex

2007-09-16 Thread Paul McGuire
On Sep 16, 10:18 am, "Dotan Cohen" <[EMAIL PROTECTED]> wrote: > I'd like to filter spam from a certain company. Here are examples of > strings found in their spam: > Mega Dik > Mega D1k > MegaDik > Mega. Dik > M eg ad ik > M E _G_A_D_ IK > M_E_G. ADI. K > > I figured that this regex would match all

Re: Cannot formulate regex

2007-09-16 Thread Paul McGuire
On Sep 16, 10:18 am, "Dotan Cohen" <[EMAIL PROTECTED]> wrote: > I'd like to filter spam from a certain company. Here are examples of > strings found in their spam: > Mega Dik > Mega D1k > MegaDik > Mega. Dik > M eg ad ik > M E _G_A_D_ IK > M_E_G. ADI. K > > I figured that this regex would match all

Cannot formulate regex

2007-09-16 Thread Dotan Cohen
I'd like to filter spam from a certain company. Here are examples of strings found in their spam: Mega Dik Mega D1k MegaDik Mega. Dik M eg ad ik M E _G_A_D_ IK M_E_G. ADI. K I figured that this regex would match all but the second example, yet it matches none: |[^a-z]m[^a-z]e[^a-z]g[^a-z]a[^a-z]d[

(curses) issue about inch()

2007-09-16 Thread Jimmy
hi, all I attempt to use the function inch() to get the character at the current position, and compare it with a particular character like : if screen.inch(x,y) == 'F' but this method doesn't seem work, can anyone tell me the reason and how to corrent it thanks -- http://mail.python.org/mailman/l

Probstat Combination Objects and Persistence

2007-09-16 Thread dohertywa
Hi: I'm working with probstat module which does an excellent job for the project I'm working on. I am passing the Combination objects I generate to generator functions that allow me to scale down the results. I am trying to find a way however to store the end resultant Combination object. Try t

Re: Needless copying in iterations?

2007-09-16 Thread Marc 'BlackJack' Rintsch
On Sun, 16 Sep 2007 13:31:57 +, Steven D'Aprano wrote: > On Sun, 16 Sep 2007 10:58:07 +, Marc 'BlackJack' Rintsch wrote: > >> On Sun, 16 Sep 2007 09:50:39 +, Steven D'Aprano wrote: >> >>> The point is rather moot, since CPython (and probably other Pythons) do >>> almost no optimizati

Re: We need PIGs :)

2007-09-16 Thread Daniel Larsson
On 9/16/07, Colin J. Williams <[EMAIL PROTECTED]> wrote: > > Marc 'BlackJack' Rintsch wrote: > > On Thu, 06 Sep 2007 09:00:02 +0200, Stefan Arentz wrote: > > > >> What I find really frustrating in Python (combined with usually bad > >> documentation) is that many people have different styles. The m

Re: We need PIGs :)

2007-09-16 Thread Colin J. Williams
Marc 'BlackJack' Rintsch wrote: > On Thu, 06 Sep 2007 09:00:02 +0200, Stefan Arentz wrote: > >> What I find really frustrating in Python (combined with usually bad >> documentation) is that many people have different styles. The most >> frustratinng being getFoo() vs .foo, vs get_foo(). > > `getF

Re: generate list of partially accumulated values

2007-09-16 Thread Steven D'Aprano
On Sun, 16 Sep 2007 04:18:30 -0700, marek.rocki wrote: > Those methods of computing partial sums seem to be O(n^2) or worse. > What's wrong with an ordinary loop? Haven't you heard? There's a global shortage of newlines, and programmers have been asked to do their bit to conserve them. -- Ste

Re: Needless copying in iterations?

2007-09-16 Thread Steven D'Aprano
On Sun, 16 Sep 2007 10:58:07 +, Marc 'BlackJack' Rintsch wrote: > On Sun, 16 Sep 2007 09:50:39 +, Steven D'Aprano wrote: > >> The point is rather moot, since CPython (and probably other Pythons) do >> almost no optimizations. But just because Python is a dynamic language >> doesn't mean t

Re: Can't see the arguements when use Python in WSH.

2007-09-16 Thread Duncan Booth
GaryLee <[EMAIL PROTECTED]> wrote: > Does anyone have the same situation? Is it my pywin32 package > corrupted? I've downloaded the last pywin32 package and executed the > site-packages\win32comext\axscript\client\pyscript.py to register the > PyScript. But, the problem is still there. > I've no

Re: generate list of partially accumulated values

2007-09-16 Thread Steven D'Aprano
On Sun, 16 Sep 2007 09:56:04 +, cesco wrote: > Hi, > > I have the following list: > l = [1, 2, 3, 4] > and I'd like to obtain a list like the following: > l_partial_sum = [1, 3, 6, 10] > (that is [1, 1+2, 1+2+3, 1+2+3+4]) > > Is there a simple way to accomplish this? Yes, use a loop. Put

Re: generate list of partially accumulated values

2007-09-16 Thread Steven D'Aprano
On Sun, 16 Sep 2007 10:21:59 +, cesco wrote: > The list is composed of objects: > l = [obj1, obj2, obj3, obj4] > and I need to call a method (say method1) on each object as follow: l1 = > [obj1.method1(obj2), obj2.method1(obj3), obj3.method1(obj4), obj4] > > Is there a clean way of doing this

Re: generate list of partially accumulated values

2007-09-16 Thread J. Cliff Dyer
ZeD wrote: > cesco wrote: > > >> The list is composed of objects: >> l = [obj1, obj2, obj3, obj4] >> and I need to call a method (say method1) on each object as follow: >> l1 = [obj1.method1(obj2), obj2.method1(obj3), obj3.method1(obj4), >> obj4] >> > > to me it sounds a bit different from

Re: Python statements not forcing whitespace is messy?

2007-09-16 Thread Peter Decker
On 9/15/07, Steve Holden <[EMAIL PROTECTED]> wrote: > John Machin wrote: > > On 16/09/2007 8:11 AM, James Stroud wrote: > >> Steve Holden wrote: > >>> I don't know why you have a bug up your ass about it, as the > >>> Americans say. > >> I think most Americans say "wild hare up your ass". > > > I

Can't see the arguements when use Python in WSH.

2007-09-16 Thread GaryLee
Hi, Folks: I am using Python in WSH. However, I got a strange problem on my computer. Here is a small program to show the problem. # xxx.pys objArgs = WScript.Arguments for i in xrange(objArgs.Count()): WScript.Echo(objArgs(i)) WScript.Echo('Total %d arguments.' % objArgs.Count()) If I execu

Re: Python statements not forcing whitespace is messy?

2007-09-16 Thread Dustan
On Sep 15, 5:11 pm, James Stroud <[EMAIL PROTECTED]> wrote: > Steve Holden wrote: > > I don't know why you have a bug up your ass about it, as the > > Americans say. > > I think most Americans say "wild hare up your ass". We do not, in fact, > say "wild hair up your ass". Many of us can testify tha

  1   2   >