generating list of sub lists

2007-09-16 Thread cesco
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', 'string3']] Any help would be appreciated. Thanks Francesco -- http://mail.python.org/mail

(wxPython) icon on panel

2007-09-16 Thread Jimmy
hi,all! have you used 'dictionary' of linux, the program that rests on the panel as an icon, and when you click on the icon, it will display a window and do something. So i'm wondering how to achieve this. I guess it's a dialog window, right? but the crucial part is how to minimize the program to a

Try this

2007-09-16 Thread GeorgeRXZ
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 not able to save the following text line. Well you are speed Thi

Re: (wxPython) wx.ProgressDialog - how to cancel out of?

2007-09-16 Thread 7stud
On Sep 15, 5:25 pm, 7stud <[EMAIL PROTECTED]> wrote: >dialog.Destroy() >timer.Stop() >win.Show() # You can also change that last line to win.Destroy(), and then the user will never see the frame. -- http://mail.python.org/mailman/listinfo/python-list

Re: Make money to share your videos

2007-09-16 Thread GeorgeRXZ
On Sep 16, 12:03 am, [EMAIL PROTECTED] wrote: > Goodtolove.com is sharing their 50% adsense revenue with you to post > videos of anything. > Just keep up logging in and start posting now to make money... Could you give details about it ? GEOrgE http://zsoftwares.googlepages.com/index.htm -- ht

Free Python Ebook

2007-09-16 Thread GeorgeRXZ
Please tell me from which website I will get the free Python Ebook. GEOrgE http://zsoftwares.googlepages.com/index.htm -- http://mail.python.org/mailman/listinfo/python-list

Re: generating list of sub lists

2007-09-16 Thread Jesús Carrete Montaña
cesco wrote: > l = ['string1', 'string2', 'string3'] l2=[l[:i+1] for i in range(len(l))] -- http://mail.python.org/mailman/listinfo/python-list

Re: generating list of sub lists

2007-09-16 Thread Rustom Mody
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', > 'string3']] > > Any help would be

Re: Needless copying in iterations?

2007-09-16 Thread Steven D'Aprano
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 in alist[1:5]: >> print ite

generate list of partially accumulated values

2007-09-16 Thread 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]) Is there a simple way to accomplish this? I came up with the following solution but it seems a bit too elaborated for the task: l_par

Re: generate list of partially accumulated values

2007-09-16 Thread buffi
On Sep 16, 11:56 am, cesco <[EMAIL PROTECTED]> 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? > > I came up with the f

IPv6 name resolution using getaddrinfo

2007-09-16 Thread O.R.Senthil Kumaran
Hi all, To get the hostname, I can use socket.gethostbyname() but that has an inherent limitation wherein does it not support IPv6 name resolution, and getaddrinfo() should be used instead. Looking up the socket.getaddrinfo() documentation, I come to know that The getaddrinfo() function returns a

Re: generate list of partially accumulated values

2007-09-16 Thread buffi
Uh... that turned out weird. Anyways, here goes again l = [1, 2, 3, 4] [sum(l[:x+1]) for x in xrange(len(l))] -- http://mail.python.org/mailman/listinfo/python-list

Half off topic, getting python development lib from mingw

2007-09-16 Thread guruyaya
Hi guys. I'm using python 2.3 on XP. At the moment, I might add, I cannot change any of these: I cannot move back to linux, and I cannot use a higher version of python. Trying to install sip 4.7, using gcc version 3.4.2 (mingw-special), created this error: siplib.o:siplib.c:(.text+0x17): undefined

Re: generate list of partially accumulated values

2007-09-16 Thread cesco
> l = [1, 2, 3, 4] > [sum(l[:x+1]) for x in xrange(len(l))] Thanks, actually my problem is a bit more complex (I thought I could get a solution by posting a simplified version...) The list is composed of objects: l = [obj1, obj2, obj3, obj4] and I need to call a method (say method1) on each obje

Re: Needless copying in iterations?

2007-09-16 Thread Marc 'BlackJack' Rintsch
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 there are no optimizations possible: Haskell is a dynamic > language, and

Re: Free Python Ebook

2007-09-16 Thread Marco
Hi George, > Please tell me from which website I will get the free Python Ebook. which one do you mean? I only know this one: http://diveintopython.org Bye, Marco PS: Sorry, hit the wrong button the first time ;-) -- http://mail.python.org/mailman/listinfo/python-list

Re: Needless copying in iterations?

2007-09-16 Thread Kay Schluehr
> Haskell is a dynamic language, and there are optimizing compilers for it. Last time I used Haskell it was statically typed but this has been almost a year ago and times are changing fast. About optimizing compilers for Python. These won't work without restrictions a la Shedskin which uses C++ a

Re: generate list of partially accumulated values

2007-09-16 Thread ZeD
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 the original request, but... > Is

Re: python 2.5 cElementTree entity troubles

2007-09-16 Thread Diez B. Roggisch
Stefan Behnel schrieb: > Stefan Behnel wrote: >> Diez B. Roggisch wrote: >>> Any suggestions on how to teach the built-in ET-parser entities? >> As you already do it in your code. >> >> http://effbot.org/elementtree/elementtree-xmlparser.htm#tag-ET.XMLParser.entity > > Hmmm, I never needed this, b

Re: generate list of partially accumulated values

2007-09-16 Thread marek . rocki
Those methods of computing partial sums seem to be O(n^2) or worse. What's wrong with an ordinary loop? for i in xrange(1, len(l)): l[i] += l[i - 1] And as for the list of objects: ll = [l[i - 1].method(l[i]) for i in xrange(1, len(l))] + l[-1] -- http://mail.python.org/mailman/listinfo/py

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

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 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

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: 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 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: 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: 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: 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: 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: 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: 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

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

(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

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[

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

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

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,

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

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

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: 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: (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: 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: 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: 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: 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: (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,

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: 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_

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: 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: 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: 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

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: 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

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: 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: 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: (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

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: 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

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: 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

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: 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

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: 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: 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: 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: 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

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

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

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

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: 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 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: 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: 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 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

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: 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

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: 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: 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: 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: 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

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: 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 >>>

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: 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: 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: 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: 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

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: 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

  1   2   >