Re: Where is PyMethod_GET_CLASS in Python 3?

2009-12-16 Thread Infinity77
Hi, On Dec 15, 9:22 pm, Terry Reedy wrote: > On 12/15/2009 11:08 AM, Infinity77 wrote: > > > Hi All, > > >      When building C extensions In Python 2.X, there was a magical > > PyMethod_GET_CLASS implemented like this: > > > #define PyMethod_GET_CLASS(meth) \ > >    (((PyMethodObject *)meth) ->  

Re: AttributeError: logging module bug ?

2009-12-16 Thread Peter Otten
Peter wrote: >>> What's the problem ? >>> >> Please provide the config file "logging.cfg" to ease debugging. >> >> Peter >> > Here it is, thanks for having a look > Peter Unfortunately I still can't reproduce your problem. With a minimal file ./of/logger.py from logging import Formatt

Storing a Value in a Cookie

2009-12-16 Thread Victor Subervi
Hi; >From what I've studied and gotten working about cookies, it seems one can store only a certain few pieces of information--expiration, path, comment, domain, max-age, version and last visit--but how is it useful if one can't also store, say, the name of a temporary MySQL table where pertinent c

[ANN] OpenOpt 0.27 (optimization), FuncDesigner 0.17 (auto differentiation)

2009-12-16 Thread dmitrey
Hi all, I'm glad to inform you about release of OpenOpt 0.27 (numerical optimization framework), FuncDesigner 0.17 (CAS with automatic differentiation, convenient modelling of linear/nonlinear functions, can use convenient modelling for some OpenOpt optimization problems and systems of linear/nonli

Re: Storing a Value in a Cookie

2009-12-16 Thread Chris Rebert
On Wed, Dec 16, 2009 at 1:13 AM, Victor Subervi wrote: > Hi; > From what I've studied and gotten working about cookies, it seems one can > store only a certain few pieces of information--expiration, path, comment, > domain, max-age, version and last visit--but how is it useful if one can't > also

Spot Metals Prices (slightly OT)

2009-12-16 Thread Victor Subervi
Hi; I need to update a client's site with spot metals prices. I could build a scraper to grab them off someone else' site (they only need to be accurate within 24 hours), but is there a better *free* source? TIA, Victor -- http://mail.python.org/mailman/listinfo/python-list

Re: Wrapping paper, anyone ?

2009-12-16 Thread Peter Otten
simon wrote: Nice :) --- stars.py2009-12-16 10:52:49.553505036 +0100 +++ stars_fixed.py 2009-12-16 10:53:32.545786454 +0100 @@ -48,7 +48,9 @@ def __init__(self): self.calls = [] -__getattr__ = ScribeCall +def __getattr__(self, name): +return ScribeCall(self

Re: strptime not strict enough

2009-12-16 Thread Lie Ryan
On 12/15/2009 10:30 AM, Tobias Weber wrote: Hi, despite the directives for leading zero stime.strptime('09121', '%y%m%d') returns the first of December. Shouldn't it raise ValueError? Where do I get strict date parsing? A bit hackish perhaps, but maybe you can check for the date's length: dat

Re: Storing a Value in a Cookie

2009-12-16 Thread Victor Subervi
On Wed, Dec 16, 2009 at 4:42 AM, Chris Rebert wrote: > On Wed, Dec 16, 2009 at 1:13 AM, Victor Subervi > wrote: > > Hi; > > From what I've studied and gotten working about cookies, it seems one can > > store only a certain few pieces of information--expiration, path, > comment, > > domain, max-a

Re: Calling Cookie Values

2009-12-16 Thread Victor Subervi
On Tue, Dec 15, 2009 at 4:01 PM, Grant Edwards wrote: > > On Tue, Dec 15, 2009 at 2:36 PM, MRAB > > wrote: > > > > You've just created a cookie, but are trying to get a value without > > having set it first! > > > > > > LOL! Rewrote code thus: > > > >

Re: Dangerous behavior of list(generator)

2009-12-16 Thread Michele Simionato
On Dec 14, 11:05 pm, Carl Banks wrote: > But to answer your question, I think "simple is better than complex" > rules the day.  Right now StopIteration stops an iteration, simple as > that.  Any fix would add complexity. +1 -- http://mail.python.org/mailman/listinfo/python-list

Dec 20 Global Python & All Free SW HW Culture meeting - BerkeleyTIP

2009-12-16 Thread john_re
A great December Solstice to you & yours. :) JOIN the Global All Free SW, HW, Culture meeting via VOIP Dec 20 Sunday, 12N-3PM (Pacific = UTC-8) = 3P-6P Eastern = 8P-11P UTC [Jan 2009 meetings: 2nd, 17th - mark your calendar] http://sites.google.com/site/berkeleytip/schedule == WATCH some VIDEOS

Re: iterators and views of lists

2009-12-16 Thread Bearophile
Brendan Miller: > Currently people slice and dice with well... slices, but those are > copying, so if you want to operate over part of a range you make a > copy, perform the operation, then copy the results back in. > > I was thinking you'd want something like random access iterators in > c++, or p

Re: iterators and views of lists

2009-12-16 Thread Steven D'Aprano
On Tue, 15 Dec 2009 23:48:04 -0800, Brendan Miller wrote: > On Tue, Dec 15, 2009 at 9:09 PM, Terry Reedy wrote: >> On 12/15/2009 10:39 PM, Brendan Miller wrote: >>> I'm wondering if anyone has done work towards creating more powerful >>> iterators for python, or creating some more pythonic equiva

Re: iterators and views of lists

2009-12-16 Thread Paul Rudin
Steven D'Aprano writes: > I'm sympathetic to your request for list views. I've often wanted some > way to cleanly and neatly do this: > > for item in seq[1:]: > process(item) > > without making an unnecessary copy of almost all of seq. > I don't know how it's implemented - but presumably i

platform module problem when frozen?

2009-12-16 Thread Gabriel Rossetti
Hello everyone, I am having problems with the platform module when being run from a frozen program (py2exe). It imports it fine, but it gives me the following error : 'module' object does not contain attribute 'platform' when I do this : platform.platfom() Does platform have a problem with

Re: ftplib retrlines timeout

2009-12-16 Thread Brendan
On Dec 15, 6:17 pm, Jennifer wrote: > I am writing a program that has a requirement for  a timeout of > retrlines after the connection established. I just wonder if timeout > of ftplib.FTP('.xxx.com',username,password,timeout) will work for > retrlines method after the connection established.

Re: pyZui - anyone know about this?

2009-12-16 Thread Daniel Fetchinson
> PyZUI 0.1 has been released: > > http://da.vidr.cc/projects/pyzui/ Cool, thanks very much! I'm using python 2.6 these days and noticed that you use the sha module which makes py2.6 spit out a deprecation warning: /home/fetchinson/pyzui/pyzui/tilestore.py:22: DeprecationWarning: the sha module

Re: iterators and views of lists

2009-12-16 Thread Anh Hai Trinh
On Dec 16, 10:39 am, Brendan Miller wrote: > I was trying to reimplement some of the c++ library of generic > algorithms in c++ in python, but I was finding that this is > problematic to do this in a generic way because there isn't any > equivalent of c++'s forward iterators, random access iterato

py3.x urllib.request - HTTPCookieProcessor and header adding

2009-12-16 Thread gervaz
Hi all, I need to fetch some html pages and it is required to have cookies enabled. So, I'm using opener = urllib.request.build_opener(urllib.request.HTTPCookieProcessor ()) urllib.request.install_opener(opener) as a global instance. Is there a way to always use a default header like: {"User-Age

Re: (OT) Where Are Cookies Stored?

2009-12-16 Thread Victor Subervi
On Tue, Dec 15, 2009 at 6:57 PM, r0g wrote: > Gabriel Genellina wrote: > > En Tue, 15 Dec 2009 12:30:23 -0300, Victor Subervi > > escribió: > > > >> I've googled, found where cookies are supposed to be, the folders and > >> files > >> don't exist. I've opened my latest and greatest FF and seen c

Re: (OT) Where Are Cookies Stored?

2009-12-16 Thread Victor Subervi
On Tue, Dec 15, 2009 at 6:29 PM, Steven D'Aprano < st...@remove-this-cybersource.com.au> wrote: > On Tue, 15 Dec 2009 13:03:07 -0300, Gabriel Genellina wrote: > > > En Tue, 15 Dec 2009 12:30:23 -0300, Victor Subervi > > escribió: > > > >> I've googled, found where cookies are supposed to be, the

Re: pyZui - anyone know about this?

2009-12-16 Thread r0g
David Roberts wrote: > PyZUI 0.1 has been released: > > http://da.vidr.cc/projects/pyzui/ > Cool, thanks :) Roger. -- http://mail.python.org/mailman/listinfo/python-list

Re: iterators and views of lists

2009-12-16 Thread Peter Otten
Paul Rudin wrote: > Steven D'Aprano writes: > > >> I'm sympathetic to your request for list views. I've often wanted some >> way to cleanly and neatly do this: >> >> for item in seq[1:]: >> process(item) >> >> without making an unnecessary copy of almost all of seq. >> > > I don't know how

Re: Wrapping paper, anyone ?

2009-12-16 Thread r0g
Peter Otten wrote: > simon wrote: > > Nice :) > > --- stars.py2009-12-16 10:52:49.553505036 +0100 > +++ stars_fixed.py 2009-12-16 10:53:32.545786454 +0100 > @@ -48,7 +48,9 @@ > def __init__(self): > self.calls = [] > > -__getattr__ = ScribeCall > +def __getattr__(s

Raw string substitution problem

2009-12-16 Thread Ed Keith
I am having a problem when substituting a raw string. When I do the following: re.sub('abc', r'a\nb\nc', '123abcdefg') I get """ 123a b cdefg """ what I want is r'123a\nb\ncdefg' How do I get what I want? Thanks, -EdK Ed Keith e_...@yahoo.com Blog: edkeith.blogspot.com -- h

Re: iterators and views of lists

2009-12-16 Thread Carl Banks
On Dec 15, 11:48 pm, Brendan Miller wrote: > I was thinking you'd want something like random access iterators in > c++, or pointers in c, to write typical in place algorithmic code. To > me, something like non-copying slices (maybe you'd call it a list > view?) would seem functionally similar and

Re: iterators and views of lists

2009-12-16 Thread Daniel Stutzbach
On Wed, Dec 16, 2009 at 7:33 AM, Peter Otten <__pete...@web.de> wrote: > islice() could be changed to special-case lists and tuples, but that feels > a > bit unclean. > How about special-casing objects that implement collections.Sequence? -- Daniel Stutzbach, Ph.D. President, Stutzbach Enterpris

Re: iterators and views of lists

2009-12-16 Thread Daniel Stutzbach
On Wed, Dec 16, 2009 at 5:39 AM, Steven D'Aprano < st...@remove-this-cybersource.com.au> wrote: > for item in seq[1:]: >process(item) > > without making an unnecessary copy of almost all of seq. > I use the following idiom: for i in range(1, len(seq)): process(seq[i]) Alternately, if I'm

Re: Problems with gettext and msgfmt

2009-12-16 Thread JKPeck
On Dec 15, 9:12 pm, JKPeck wrote: > I'm using Python 2.6 on Windows and having trouble with the charset in > gettext.  It seems to be so broken that I must be missing something. > > When I run msgfmt.py, as far as I can see it writes no charset > information into the mo file.  The actual po files

Re: Object Relational Mappers are evil (a meditation)

2009-12-16 Thread J Kenneth King
Steven D'Aprano writes: > On Fri, 11 Dec 2009 19:20:21 -0500, Steve Holden wrote: > >> Simon Forman wrote: >> [...] >>> As far as the OP rant goes, my $0.02: bad programmers will write bad >>> code in any language, with any tool or system or environment they're >>> given. If you want to avoid b

Re: Raw string substitution problem

2009-12-16 Thread Gabriel Genellina
En Wed, 16 Dec 2009 11:09:32 -0300, Ed Keith escribió: I am having a problem when substituting a raw string. When I do the following: re.sub('abc', r'a\nb\nc', '123abcdefg') I get """ 123a b cdefg """ what I want is r'123a\nb\ncdefg' From http://docs.python.org/library/re.html#re.sub

Re: Raw string substitution problem

2009-12-16 Thread Chris Hulan
On Dec 16, 9:09 am, Ed Keith wrote: > I am having a problem when substituting a raw string. When I do the following: > > re.sub('abc', r'a\nb\nc', '123abcdefg') > > I get > > """ > 123a > b > cdefg > """ > > what I want is > > r'123a\nb\ncdefg' > > How do I get what I want? > > Thanks, > >     -Ed

Re: power of explicit self?

2009-12-16 Thread Gabriel Genellina
Fire Crow : > > Nowhere, I'd say. An *implicit* self would have to be implemented > > somewhere in the compiler -- but an explicit self doesn't. It's > > homogeneous, always name-dot-attribute; the name 'self' is not special at > > all. > This is I find very interesting, If I understand your comm

Re: Wrapping paper, anyone ?

2009-12-16 Thread simon
On Dec 16, 9:00 pm, Peter Otten <__pete...@web.de> wrote: > simon wrote: > > Nice :) > > --- stars.py    2009-12-16 10:52:49.553505036 +0100 > +++ stars_fixed.py      2009-12-16 10:53:32.545786454 +0100 > @@ -48,7 +48,9 @@ >      def __init__(self): >          self.calls = [] > > -    __getattr__ =

Re: Wrapping paper, anyone ?

2009-12-16 Thread simon
On Dec 17, 12:36 am, r0g wrote: > Peter Otten wrote: > > simon wrote: > > > Nice :) > > > --- stars.py    2009-12-16 10:52:49.553505036 +0100 > > +++ stars_fixed.py      2009-12-16 10:53:32.545786454 +0100 > > @@ -48,7 +48,9 @@ > >      def __init__(self): > >          self.calls = [] > > > -    _

Re: power of explicit self?

2009-12-16 Thread Grant Edwards
On 2009-12-16, Gabriel Genellina wrote: > Fire Crow : > >> > Nowhere, I'd say. An *implicit* self would have to be implemented >> > somewhere in the compiler -- but an explicit self doesn't. It's >> > homogeneous, always name-dot-attribute; the name 'self' is not special at >> > all. > >> This is

Re: platform module problem when frozen?

2009-12-16 Thread Dave Angel
Gabriel Rossetti wrote: Hello everyone, I am having problems with the platform module when being run from a frozen program (py2exe). It imports it fine, but it gives me the following error : 'module' object does not contain attribute 'platform' when I do this : platform.platfom() Does p

basic grammer error..

2009-12-16 Thread codefly
class codefly: def WaitFreecatz(self, hours): hours = self.hours i = 1 while i < hours: print 'i wait %s hours' %(i) i = i+1 if i == hours: print '\nhe never comes' run error// what's wrong?? -- http://mail.pytho

Re: Wrapping paper, anyone ?

2009-12-16 Thread Peter Otten
simon wrote: > On Dec 16, 9:00 pm, Peter Otten <__pete...@web.de> wrote: >> simon wrote: >> >> Nice :) >> >> --- stars.py2009-12-16 10:52:49.553505036 +0100 >> +++ stars_fixed.py 2009-12-16 10:53:32.545786454 +0100 >> @@ -48,7 +48,9 @@ >> def __init__(self): >> self.calls = [] >> >> -

Re: basic grammer error..

2009-12-16 Thread Diez B. Roggisch
codefly wrote: > class codefly: > > def WaitFreecatz(self, hours): > hours = self.hours > i = 1 > while i < hours: > print 'i wait %s hours' %(i) > i = i+1 > if i == hours: > print '\nhe never comes' > > > run er

Re: Object Relational Mappers are evil (a meditation)

2009-12-16 Thread r0g
J Kenneth King wrote: > Steven D'Aprano writes: > >> On Fri, 11 Dec 2009 19:20:21 -0500, Steve Holden wrote: >> >>> Hear, hear! >> That's all very well, but some languages and techniques encourage the >> programmer to write bad code. > > That's just BS. > > Bad code doesn't just write itself

Re: Wrapping paper, anyone ?

2009-12-16 Thread r0g
simon wrote: > On Dec 17, 12:36 am, r0g wrote: >> Peter Otten wrote: >>> simon wrote: >>> Nice :) >>> --- stars.py2009-12-16 10:52:49.553505036 +0100 >>> +++ stars_fixed.py 2009-12-16 10:53:32.545786454 +0100 >>> @@ -48,7 +48,9 @@ >>> def __init__(self): >>> self.calls = []

Re: (OT) Where Are Cookies Stored?

2009-12-16 Thread Dave Angel
Victor Subervi wrote: On Tue, Dec 15, 2009 at 6:57 PM, r0g wrote: Cookies in FF for Windows are stored in an sqlite database in here... ~\Application Data\Mozilla\Firefox\Profiles\%XYZ%\firefox_profile\ Man, I searched C drive (the only drive) on this computer where I'm working (In

Re: basic grammer error..

2009-12-16 Thread codefly
On 12월17일, 오전12시23분, "Diez B. Roggisch" wrote: > codefly wrote: > > class codefly: > > > def WaitFreecatz(self, hours): > > hours = self.hours > > i = 1 > > while i < hours: > > print 'i wait %s hours' %(i) > > i = i+1 > > if i =

Re: power of explicit self?

2009-12-16 Thread Gabriel Genellina
En Wed, 16 Dec 2009 11:56:17 -0300, Grant Edwards escribió: On 2009-12-16, Gabriel Genellina wrote: Fire Crow : > Nowhere, I'd say. An *implicit* self would have to be implemented > somewhere in the compiler -- but an explicit self doesn't. It's > homogeneous, always name-dot-attribute; the

i re-write it

2009-12-16 Thread codefly
error message is here.. when i type import code2 Traceback (most recent call last): File "", line 1, in File "code2.py", line 11 ~ ^ SyntaxError: invalid syntax and source code is here class codefly: def WaitFreecatz(self, hours): hours = self.hour

Re: Subclassing RegexObject

2009-12-16 Thread Peter Otten
Tobias Weber wrote: > how do I subclass or at least add a method to something returned by > re.compile()? Let's see: >>> import re >>> r = re.compile("yadda") >>> class S(type(r)): pass ... Traceback (most recent call last): File "", line 1, in TypeError: Error when calling the metaclass base

Re: i re-write it

2009-12-16 Thread Diez B. Roggisch
codefly wrote: > error message is here.. > when i type import code2 > > Traceback (most recent call last): > File "", line 1, in > File "code2.py", line 11 > ~ >^ > SyntaxError: invalid syntax > > > and source code is here No, it isn't. The above error says "li

Re: i re-write it

2009-12-16 Thread codefly
On Dec 17, 12:43 am, "Diez B. Roggisch" wrote: > codefly wrote: > > error message is here.. > > when i type import code2 > > > Traceback (most recent call last): > >   File "", line 1, in > >   File "code2.py", line 11 > >     ~ > >                        ^ > > SyntaxError: invalid syntax > > > a

Re: (OT) Where Are Cookies Stored?

2009-12-16 Thread David Robinow
On Wed, Dec 16, 2009 at 10:33 AM, Dave Angel wrote: > You can also find the appdata directory by looking at the environment > variable USERPROFILE, switching to that directory, and descending directly > into "application data" by using the tab key. > ... Lots of good advice. I'd just point out tha

Re: (OT) Where Are Cookies Stored?

2009-12-16 Thread Victor Subervi
On Wed, Dec 16, 2009 at 11:33 AM, Dave Angel wrote: > > > Victor Subervi wrote: > >> On Tue, Dec 15, 2009 at 6:57 PM, r0g wrote: >> >> >> >> Cookies in FF for Windows are stored in an sqlite database in here... >>> >>> ~\Application Data\Mozilla\Firefox\Profiles\%XYZ%\firefox_profile\ >>> >>>

Re: i re-write it

2009-12-16 Thread codefly
On Dec 17, 12:43 am, "Diez B. Roggisch" wrote: > codefly wrote: > > error message is here.. > > when i type import code2 > > > Traceback (most recent call last): > >   File "", line 1, in > >   File "code2.py", line 11 > >     ~ > >                        ^ > > SyntaxError: invalid syntax > > > a

another problem..

2009-12-16 Thread codefly
now.. another problem.. when i type me = code2() the error is here.. Traceback (most recent call last): File "", line 1, in TypeError: 'module' object is not callable -- http://mail.python.org/mailman/listinfo/python-list

I have a cross platform os.startfile but I need to asociate files with xdg-open in linux how do I do that??

2009-12-16 Thread eric_dex...@msn.com
#this should be a cross platform example of os.startfile ( startfile ) #for windows and linux. this is the first version and #linux, mac, other os's commands for exceptions to the #rule would be appreciated. at some point this will be #in the dex tracker project. import os import subprocess def

Python Imaging Library status

2009-12-16 Thread paulo.jpi...@gmail.com
Hi guys, is the famous PIL now a dead project? Latest available download is from 2006 and I still don't see any signs of having it updated for Python 2.6 or 3.x versions. Thanks in Advance, Paulo -- http://mail.python.org/mailman/listinfo/python-list

Re: basic grammer error..

2009-12-16 Thread Dave Angel
codefly wrote: class codefly: def WaitFreecatz(self, hours): hours = self.hours i = 1 while i < hours: print 'i wait %s hours' %(i) i = i+1 if i == hours: print '\nhe never comes' run error// what's wrong??

Re: i re-write it

2009-12-16 Thread Diez B. Roggisch
codefly wrote: > On Dec 17, 12:43 am, "Diez B. Roggisch" wrote: >> codefly wrote: >> > error message is here.. >> > when i type import code2 >> >> > Traceback (most recent call last): >> > File "", line 1, in >> > File "code2.py", line 11 >> > ~ >> > ^ >> > SyntaxError: invalid syntax >> >> > an

Re: Wrapping paper, anyone ?

2009-12-16 Thread bartc
"simon" wrote in message news:a50b1c21-287b-498d-a8c3-51a3a2f94...@k9g2000vbl.googlegroups.com... #!/usr/bin/env python from math import * from random import * import cairo from cairo import Context What's cairo? -- http://mail.python.org/mailman/listinfo/python-list

Re: basic grammer error..

2009-12-16 Thread Bruno Desthuilliers
codefly a écrit : class codefly: def WaitFreecatz(self, hours): hours = self.hours i = 1 while i < hours: print 'i wait %s hours' %(i) i = i+1 if i == hours: print '\nhe never comes' run error// what's wrong??

Re: I have a cross platform os.startfile but I need to asociate files with xdg-open in linux how do I do that??

2009-12-16 Thread Paul Boddie
On 16 Des, 17:03, "eric_dex...@msn.com" wrote: > #this should be a cross platform example of os.startfile ( startfile ) > #for windows and linux.  this is the first version and > #linux, mac, other os's commands for exceptions to the > #rule would be appreciated.  at some point this will be > #in

Re: i re-write it

2009-12-16 Thread Bruno Desthuilliers
codefly a écrit : now.. another problem.. when i type me = code2() where ? and what is 'code2' in this context ? Sorry, my crystal ball is out for repair... the error is here.. Traceback (most recent call last): File "", line 1, in TypeError: 'module' object is not callable Ok, so it

Re: another problem..

2009-12-16 Thread Dave Angel
codefly wrote: now.. another problem.. when i type me = code2() the error is here.. Traceback (most recent call last): File "", line 1, in TypeError: 'module' object is not callable By creating a new thread for each new question, you're forcing yourself to repeat the code and environmen

Re: i re-write it

2009-12-16 Thread Dave Angel
codefly wrote: On Dec 17, 12:43 am, "Diez B. Roggisch" wrote: codefly wrote: error message is here.. when i type import code2 Traceback (most recent call last): File "", line 1, in File "code2.py", line 11 ~ ^ SyntaxError: invalid syntax

Re: Wrapping paper, anyone ?

2009-12-16 Thread r0g
bartc wrote: > > "simon" wrote in message > news:a50b1c21-287b-498d-a8c3-51a3a2f94...@k9g2000vbl.googlegroups.com... >> #!/usr/bin/env python >> >> from math import * >> >> from random import * >> >> import cairo >> from cairo import Context > > What's cairo? > > A vector graphics library.

regex help

2009-12-16 Thread Gabriel Rossetti
Hello everyone, I'm going nuts with some regex, could someone please show me what I'm doing wrong? I have an XMPP msg : 123 456 ... the node may be absent or empty (), the node may be absent. I'd like to grab everything exept the

Re: Raw string substitution problem

2009-12-16 Thread Ed Keith
--- On Wed, 12/16/09, Gabriel Genellina wrote: > From: Gabriel Genellina > Subject: Re: Raw string substitution problem > To: python-list@python.org > Date: Wednesday, December 16, 2009, 9:35 AM > En Wed, 16 Dec 2009 11:09:32 -0300, > Ed Keith > escribió: > > > I am having a problem when subst

Re: regex help

2009-12-16 Thread r0g
Gabriel Rossetti wrote: > Hello everyone, > > I'm going nuts with some regex, could someone please show me what I'm > doing wrong? > > I have an XMPP msg : > > > > Does someone know what is wrong with my expression? Thank you, Gabriel Gabriel, trying to debug a long regex in situ can be a

Re: Python tricks with applescript in OS-X

2009-12-16 Thread Juanre
Thanks for the pointers to appscript, and for the comments on the page. I have changed the examples at http://juanreyero.com/article/python/os-x-python.html to reflect them. Cheers, Juan -- http://juanreyero.com -- http://mail.python.org/mailman/listinfo/python-list

Re: another problem..

2009-12-16 Thread Grant Edwards
On 2009-12-16, codefly wrote: > now.. another problem.. Sorry to be so blunt, but your main problem is that you don't know how to ask questions. Fix that, and everything else will become much easier: 1) Read this: http://catb.org/~esr/faqs/smart-questions.html 2) Read it again. 3) Read t

Re: regex help

2009-12-16 Thread Intchanter / Daniel Fackrell
On Dec 16, 10:22 am, r0g wrote: > Gabriel Rossetti wrote: > > Hello everyone, > > > I'm going nuts with some regex, could someone please show me what I'm > > doing wrong? > > > I have an XMPP msg : > > > > > Does someone know what is wrong with my expression? Thank you, Gabriel > > Gabriel, tryin

Apple Mac OS X 10.6 support & compatability with Python 3 ?

2009-12-16 Thread pdlemper
I've been given a MAC AIR laptop with OS X 10.6 "Snow Leopard". On my desktop I dual boot with XP - Ubuntu and have Python on both. Unfortunately all my Python programs are written on Windows XP and I heavily rely on WConio for console I/O. Called Apple tech support. The technician had never heard

Re: iterators and views of lists

2009-12-16 Thread Francesco Bochicchio
On Dec 16, 1:58 pm, Anh Hai Trinh wrote: > > You might be interested in this library stream>. > > You can easily create arbitrary "slice", for example > >   i = mylist >> takei(primes()) > > will return an iterator over the items of mylist with a prime number > ind

Re: Raw string substitution problem

2009-12-16 Thread Peter Otten
Ed Keith wrote: > --- On Wed, 12/16/09, Gabriel Genellina wrote: > >> From: Gabriel Genellina >> Subject: Re: Raw string substitution problem >> To: python-list@python.org >> Date: Wednesday, December 16, 2009, 9:35 AM >> En Wed, 16 Dec 2009 11:09:32 -0300, >> Ed Keith >> escribió: >> >> > I

python and command shell on Windows

2009-12-16 Thread josu
Hi I am trying to execute a windows command based on a shell by mean of python. I have proven subprocess test=subprocess.Popen (['shell_command'],shell=True,stdin=PIPE,stdout=PIPE) Initally, all seems ok, but, after seconds the python shell is frozen. Does someone know alternative ways valid fo

Re: Apple Mac OS X 10.6 support & compatability with Python 3 ?

2009-12-16 Thread Philip Semanchuk
On Dec 16, 2009, at 12:41 PM, pdlem...@earthlink.net wrote: I've been given a MAC AIR laptop with OS X 10.6 "Snow Leopard". On my desktop I dual boot with XP - Ubuntu and have Python on both. Unfortunately all my Python programs are written on Windows XP and I heavily rely on WConio for console

Re: Apple Mac OS X 10.6 support & compatability with Python 3 ?

2009-12-16 Thread Rami Chowdhury
On Wed, Dec 16, 2009 at 09:41, wrote: > I've been given a MAC AIR laptop with OS X 10.6 "Snow Leopard". > On my desktop I dual boot with XP - Ubuntu and have Python on both. > Unfortunately all my Python programs are written on Windows XP and > I heavily rely on WConio for console I/O. > Called A

Re: Apple Mac OS X 10.6 support & compatability with Python 3 ?

2009-12-16 Thread r0g
pdlem...@earthlink.net wrote: > I've been given a MAC AIR laptop with OS X 10.6 "Snow Leopard". > On my desktop I dual boot with XP - Ubuntu and have Python on both. > Unfortunately all my Python programs are written on Windows XP and > I heavily rely on WConio for console I/O. > Called Apple tech

Re: Python Imaging Library status

2009-12-16 Thread Gabriel Genellina
En Wed, 16 Dec 2009 13:07:30 -0300, paulo.jpi...@gmail.com escribió: is the famous PIL now a dead project? Latest available download is from 2006 and I still don't see any signs of having it updated for Python 2.6 or 3.x versions. Version 1.1.7 is in beta. Here you can find all available v

Re: Apple Mac OS X 10.6 support & compatability with Python 3 ?

2009-12-16 Thread Mark Dickinson
On Dec 16, 5:41 pm, pdlem...@earthlink.net wrote: > I've been given a MAC AIR laptop with OS X 10.6 "Snow Leopard". > On my desktop I dual boot with XP - Ubuntu and have Python on both. > Unfortunately all my Python programs are written on Windows XP and > I heavily rely on WConio for console I/O.

Re: Apple Mac OS X 10.6 support & compatability with Python 3 ?

2009-12-16 Thread Mensanator
On Dec 16, 11:41 am, pdlem...@earthlink.net wrote: > I've been given a MAC AIR laptop with OS X 10.6 "Snow Leopard". > On my desktop I dual boot with XP - Ubuntu and have Python on both. > Unfortunately all my Python programs are written on Windows XP and > I heavily rely on WConio for console I/O.

Re: Python Imaging Library status

2009-12-16 Thread Emile van Sebille
On 12/16/2009 8:07 AM paulo.jpi...@gmail.com said... Hi guys, is the famous PIL now a dead project? Latest available download is from 2006 and I still don't see any signs of having it updated for Python 2.6 or 3.x versions. PIL for Python 2.6 is available for download from http://www.pythonw

Re: iterators and views of lists

2009-12-16 Thread Brendan Miller
On Wed, Dec 16, 2009 at 4:16 AM, Paul Rudin wrote: > Steven D'Aprano writes: > > >> I'm sympathetic to your request for list views. I've often wanted some >> way to cleanly and neatly do this: >> >> for item in seq[1:]: >>     process(item) >> >> without making an unnecessary copy of almost all o

Python training in Florida, January 19-21

2009-12-16 Thread Mark Lutz
Don't miss your chance to attend our upcoming Florida Python training class next month. This 3-day public class is being held January 19-21, in Sarasota, Florida. It is open to both individual and group enrollments. For more details on the class, as well as registration instructions, please visit

Fwd: Re: Logging question

2009-12-16 Thread Vinay Sajip at Red Dove
Original Message Subject:Re: Logging question Date: Tue, 15 Dec 2009 18:28:54 + From: Vinay Sajip at Red Dove To: Yaroslav Molochko On 15/12/2009 14:29, Yaroslav Molochko wrote: > Hello Vinay Sajip, > > my name is Yaroslav, I'm trying to use your logging

Re: ftplib retrlines timeout

2009-12-16 Thread BJ Swope
I've had experiences with some python mail servers that time out connections if data from the socket is not sent to the application within the timeout parameter. I have seen a python app on FreeBSD that would timeout a connection after 600 seconds if freebsd did not receive at least 32 kb of data

Re: Raw string substitution problem

2009-12-16 Thread Gabriel Genellina
En Wed, 16 Dec 2009 14:51:08 -0300, Peter Otten <__pete...@web.de> escribió: Ed Keith wrote: --- On Wed, 12/16/09, Gabriel Genellina wrote: Ed Keith escribió: > I am having a problem when substituting a raw string. When I do the following: > > re.sub('abc', r'a\nb\nc', '123abcdefg') > >

Re: Python Imaging Library status

2009-12-16 Thread paulo.jpi...@gmail.com
On 16 Dez., 19:21, "Gabriel Genellina" wrote: > En Wed, 16 Dec 2009 13:07:30 -0300, paulo.jpi...@gmail.com   > escribió: > > > is the famous PIL now a dead project? > > > Latest available download is from 2006 and I still don't see any signs > > of having it updated for Python 2.6 or 3.x versions

Re: Object Relational Mappers are evil (a meditation)

2009-12-16 Thread J Kenneth King
r0g writes: > J Kenneth King wrote: >> Steven D'Aprano writes: >> >>> On Fri, 11 Dec 2009 19:20:21 -0500, Steve Holden wrote: >>> > > Hear, hear! >>> That's all very well, but some languages and techniques encourage the >>> programmer to write bad code. >> >> That's just BS. >> >> Bad

Re: Raw string substitution problem

2009-12-16 Thread Peter Otten
Gabriel Genellina wrote: > En Wed, 16 Dec 2009 14:51:08 -0300, Peter Otten <__pete...@web.de> > escribió: > >> Ed Keith wrote: >> >>> --- On Wed, 12/16/09, Gabriel Genellina wrote: >>> Ed Keith escribió: > I am having a problem when substituting a raw string. When I do

How to create a self-destructing Tkinter dialog box?

2009-12-16 Thread mrstevegross
Ok, I would like to put together a Python/Tkinter dialog box that displays a simple message and self-destructs after N seconds. Is there a simple way to do this? Thanks, --Steve -- http://mail.python.org/mailman/listinfo/python-list

Re: iterators and views of lists

2009-12-16 Thread Anh Hai Trinh
On Dec 16, 2:48 pm, Brendan Miller wrote: > No, that's what I'm getting at... Most of the existing mutating > algorithms in python (sort, reverse) operate over entire collections, > not partial collections delimited by indexes... which would be really > awkward anyway. Ok it can be done! The cod

Re: Raw string substitution problem

2009-12-16 Thread Ed Keith
--- On Wed, 12/16/09, Peter Otten <__pete...@web.de> wrote: > Another possibility: > > >>> print re.sub('abc', lambda m: r'a\nb\n.c\a', > '123abcdefg') > 123a\nb\n.c\adefg I'm not sure whether that is clever, ugly, or just plain strange! I think I'll stick with: >>> m = re.match('^(.*)abc(.*)

Re: python and command shell on Windows

2009-12-16 Thread eric_dex...@msn.com
On Dec 16, 11:58 am, josu wrote: > Hi > > I am trying to execute a windows command based on a shell by mean of > python. I have proven subprocess > > test=subprocess.Popen > (['shell_command'],shell=True,stdin=PIPE,stdout=PIPE) > > Initally, all seems ok, but, after seconds the python shell is fro

Re: I have a cross platform os.startfile but I need to asociate files with xdg-open in linux how do I do that??

2009-12-16 Thread eric_dex...@msn.com
On Dec 16, 10:36 am, Paul Boddie wrote: > On 16 Des, 17:03, "eric_dex...@msn.com" wrote: > > > #this should be a cross platform example of os.startfile ( startfile ) > > #for windows and linux.  this is the first version and > > #linux, mac, other os's commands for exceptions to the > > #rule wou

Re: Question to logging

2009-12-16 Thread Vinay Sajip at Red Dove
On 16/12/2009 12:49, stefan.messerl...@postfinance.ch wrote: > I have the following error and no clue, how to solve that. Up to python > version 2.5 the following script worked without an error, but since python > 2.6. I get the following error: > > #!/usr/bin/env python > # -*- coding: ISO-8859-

Help with parsing a list

2009-12-16 Thread J
Hi all, I need some help in turning a list into a dictionary... The list looks something like this: ['key1: data1','key2: data2','key3: data3',' key4: ',' \tdata4.1',' \tdata4.2',' \tdata4.3','key5: data5'] and it's derived from output (via subprocess.Popen) that in a terminal would look like t

Re: More stuff added to ch 2 of my programming intro

2009-12-16 Thread Alf P. Steinbach
* Alf P. Steinbach: * Alf P. Steinbach: Format: PDF http://preview.tinyurl.com/ProgrammingBookP3> The new stuff, section 2.7, is about programs as simulations and handling data, focusing on modeling things. It includes some Python GUI programming. The plan is to discuss containers like li

Re: read text file byte by byte

2009-12-16 Thread Nobody
On Mon, 14 Dec 2009 21:37:33 -0300, Gabriel Genellina wrote: >> There are no file objects in 3.x. The file() function no longer >> exists. The return value from open(), will be an instance of >> _io. depending upon the mode, e.g. _io.TextIOWrapper for 'r', >> _io.BufferedReader for 'rb', _io.Buffe

Re: ftplib retrlines timeout

2009-12-16 Thread Jennifer
So you mean ftplib.FTP('.xxx.com',username,password,timeout) will timeout the retrlines as well, correct? Thanks. -- http://mail.python.org/mailman/listinfo/python-list

  1   2   >