Re: Multiple inheritance - How to call method_x in InheritedBaseB from method_x in InheritedBaseA?

2009-09-08 Thread The Music Guy
I should also mention--and I should have realized this much sooner--that each of the BaseN classes are themselves each going to have at least one common base which will define method_x, so each BaseN will be calling that if it defines its own method_x. Again, sorry I didn't mention that sooner. For

Re: Class variable inheritance

2009-09-08 Thread Carl Banks
On Sep 8, 8:51 pm, HPJ wrote: > > Conceptually, Python checks for the presence of B.foo, and if it's > > not there it checks for foo's presence in the base classes. > > Yes, I have no problem believing you guys that this is what Python > does. Still, my question remains about where in the Language

Re: Class variable inheritance

2009-09-08 Thread Steven D'Aprano
On Tue, 08 Sep 2009 13:14:42 -0700, HPJ wrote: >> I could, but I will let you read and find what it says about class >> attributes. > > You think I would have asked specifically about the Language Reference > if I hadn't read it and failed to find what I was looking for? You must be new to the

Re: Class variable inheritance

2009-09-08 Thread HPJ
And by the way, the reason I've come across this problem at all is because I have something like this: class A: class X: n = 'a' x = X() class B(A): class X(A.X): n = 'b' # x = X() The line commented out was originally not there, but I found out I had to add it if I wanted B().x.n

Re: Class variable inheritance

2009-09-08 Thread HPJ
> http://docs.python.org/reference/datamodel.html#new-style-and-classic... > - search for 'method resolution order' for other hits in that document. First of all, that's the LR for Python 2, I'm with Python 3. Second of all, there's one single passage containing the phrase "method resolution order

Re: Multiple inheritance - How to call method_x in InheritedBaseB from method_x in InheritedBaseA?

2009-09-08 Thread The Music Guy
On Mon, Sep 7, 2009 at 3:30 PM, Carl Banks wrote: > > That's not what you did in your original post, though. > > Mixins should be listed first among bases, which is how you did it in > your original post, and how it had to be in order for it to "just > work" as I claimed. > > class FooX(MyMixin, Ba

"Rapid GUI Programming with Python and Qt" source code

2009-09-08 Thread Steven Woody
*Hi, * *I've searched google and cannot find a valid link for the source code of the book "Rapid GUI Programming with Python and Qt". Could anyone please give me a non-broken URL?* Thanks. * *-- Life is the only flaw in an otherwise perfect nonexistence -- Schopenhauer narke public key at htt

Re: Strange effects using the email.message.Message class

2009-09-08 Thread Sean DiZazzo
On Sep 8, 6:23 pm, Rogério Brito wrote: > Dear people, > > I am a newbie in Python and I'm just writing a program to rip the HTML parts > of > multipart/alternative e-mails that come with a plain text version. > > For this task, I decided to leave perl aside for this task and tried to code > some

Re: Class variable inheritance

2009-09-08 Thread Mark Hammond
On 9/09/2009 1:51 PM, HPJ wrote: Conceptually, Python checks for the presence of B.foo, and if it's not there it checks for foo's presence in the base classes. Yes, I have no problem believing you guys that this is what Python does. Still, my question remains about where in the Language Referen

Re: Class variable inheritance

2009-09-08 Thread HPJ
> Conceptually, Python checks for the presence of B.foo, and if it's > not there it checks for foo's presence in the base classes. Yes, I have no problem believing you guys that this is what Python does. Still, my question remains about where in the Language Reference this is specified. And if the

Re: SPAM

2009-09-08 Thread Keith Thompson
"Steven Lord" writes: [snip] > If you feel the need to respond to a spam like this, please snip out any > URLs or email addresses used by the spammers -- otherwise all you're doing > is giving the spammer more advertising. Better yet, if you feel the need to respond to a spam, step away from th

Re: a question about numpy

2009-09-08 Thread sturlamolden
On 9 Sep, 03:45, hi_roger wrote: > hello, i want to ask a question about numpy. > > i know how to select a submatrix using the slice object in numpy. But > how can i select a submatrix > A[i1,i2,i3;j1,j2,j3] (elements in A on line i1,i2,i3 and column > j1,j2,j3 ,  and i1,i2,i3,j1,j2,j3 are all arb

Re: a question about numpy

2009-09-08 Thread sturlamolden
On 9 Sep, 03:45, hi_roger wrote: > i know how to select a submatrix using the slice object in numpy. But > how can i select a submatrix > A[i1,i2,i3;j1,j2,j3] (elements in A on line i1,i2,i3 and column > j1,j2,j3 ,  and i1,i2,i3,j1,j2,j3 are all arbitrary numbers ) You just pass an array of ints

Re: SPAM

2009-09-08 Thread Steven Lord
"TBK" wrote in message news:b073f805-f8ce-49b3-b2d4-3d29bd97a...@j4g2000yqa.googlegroups.com... *snip* > > > > > Download *snip URL* > > > Free videos high resolution photos and much more. You know what to > > > do! Free Downloads! > > > > Sold! Thanks everyone. > > spam If you feel the need

Re: How to refer to data files without hardcoding paths?

2009-09-08 Thread Matthew Wilson
On Mon 07 Sep 2009 10:57:01 PM EDT, Gabriel Genellina wrote: > I prefer > to use pkgutil.get_data(packagename, resourcename) because it can handle > those cases too. I didn't know about pkgutil until. I thought I had to use setuptools to do that kind of stuff. Thanks! Matt -- http://mail.pyth

Re: hanning python

2009-09-08 Thread sturlamolden
On 9 Sep, 00:24, Steven D'Aprano wrote: > A decent vendor-supplied implementation will include error checking that > you otherwise would need to implement yourself, so yes. Not for code like this: >>> import numpy as np >>> n = np.arange(101) >>> w = 0.5*(1.0-np.cos(2*np.pi*n/(100.))) --

a question about numpy

2009-09-08 Thread hi_roger
hello, i want to ask a question about numpy. i know how to select a submatrix using the slice object in numpy. But how can i select a submatrix A[i1,i2,i3;j1,j2,j3] (elements in A on line i1,i2,i3 and column j1,j2,j3 , and i1,i2,i3,j1,j2,j3 are all arbitrary numbers ) The submatrix must share dat

Re: Class variable inheritance

2009-09-08 Thread Carl Banks
On Sep 8, 4:50 pm, HPJ wrote: > > would you expect the B class to have a copy of the foo method? > > Sorta. I would expect B to have a copy of the "foo" attribute, which > then refers to the same method as A.foo. So the method itself will be > be copied, but its address stored separately in A.foo

Re: Math Notations, Computer Languages, and the “F orm” in Formalism

2009-09-08 Thread -7/9 n n + 1.76666666 + 2/
Musatov Search for Math Notations, Computer Languages, and the “Form ” in Formalism   (lacks links) - Math Notations, Computer Languages, and the “Form” in Formalism Xah Lee, 2009-08-31 This page is a collection of essays and expositions on the subjects of nomenclatur

Re: Class variable inheritance

2009-09-08 Thread HPJ
> would you expect the B class to have a copy of the foo method? Sorta. I would expect B to have a copy of the "foo" attribute, which then refers to the same method as A.foo. So the method itself will be be copied, but its address stored separately in A.foo and B.foo. -- http://mail.python.org/ma

Re: start default application for read a pdf from python

2009-09-08 Thread Albert Hopkins
On Tue, 2009-09-08 at 22:22 +0200, Angelo Ballabio wrote: > My problem is a way to run a default application to read and show a > pdf > file from unix or windows, i have a mixed ambient in the office, so I > am > try to find a way to start a application to show this pdf file I > generate whith r

Re: Distutils - can user designate install directory for windows installer?

2009-09-08 Thread Mark Hammond
On 9/09/2009 1:57 AM, Timothy W. Grove wrote: I have successfully built a windows installer for my python program using distutils, (python setup.py bdist_wininst), but is there a way to do it that will allow a user ('user' == 'boss', in this case!) to designate the installation directory, rather

Re: recursive decorator

2009-09-08 Thread Ethan Furman
Michele Simionato wrote: [snip] Yes, it is portable. BTW, here is what you want to do (requires decorator-3.1.2): from decorator import FunctionMaker def bindfunc(f): name = f.__name__ signature = ', '.join(FunctionMaker(f).args[1:]) # skip first arg return FunctionMaker.create(

Re: Class variable inheritance

2009-09-08 Thread Steven D'Aprano
On Tue, 08 Sep 2009 04:36:19 -0700, HPJ wrote: >> Makes sense to me. To step through what's happening: >> >> >>> A.n, B.n >> (0, 0) >> >> Here, the lookup on B.n fails (that is, B itself has no variable n), >> and thus falls back to A.n > > See, this is what tripped me up, right at the beginning.

Re: The future of Python immutability

2009-09-08 Thread Steven D'Aprano
On Tue, 08 Sep 2009 11:23:05 -0700, Daniel Fetchinson wrote: >> How does Matlab speed compare to Python in general? Ruby, for example, >> is an order of magnitude slower than Python (at least it was last time >> I looked) > > For what operations? Under what circumstances? I'm just being pedantic

PyPI upload documentation

2009-09-08 Thread Dan Yamins
Dear all: I'm trying to upload documentation to the PyPI site for a project I'm working on (there's a "new feature" on the PyPI site that allows admins of projects to upload a zip file of the pages of documentation.) If you have admin access to a PyPI project, you can see this on the admin page

Re: hanning python

2009-09-08 Thread Steven D'Aprano
On Tue, 08 Sep 2009 11:12:18 -0700, sturlamolden wrote: > On 8 Sep, 15:08, pdpi wrote: > >> Come, come. I think it's a good rule that, where available, a vendor- >> supplied implementation is the preferable choice until proven >> otherwise. > > Even for the simplest of equations? A decent vend

Re: subprocess + python-daemon - bug/problem?

2009-09-08 Thread Ben Finney
Sewar writes: > I looked at other daemon libraries and snippets, it's clearly the bug is in > subprocess not python-daemon. > Then I found Python bug #1731717 which discusses it. Thank you very much! I'm glad to see this is a known issue and that some investigation has already been done. (It's a

make test curses on 3.1.1

2009-09-08 Thread Paul Watson
It appears that 3.1.1 built pretty cleanly on my SUSE 11 box. However, the curses test appears to fail. I see this message on the www.python.org site many times when searching Google, but the contents appears to have been removed. http://www.google.com/search?hl=en&as_q=test+test_curses+crashed+

[ANNC] pybotwar-0.6

2009-09-08 Thread Lee Harr
pybotwar is a fun and educational game where players create computer programs to control simulated robots to compete in a battle arena. http://pybotwar.googlecode.com/ pybotwar uses pybox2d for the physical simulation, and uses either pygame and pygsear or PyQt4 for the visualization. pybotwar

Invitation to connect on LinkedIn

2009-09-08 Thread Manzur Ahmed
LinkedIn Manzur Ahmed requested to add you as a connection on LinkedIn: -- Jaime, I'd like to add you to my professional network on LinkedIn. - Manzur Accept invitation from Manzur Ahmed http://www.linkedin.com/e/I2LlXdLlWUhFABKmxVOlgGLlWUhF

Re: Help with cumulative sum

2009-09-08 Thread Andreas Waldenburger
On Tue, 8 Sep 2009 12:49:23 -0700 (PDT) Maggie wrote: > On Sep 8, 3:29 pm, Maggie wrote: > > Building on the code that I posted in one of the previous posts.. I > > need to find a cumulative sum of the file of the times in the test > > file: > > > > here is the code i have: > > > > #!/usr/bin/py

Re: Help with cumulative sum

2009-09-08 Thread MRAB
Maggie wrote: On Sep 8, 4:17 pm, MRAB wrote: Maggie wrote: On Sep 8, 3:29 pm, Maggie wrote: Building on the code that I posted in one of the previous posts.. I need to find a cumulative sum of the file of the times in the test file: here is the code i have: #!/usr/bin/python import os.path #

Re: Help with cumulative sum

2009-09-08 Thread Maggie
On Sep 8, 4:17 pm, MRAB wrote: > Maggie wrote: > > On Sep 8, 3:29 pm, Maggie wrote: > >> Building on the code that I posted in one of the previous posts.. I > >> need to find a cumulative sum of the file of the times in the test > >> file: > > >> here is the code i have: > > >> #!/usr/bin/python

Re: Help with cumulative sum

2009-09-08 Thread Andreas Waldenburger
On Tue, 8 Sep 2009 13:23:43 -0700 (PDT) Maggie wrote: > On Sep 8, 4:17 pm, MRAB wrote: > [snip] > I saw my mistake...now it is telling me the following -- > > Traceback (most recent call last): > File "formisano_count.py", line 22, in > running_sum = running_sum + (int(item) * int(item)

Re: How do I post to the wxPython mailing list?

2009-09-08 Thread Mike Driscoll
On Sep 8, 2:14 am, PythonAB wrote: > On 8 sep 2009, at 02:25, Neil Hodgson wrote: > > > PythonAB: > > >> I dont want to register with a google account, > >> is there any way to use a non-gmail account? > > >   A Google account does not mean you have to use gmail. The Google > > account is used to

Re: start default application for read a pdf from python

2009-09-08 Thread Angelo Ballabio
Sorry to not be very specific My problem is a way to run a default application to read and show a pdf file from unix or windows, i have a mixed ambient in the office, so I am try to find a way to start a application to show this pdf file I generate whith reportlab. actualy I write a file in a

Re: simple string question

2009-09-08 Thread Scott David Daniels
D'Arcy J.M. Cain wrote: On Mon, 7 Sep 2009 15:29:23 +1000 "jwither" wrote: Given a string (read from a file) which contains raw escape sequences, (specifically, slash n), what is the best way to convert that to a parsed string, where the escape sequence has been replaced (specifically, by a N

Re: Help with cumulative sum

2009-09-08 Thread MRAB
Maggie wrote: On Sep 8, 3:29 pm, Maggie wrote: Building on the code that I posted in one of the previous posts.. I need to find a cumulative sum of the file of the times in the test file: here is the code i have: #!/usr/bin/python import os.path #name of output file filename = "OUTPUT.txt"

Re: Class variable inheritance

2009-09-08 Thread HPJ
> I could, but I will let you read and find what it says about class > attributes. You think I would have asked specifically about the Language Reference if I hadn't read it and failed to find what I was looking for? The closest thing I was able to find was section 3.2. "The standard type hierarc

Re: Math Notations, Computer Languages, and the “F orm” in Formalism

2009-09-08 Thread fortunatus
On Sep 7, 3:06 pm, Xah Lee wrote: ... > • systems for displaying math, such as TeX, Mathematica, MathML, > should be unified as part of the computer language's syntax. ... > ☄ to that end you might be interested in Fortress at Sun: http://projectfortress.sun.com/Projects/Community http://researc

Re: Help with cumulative sum

2009-09-08 Thread Maggie
On Sep 8, 4:05 pm, "J. Cliff Dyer" wrote: > If I gave you a list of numbers, could you come up with a summifier > function that returns another list of numbers that are a cumulative sum? > You've got the information in place to create a file > > def summifier(nums): >     """Returns a list of numb

Re: Help with cumulative sum

2009-09-08 Thread J. Cliff Dyer
If I gave you a list of numbers, could you come up with a summifier function that returns another list of numbers that are a cumulative sum? You've got the information in place to create a file def summifier(nums): """Returns a list of numbers that are the running sum totals of nums"""

Re: Help with cumulative sum

2009-09-08 Thread Maggie
On Sep 8, 3:49 pm, Maggie wrote: > On Sep 8, 3:29 pm, Maggie wrote: > > > > > Building on the code that I posted in one of the previous posts.. I > > need to find a cumulative sum of the file of the times in the test > > file: > > > here is the code i have: > > > #!/usr/bin/python > > > import os

Re: start default application for read a pdf from python

2009-09-08 Thread Grant Edwards
On 2009-09-08, Angelo Ballabio wrote: > I try to start a default application for reading a pdf file > inside the python script. > > I try > > os.startfile(name,option) but say me startfile not implemented Are you _sure_ it says startfile not implemented? Or does it say this: >>> os.startfil

Re: hanning python

2009-09-08 Thread Andreas Waldenburger
On Tue, 8 Sep 2009 11:12:18 -0700 (PDT) sturlamolden wrote: > On 8 Sep, 15:08, pdpi wrote: > > > Come, come. I think it's a good rule that, where available, a > > vendor- supplied implementation is the preferable choice until > > proven otherwise. > > Even for the simplest of equations? > Yes

Re: Help with cumulative sum

2009-09-08 Thread Maggie
On Sep 8, 3:29 pm, Maggie wrote: > Building on the code that I posted in one of the previous posts.. I > need to find a cumulative sum of the file of the times in the test > file: > > here is the code i have: > > #!/usr/bin/python > > import os.path > > #name of output file > filename = "OUTPUT.tx

start default application for read a pdf from python

2009-09-08 Thread Angelo Ballabio
I try to start a default application for reading a pdf file inside the python script. I try os.startfile(name,option) but say me startfile not implemented there are some system to start for example acrobar or okular from the script with a name of pdf file? thenks Angelo -- http://mail.pytho

Help with cumulative sum

2009-09-08 Thread Maggie
Building on the code that I posted in one of the previous posts.. I need to find a cumulative sum of the file of the times in the test file: here is the code i have: #!/usr/bin/python import os.path #name of output file filename = "OUTPUT.txt" #open the file test = open ("test.txt", "rU") #re

Re: Soap with python?

2009-09-08 Thread Otto Hellwig
On Sep 8, 7:47 am, Jim Wilson wrote: > On 09/08/2009 08:40 AM, Otto Hellwig wrote: > > > reccommend [sic ...] the best soap library ... > > Client side only? Suds (https://fedorahosted.org/suds/). Accept no > subsitute! Thank you. I will give Suds a try. -- http://mail.python.org/mailman/lis

Re: Output file formatting/loop problems -- HELP?

2009-09-08 Thread Maggie
On Sep 8, 12:35 pm, MRAB wrote: > Maggie wrote: > > On Sep 8, 11:39 am, MRAB wrote: > >> Maggie wrote: > >>> My code is supposed to enumerate each line of file (1, 2, 3...) and > >>> write the new version into the output file -- > >>> #!/usr/bin/python > >>> import os.path > >>> import csv > >>>

Re: The future of Python immutability

2009-09-08 Thread Daniel Fetchinson
>> > Is the difference because of mutability versus immutability, or >> > because of C code in Numpy versus Matlab code? Are you comparing >> > bananas and pears? >> >> It consisted of something like this > > > Your code does a lot of unnecessary work if you're just trying to > demonstrate immutabi

Re: hanning python

2009-09-08 Thread sturlamolden
On 8 Sep, 15:08, pdpi wrote: > Come, come. I think it's a good rule that, where available, a vendor- > supplied implementation is the preferable choice until proven > otherwise. Even for the simplest of equations? -- http://mail.python.org/mailman/listinfo/python-list

Re: The future of Python immutability

2009-09-08 Thread John Nagle
Steven D'Aprano wrote: On Tue, 08 Sep 2009 09:38:51 +0200, Hendrik van Rooyen wrote: On Monday 07 September 2009 20:26:02 John Nagle wrote: Right. Tracking mutablity and ownership all the way down without making the language either restrictive or slow is tough. In multi-thread progr

Re: Extracting patterns after matching a regex

2009-09-08 Thread Terry Reedy
Mart. wrote: If, as Terry suggested, you do have a tuple of strings and the first element has FTPHOST, then s[0].split(":")[1].strip() will work. It is an email which contains information before and after the main section I am interested in, namely... FINISHED: 09/07/2009 08:42:31 MEDIATYPE

Re: subprocess + python-daemon - bug/problem?

2009-09-08 Thread Sewar
I looked at other daemon libraries and snippets, it's clearly the bug is in subprocess not python-daemon. Then I found Python bug #1731717 which discusses it. I wish my project was opensource so I can post more specific test cases. #1731717 http://bugs.python.org/issue1731717 Thanks -- http://

Re: [Guppy-pe-list] An iteration idiom (Was: Re: loading files containing multiple dumps)

2009-09-08 Thread Sverker Nilsson
On Mon, 2009-09-07 at 16:53 +0100, Chris Withers wrote: > Sverker Nilsson wrote: > > I hope the new loadall method as I wrote about before will resolve this. > > > > def loadall(self,f): > > ''' Generates all objects from an open file f or a file named f''' > > if isinstance(f,basestring):

Re: Extracting patterns after matching a regex

2009-09-08 Thread Mart.
On Sep 8, 4:33 pm, MRAB wrote: > Mart. wrote: > > On Sep 8, 3:53 pm, MRAB wrote: > >> Mart. wrote: > >>> On Sep 8, 3:14 pm, "Andreas Tawn" wrote: > >>> Hi, > >>> I need to extract a string after a matching a regular expression. For > >>> example I have the string... > >>> s = "FT

Re: Output file formatting/loop problems -- HELP?

2009-09-08 Thread MRAB
Maggie wrote: On Sep 8, 11:39 am, MRAB wrote: Maggie wrote: My code is supposed to enumerate each line of file (1, 2, 3...) and write the new version into the output file -- #!/usr/bin/python import os.path import csv import sys #name of output file filename = "OUTPUT.txt" #open the file test

Re: Extracting patterns after matching a regex

2009-09-08 Thread nn
On Sep 8, 12:16 pm, nn wrote: > On Sep 8, 11:19 am, Dave Angel wrote: > > > > > Mart. wrote: > > > > > > I have been doing this to turn the email into a string > > > > email =ys.argv[1] > > > f =open(email, 'r') > > > s =str(f.readlines()) > > > > so FTPHOST isn't the first element, it is just p

Re: Extracting patterns after matching a regex

2009-09-08 Thread nn
On Sep 8, 11:19 am, Dave Angel wrote: > Mart. wrote: > > > > I have been doing this to turn the email into a string > > > email =ys.argv[1] > > f =open(email, 'r') > > s =str(f.readlines()) > > > so FTPHOST isn't the first element, it is just part of a larger > > string. When I turn the email int

AUTO: Vacation (returning 09/08/2009)

2009-09-08 Thread gregory . miller
I am out of the office until 09/08/2009. I will respond to your message when I return. Note: This is an automated response to your message "Announcing: Python Open Mike blog" sent on 9/8/2009 10:10:46 AM. You will receive a notification for each message you send to this person while the pers

Distutils - can user designate install directory for windows installer?

2009-09-08 Thread Timothy W. Grove
I have successfully built a windows installer for my python program using distutils, (python setup.py bdist_wininst), but is there a way to do it that will allow a user ('user' == 'boss', in this case!) to designate the installation directory, rather than being forced to install into /Python/Li

Re: Output file formatting/loop problems -- HELP?

2009-09-08 Thread Hendrik van Rooyen
On Tuesday 08 September 2009 17:22:30 Maggie wrote: > My code is supposed to enumerate each line of file (1, 2, 3...) and > write the new version into the output file -- > > #!/usr/bin/python > > import os.path > import csv > import sys > > #name of output file > filename = "OUTPUT.txt" > > > #open

Re: Extracting patterns after matching a regex

2009-09-08 Thread nn
On Sep 8, 10:25 am, "Mart." wrote: > On Sep 8, 3:21 pm, nn wrote: > > > > > On Sep 8, 9:55 am, "Mart." wrote: > > > > On Sep 8, 2:16 pm, "Andreas Tawn" wrote: > > > > > > Hi, > > > > > > I need to extract a string after a matching a regular expression. For > > > > > example I have the string...

Re: Extracting patterns after matching a regex

2009-09-08 Thread nn
On Sep 8, 10:27 am, pdpi wrote: > On Sep 8, 3:21 pm, nn wrote: > > > > > On Sep 8, 9:55 am, "Mart." wrote: > > > > On Sep 8, 2:16 pm, "Andreas Tawn" wrote: > > > > > > Hi, > > > > > > I need to extract a string after a matching a regular expression. For > > > > > example I have the string... >

Re: What python can NOT do?

2009-09-08 Thread Дамјан Георгиевски
> Boot loaders are another type of software which would be impractical > to write in existing Python implementations. I wonder if TinyPy (http://www.tinypy.org/) could be used to write a boot loader. It would probably need some more code to replace the services it uses from an OS, and perhaps it

Re: Output file formatting/loop problems -- HELP?

2009-09-08 Thread Maggie
On Sep 8, 11:39 am, MRAB wrote: > Maggie wrote: > > My code is supposed to enumerate each line of file (1, 2, 3...) and > > write the new version into the output file -- > > > #!/usr/bin/python > > > import os.path > > import csv > > import sys > > > #name of output file > > filename = "OUTPUT.txt

Re: Output file formatting/loop problems -- HELP?

2009-09-08 Thread MRAB
Maggie wrote: My code is supposed to enumerate each line of file (1, 2, 3...) and write the new version into the output file -- #!/usr/bin/python import os.path import csv import sys #name of output file filename = "OUTPUT.txt" #open the file test = open ("test.txt", "r") #read in all the d

Re: Extracting patterns after matching a regex

2009-09-08 Thread MRAB
Mart. wrote: On Sep 8, 3:53 pm, MRAB wrote: Mart. wrote: On Sep 8, 3:14 pm, "Andreas Tawn" wrote: Hi, I need to extract a string after a matching a regular expression. For example I have the string... s = "FTPHOST: e4ftl01u.ecs.nasa.gov" and once I match "FTPHOST" I would like to extract "e4

Re: wxGlade question - How to add new event to a button in events tab?

2009-09-08 Thread Albert Hopkins
Could you not post the exact same message 3 times within an hour? -- http://mail.python.org/mailman/listinfo/python-list

Output file formatting/loop problems -- HELP?

2009-09-08 Thread Maggie
My code is supposed to enumerate each line of file (1, 2, 3...) and write the new version into the output file -- #!/usr/bin/python import os.path import csv import sys #name of output file filename = "OUTPUT.txt" #open the file test = open ("test.txt", "r") #read in all the data into a list

Re: Re: Extracting patterns after matching a regex

2009-09-08 Thread Dave Angel
Mart. wrote: I have been doing this to turn the email into a string email =ys.argv[1] f =open(email, 'r') s =str(f.readlines()) so FTPHOST isn't the first element, it is just part of a larger string. When I turn the email into a string it looks like... 'FINISHED: 09/07/2009 08:42:31\r\n', '\r

Re: Extracting patterns after matching a regex

2009-09-08 Thread Mart.
On Sep 8, 3:53 pm, MRAB wrote: > Mart. wrote: > > On Sep 8, 3:14 pm, "Andreas Tawn" wrote: > > Hi, > > I need to extract a string after a matching a regular expression. For > > example I have the string... > > s = "FTPHOST: e4ftl01u.ecs.nasa.gov" > > and once I match "FTPHOST"

Re: [Python-ideas] possible attribute-oriented class

2009-09-08 Thread Jim Jewett
On Mon, Sep 7, 2009 at 9:02 PM, Jan Kaliszewski wrote: > 08-09-2009 o 02:15:10 Steven D'Aprano wrote: >> ... what's wrong with this? > a['xyz'] = something['blablabla'] + somethingelse['foobar'] > b['ababababa'] += afun(bobo['dodo']['kookoo'] * pofopofo['gh'][0]['a']) > cupu['abc'] = (kukumunu['

Re: Extracting patterns after matching a regex

2009-09-08 Thread MRAB
Mart. wrote: On Sep 8, 3:14 pm, "Andreas Tawn" wrote: Hi, I need to extract a string after a matching a regular expression. For example I have the string... s = "FTPHOST: e4ftl01u.ecs.nasa.gov" and once I match "FTPHOST" I would like to extract "e4ftl01u.ecs.nasa.gov". I am not sure as to the b

Re: Extracting patterns after matching a regex

2009-09-08 Thread pdpi
On Sep 8, 3:21 pm, nn wrote: > On Sep 8, 9:55 am, "Mart." wrote: > > > > > > > On Sep 8, 2:16 pm, "Andreas Tawn" wrote: > > > > > Hi, > > > > > I need to extract a string after a matching a regular expression. For > > > > example I have the string... > > > > > s = "FTPHOST: e4ftl01u.ecs.nasa.gov

Re: Extracting patterns after matching a regex

2009-09-08 Thread Mart.
On Sep 8, 3:21 pm, nn wrote: > On Sep 8, 9:55 am, "Mart." wrote: > > > > > On Sep 8, 2:16 pm, "Andreas Tawn" wrote: > > > > > Hi, > > > > > I need to extract a string after a matching a regular expression. For > > > > example I have the string... > > > > > s = "FTPHOST: e4ftl01u.ecs.nasa.gov" >

Re: Extracting patterns after matching a regex

2009-09-08 Thread Mart.
On Sep 8, 3:14 pm, "Andreas Tawn" wrote: > > > > Hi, > > > > > I need to extract a string after a matching a regular expression. For > > > > example I have the string... > > > > > s = "FTPHOST: e4ftl01u.ecs.nasa.gov" > > > > > and once I match "FTPHOST" I would like to extract > > > > "e4ftl01u.ec

Re: Extracting patterns after matching a regex

2009-09-08 Thread nn
On Sep 8, 9:55 am, "Mart." wrote: > On Sep 8, 2:16 pm, "Andreas Tawn" wrote: > > > > > > Hi, > > > > I need to extract a string after a matching a regular expression. For > > > example I have the string... > > > > s = "FTPHOST: e4ftl01u.ecs.nasa.gov" > > > > and once I match "FTPHOST" I would lik

RE: Extracting patterns after matching a regex

2009-09-08 Thread Andreas Tawn
> > > Hi, > > > > > I need to extract a string after a matching a regular expression. For > > > example I have the string... > > > > > s = "FTPHOST: e4ftl01u.ecs.nasa.gov" > > > > > and once I match "FTPHOST" I would like to extract > > > "e4ftl01u.ecs.nasa.gov". I am not sure as to the best approa

Re: Extracting patterns after matching a regex

2009-09-08 Thread Mart.
On Sep 8, 2:16 pm, "Andreas Tawn" wrote: > > Hi, > > > I need to extract a string after a matching a regular expression. For > > example I have the string... > > > s = "FTPHOST: e4ftl01u.ecs.nasa.gov" > > > and once I match "FTPHOST" I would like to extract > > "e4ftl01u.ecs.nasa.gov". I am not su

Re: Class variable inheritance

2009-09-08 Thread Terry Reedy
HPJ wrote: Makes sense to me. To step through what's happening: A.n, B.n (0, 0) Here, the lookup on B.n fails (that is, B itself has no variable n), and thus falls back to A.n See, this is what tripped me up, right at the beginning. I thought B would inherit (as in copy) the variable n from

RE: Extracting patterns after matching a regex

2009-09-08 Thread Andreas Tawn
> Hi, > > I need to extract a string after a matching a regular expression. For > example I have the string... > > s = "FTPHOST: e4ftl01u.ecs.nasa.gov" > > and once I match "FTPHOST" I would like to extract > "e4ftl01u.ecs.nasa.gov". I am not sure as to the best approach to the > problem, I had

wxGlade question - How to add new event to a button in events tab?

2009-09-08 Thread kaiqi chen
Hi, I am a starter of wxGlade (0.6.2). I am trying buiding a simple application which is a frame contains a button. In the button properties window, select the events tab, there is a default event EVT_BUTTON, I have added a handler to this event, when I want to add a new event to the button here,

Re: Extracting patterns after matching a regex

2009-09-08 Thread Terry Reedy
Mart. wrote: On Sep 8, 2:15 pm, MRAB wrote: Martin wrote: Hi, I need to extract a string after a matching a regular expression. Whether or not you need re is an issue to be determined. >>> For example I have the string... s = "FTPHOST: e4ftl01u.ecs.nasa.gov" and once I match "FTPHOST" I wo

Re: incorrect DeprecationWarning (patch needed)

2009-09-08 Thread Alan G Isaac
On 9/5/2009 5:50 PM, Alan G Isaac wrote: I've filed a bug report: http://bugs.python.org/issue6844 This is now an accepted bug with a patch request. Can someone on this list please assist with a patch? Thanks, Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list

Re: Extracting patterns after matching a regex

2009-09-08 Thread Mart.
On Sep 8, 2:21 pm, "Mark Tolonen" wrote: > "Martin" wrote in message > > news:5941d8f1-27c0-47d9-8221-d21f07200...@j39g2000yqh.googlegroups.com... > > > > > Hi, > > > I need to extract a string after a matching a regular expression. For > > example I have the string... > > > s = "FTPHOST: e4ftl01

Re: Migrate From PyQt3 to PyQt4

2009-09-08 Thread Dave Angel
nusch wrote: I want to migrate from qt,pyqt,pykde 3 to 4 and remove all *.py files to work with newer version, also after remove pyqt3support. How can I do it in easy way ? I've read here http://www.mail-archive.com/p...@riverbankcomputing.com/msg15009.html something about deprecation warning bu

[wxGlade] - How to add new event to a button in events tab

2009-09-08 Thread kaiqi chen
Hi, I am a starter of wxGlade (0.6.2). I am trying buiding a simple application which is a frame contains a button. In the button properties window, select the events tab, there is a default event EVT_BUTTON, I have added a handler to this event, when I want to add a new event to the button here,

Re: Extracting patterns after matching a regex

2009-09-08 Thread Mart.
On Sep 8, 2:15 pm, MRAB wrote: > Martin wrote: > > Hi, > > > I need to extract a string after a matching a regular expression. For > > example I have the string... > > > s = "FTPHOST: e4ftl01u.ecs.nasa.gov" > > > and once I match "FTPHOST" I would like to extract > > "e4ftl01u.ecs.nasa.gov". I am

[wxGlade] - How to add new event to a button in events tab

2009-09-08 Thread kaiqi chen
Hi, I am a newbie of wxGlade (0.6.2). I am trying buiding a simple application which is a frame contains a button. In the button properties window, select the events tab, there is a default event EVT_BUTTON, I have added a handler to this event, when I want to add a new event to the button here, b

Re: Extracting patterns after matching a regex

2009-09-08 Thread Mark Tolonen
"Martin" wrote in message news:5941d8f1-27c0-47d9-8221-d21f07200...@j39g2000yqh.googlegroups.com... Hi, I need to extract a string after a matching a regular expression. For example I have the string... s = "FTPHOST: e4ftl01u.ecs.nasa.gov" and once I match "FTPHOST" I would like to extract

Re: Extracting patterns after matching a regex

2009-09-08 Thread pdpi
On Sep 8, 1:56 pm, Martin wrote: > Hi, > > I need to extract a string after a matching a regular expression. For > example I have the string... > > s = "FTPHOST: e4ftl01u.ecs.nasa.gov" > > and once I match "FTPHOST" I would like to extract > "e4ftl01u.ecs.nasa.gov". I am not sure as to the best ap

Re: Extracting patterns after matching a regex

2009-09-08 Thread MRAB
Martin wrote: Hi, I need to extract a string after a matching a regular expression. For example I have the string... s = "FTPHOST: e4ftl01u.ecs.nasa.gov" and once I match "FTPHOST" I would like to extract "e4ftl01u.ecs.nasa.gov". I am not sure as to the best approach to the problem, I had been

Re: hanning python

2009-09-08 Thread pdpi
On Sep 8, 1:55 pm, sturlamolden wrote: > On 8 Sep, 13:36, Pierre wrote: > > > anyone knows what is the python equivalent of the matlab's hanning > > function. > > > Note that in matlab hann and hanning are different. > > If you don't know how to compute a von Hann window, you are not > competent

Extracting patterns after matching a regex

2009-09-08 Thread Martin
Hi, I need to extract a string after a matching a regular expression. For example I have the string... s = "FTPHOST: e4ftl01u.ecs.nasa.gov" and once I match "FTPHOST" I would like to extract "e4ftl01u.ecs.nasa.gov". I am not sure as to the best approach to the problem, I had been trying to match

Re: hanning python

2009-09-08 Thread sturlamolden
On 8 Sep, 13:36, Pierre wrote: > anyone knows what is the python equivalent of the matlab's hanning > function. > > Note that in matlab hann and hanning are different. If you don't know how to compute a von Hann window, you are not competent to do any scientific programming. Seriously! I assume

Re: Soap with python?

2009-09-08 Thread Jim Wilson
On 09/08/2009 08:40 AM, Otto Hellwig wrote: > reccommend [sic ...] the best soap library ... Client side only? Suds (https://fedorahosted.org/suds/). Accept no subsitute! -- http://mail.python.org/mailman/listinfo/python-list

Re: google tech talk code (threading module)

2009-09-08 Thread MRAB
wiso wrote: I took a little code from google tech talk. It seems interesting, but it doesn't work: import sys, urllib, os, threading, Queue q = Queue.Queue() class RetrWorker(threading.Thread): def run(self): self.setDaemon(True) def hook(*a): print (fn,a) while Tr

  1   2   >