Re: Problem occured while sending mail

2008-09-17 Thread sui
On Sep 17, 8:04 pm, Peter Pearson <[EMAIL PROTECTED]> wrote: > On Wed, 17 Sep 2008 05:28:05 -0700 (PDT), sui <[EMAIL PROTECTED]> wrote: > > On Sep 17, 5:04 pm, sui <[EMAIL PROTECTED]> wrote: > >> this is my code > > >> import sys, os, glob, datetime, time > >> import smtplib > >> ## Parameters for

member functions in a class

2008-09-17 Thread Karl Kobata
I am new to python and am wondering. When I create a class, with 'def' functions and if this class is instantiated say 50 times. Does this mean that all the 'def' functions code within the class is duplicated for each instance? Can someone give me a short and simple answer as to what happens in

XML-schema 'best practice' question

2008-09-17 Thread Frank Millman
Hi all This is not strictly a Python question, but as I am writing in Python, and as I know there are some XML gurus on this list, I hope it is appropriate here. XML-schemas are used to define the structure of an xml document, and to validate that a particular document conforms to the schema. The

Re: decorator and API

2008-09-17 Thread George Sakkis
On Sep 17, 5:56 pm, Lee Harr <[EMAIL PROTECTED]> wrote: > I have a class with certain methods from which I want to select > one at random, with weighting. > > The way I have done it is this > > import random > > def weight(value): > def set_weight(method): > method.weight = value

RELEASED Python 2.6rc2 and 3.0rc1

2008-09-17 Thread Barry Warsaw
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On behalf of the Python development team and the Python community, I am happy to announce the second and final planned release candidate for Python 2.6, as well as the first release candidate for Python 3.0. These are release candidates, so whil

Re: How to Determine Name of the Day in the Week

2008-09-17 Thread Steven D'Aprano
On Wed, 17 Sep 2008 20:34:02 -0700, Mensanator wrote: > And technically, weeks begin on Sunday, not Monday, but business likes > to think of Monday as day 0 of the week and it doesn't conflict with any > prior date format. There's no "technically" about it. It's an arbitrary starting point, and

Re: A unique instance of Python GUI program

2008-09-17 Thread r0g
akineko wrote: > Again, thank you for many postings to my question. > I have reviewed solutions provided. > Well, I like the named Mutex solution under Windows. > That is a clean and straight-forward approach to the challenge. > (I cannot believe that I'm saying good thing about Windows ;-) ) > >

Re: Problem occured while sending mail

2008-09-17 Thread sui
On Sep 17, 8:04 pm, Peter Pearson <[EMAIL PROTECTED]> wrote: > On Wed, 17 Sep 2008 05:28:05 -0700 (PDT), sui <[EMAIL PROTECTED]> wrote: > > On Sep 17, 5:04 pm, sui <[EMAIL PROTECTED]> wrote: > >> this is my code > > >> import sys, os, glob, datetime, time > >> import smtplib > >> ## Parameters for

Re: A unique instance of Python GUI program

2008-09-17 Thread akineko
Again, thank you for many postings to my question. I have reviewed solutions provided. Well, I like the named Mutex solution under Windows. That is a clean and straight-forward approach to the challenge. (I cannot believe that I'm saying good thing about Windows ;-) ) Unfortunately, I'm living in

cgi-python temporary output

2008-09-17 Thread avehna
Hello: I would like to generate a temporary output in my cgi-python script where the user could see the actual program status while the program is still running behind the web, and know how long approximately it could take, and then finally display the final cgi-output. I have no idea how somethin

Re: decorator and API

2008-09-17 Thread Steven D'Aprano
On Thu, 18 Sep 2008 02:26:29 +0430, Lee Harr wrote: > I have a class with certain methods from which I want to select one at > random, with weighting. > > The way I have done it is this [snip] You are coupling the weights, the actions, and the object which chooses an action all in the on

Re: How to Determine Name of the Day in the Week

2008-09-17 Thread Mensanator
On Sep 17, 10:20 pm, Keo Sophon <[EMAIL PROTECTED]> wrote: > Fredrik Lundh wrote: > > Henry Chang wrote: > > >> Instead of getting integers with weekday(), Monday == 0 ... Sunday == > >> 6; is there a way to get the actual names, such as "Monday ... > >> Sunday"? I would like to do this without cre

Re: How to Determine Name of the Day in the Week

2008-09-17 Thread Keo Sophon
Fredrik Lundh wrote: Henry Chang wrote: Instead of getting integers with weekday(), Monday == 0 ... Sunday == 6; is there a way to get the actual names, such as "Monday ... Sunday"? I would like to do this without creating a data mapping. :) if you have a datetime or date object, you can use

Re: SMTP via GMAIL

2008-09-17 Thread Grant Edwards
On 2008-09-18, Lawrence D'Oliveiro <[EMAIL PROTECTED]> wrote: > In message ><[EMAIL PROTECTED]>, sui > wrote: > >> Traceback (most recent call last): >> File "mail5.py", line 21, in >> session = smtplib.SMTP(SMTPserver,port) >> File "/usr/local/lib/python2.5/smtplib.py", line 244, in __ini

Do HTTPError objects always have a read method?

2008-09-17 Thread Steven D'Aprano
I understood that HTTPError objects always have a read method, so they can be treated as if they were a webpage. E.g. something like this simplified snippet: address = 'http://www.yahoo.com/spamspamspamspamspam' try: conn = urllib2.urlopen(address) except urllib2.HTTPError, e: conn = e

Re: Modifying the system menu

2008-09-17 Thread raj . indian . 08
I tested it again and found that the behaviour is a little different from what I mentioned previously in the mailchain. The item is working perfectly the first time around. Now if I close the application and run it again (which was what I did earlier), if that application system menu is already mod

Re: minimum install & pickling

2008-09-17 Thread Aaron "Castironpi" Brady
On Sep 17, 6:06 pm, greg <[EMAIL PROTECTED]> wrote: > Aaron "Castironpi" Brady wrote: > > Even a function created from raw bytecode string can't do anything > > without __import__ or 'open'. > > Not true: > >    for cls in (1).__class__.__bases__[0].__subclasses__(): >      if cls.__name__ == "file

Re: SMTP via GMAIL

2008-09-17 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, sui wrote: > Traceback (most recent call last): > File "mail5.py", line 21, in > session = smtplib.SMTP(SMTPserver,port) > File "/usr/local/lib/python2.5/smtplib.py", line 244, in __init__ > (code, msg) = self.connect(host, port) > File "/usr/local/li

Re: decorator and API

2008-09-17 Thread Aaron "Castironpi" Brady
On Sep 17, 6:09 pm, "Aaron \"Castironpi\" Brady" <[EMAIL PROTECTED]> wrote: > On Sep 17, 4:56 pm, Lee Harr <[EMAIL PROTECTED]> wrote: > > > > > I have a class with certain methods from which I want to select > > one at random, with weighting. (snip) > > > The problem I have now is that if I subclas

Re: locks

2008-09-17 Thread James Matthews
You might also want to paste the output into a pastbin such as dpaste.com On Wed, Sep 17, 2008 at 10:58 AM, <[EMAIL PROTECTED]> wrote: > >kalin> mailman has been locking one list out. the web interface just >kalin> hangs and it generates a bunch of locks. it seems that it can not >ka

Re: minimum install & pickling

2008-09-17 Thread greg
Aaron "Castironpi" Brady wrote: Even a function created from raw bytecode string can't do anything without __import__ or 'open'. Not true: for cls in (1).__class__.__bases__[0].__subclasses__(): if cls.__name__ == "file": F = cls F(my_naughty_path, "w").write(my_naughty_data)

Re: decorator and API

2008-09-17 Thread Aaron "Castironpi" Brady
On Sep 17, 4:56 pm, Lee Harr <[EMAIL PROTECTED]> wrote: > I have a class with certain methods from which I want to select > one at random, with weighting. > > The way I have done it is this > > import random > > def weight(value): >     def set_weight(method): >         method.weight = value >

Re: ssl server

2008-09-17 Thread Michael Palmer
On Sep 17, 1:33 pm, Seb <[EMAIL PROTECTED]> wrote: > I'm making a ssl server, but I'm not sure how I can verify the > clients. What do I actually need to place in _verify to actually > verify that the client cert is signed by me? > > 50 class SSLTCPServer(TCPServer): > 51 keyFile = "sslce

Re: PYPI, some troubles

2008-09-17 Thread Martin v. Löwis
> 1. when I commit a new release to PYPI, I can use stored data (by my > browser: Name, package summary, keywords etc), but in the last line > (classification) I had to chose all those lines from the very > beginning, moreover, if I click at one of them without pressing "CTRL" > all my choices drop

Re: ANN: Python GUI development using XULRunner

2008-09-17 Thread Todd Whiteman
[EMAIL PROTECTED] wrote: On Sep 17, 1:21 pm, Todd Whiteman <[EMAIL PROTECTED]> wrote: Don Spaulding wrote: On Sep 16, 8:29 pm, Todd Whiteman <[EMAIL PROTECTED]> wrote: I've put together a tutorial that shows off how to build a GUI application using XULRunner (same architectural components as F

decorator and API

2008-09-17 Thread Lee Harr
I have a class with certain methods from which I want to select one at random, with weighting. The way I have done it is this import random def weight(value): def set_weight(method): method.weight = value return method return set_weight class A(object): def a

Re: Python Linear Programming on Ubuntu

2008-09-17 Thread Martin Manns
On Tue, 16 Sep 2008 19:25:58 -0700 (PDT) Fett <[EMAIL PROTECTED]> wrote: > # SciPy -- http://www.scipy.org - supposedly has this, but as I said, > I can't find any mention of it anywhere but on the site you linked. I found OpenOpt on the site: http://scipy.org/scipy/scikits/wiki/MILP I downloade

Re: ANN: Python GUI development using XULRunner

2008-09-17 Thread Fred Pacquier
Todd Whiteman <[EMAIL PROTECTED]> said : > I've put together a tutorial that shows off how to build a GUI > application using XULRunner (same architectural components as Firefox > uses) that can be used in conjunction with the Python programming > language. > The tutorial covers how to build a

Configuration Parsers

2008-09-17 Thread Ron Brennan
Hello, I am trying to parse a shared config file which doesn't contail section headers. Is there a way I can still use ConfigParser()? If not what is a widely used parser available? Thanks, Ron -- http://mail.python.org/mailman/listinfo/python-list

Re: ssl server

2008-09-17 Thread Giampaolo Rodola'
On 17 Set, 19:33, Seb <[EMAIL PROTECTED]> wrote: > I'm making a ssl server, but I'm not sure how I can verify the > clients. What do I actually need to place in _verify to actually > verify that the client cert is signed by me? > >  50 class SSLTCPServer(TCPServer): >  51         keyFile = "sslcert

Re: minimum install & pickling

2008-09-17 Thread Aaron "Castironpi" Brady
On Sep 17, 4:43 am, Paul Boddie <[EMAIL PROTECTED]> wrote: > On 17 Sep, 07:26, "Aaron \"Castironpi\" Brady" <[EMAIL PROTECTED]> > wrote: > > > Sometimes questions come up on here about unpickling safely and > > executing foreign code.  I was thinking a minimum install that didn't > > even have acce

Re: ANN: Python GUI development using XULRunner

2008-09-17 Thread Don Spaulding
Oh, and Google's single sign-on sucks eggs :-| -- http://mail.python.org/mailman/listinfo/python-list

Re: ANN: Python GUI development using XULRunner

2008-09-17 Thread support
On Sep 17, 1:21 pm, Todd Whiteman <[EMAIL PROTECTED]> wrote: > Don Spaulding wrote: > > On Sep 16, 8:29 pm, Todd Whiteman <[EMAIL PROTECTED]> wrote: > >> I've put together a tutorial that shows off how to build a GUI > >> application using XULRunner (same architectural components as Firefox > >> us

Re: Python and Open Office

2008-09-17 Thread Terry Reedy
Hartmut Goebel wrote: Terry Reedy schrieb: One way to learn the meaning of some of the numerous attributes and values is to create a file with the wanted features with OOo, save, unzip, and examine the xml to see which tags are used for which features. The API docs are a bit hidden on the we

PYPI, some troubles

2008-09-17 Thread dmitrey
hi all, 1. when I commit a new release to PYPI, I can use stored data (by my browser: Name, package summary, keywords etc), but in the last line (classification) I had to chose all those lines from the very beginning, moreover, if I click at one of them without pressing "CTRL" all my choices drops

Re: Generating test data from an XML Schema

2008-09-17 Thread Stefan Behnel
Mark Thomas wrote: > On Sep 17, 5:29 am, Jonathan Fine <[EMAIL PROTECTED]> wrote: >> I want to generate test data from an XML schema. I've had a quick look >> at existing tools (such as minixsv and amara) but from what I've seen >> they don't seem to help. > ... >> A tool that provides a nice Pyth

open Invitation to Join with DeveloperWiki Knowledge base

2008-09-17 Thread Randika
Dear Developers,IT Professionals, "We are building a online encyclopedia for developers" and we need your contribution to make it even better. So here is our invitation for those who happy to contribute as editors, readers for the project. If you have written a tutorial/article/code snippet and w

Re: translating ascii to binary

2008-09-17 Thread Tino Wildenhain
hi, Canned wrote: Steven D'Aprano schreef: Your "ascii_to_bin" method tries to do too much in one method. You should split the functionality into small, self-contained pieces, then combine them. And frankly, once you got to the part where you started popping and inserting, my brain melted. Yo

Getting/Setting HTTP Headers

2008-09-17 Thread jakecjacobson
I need to write a feed parser that takes a url for any Atom or RSS feed and transform it into an Atom feed. I done the transformation part but I want to support conditional HTTP requests. I have not been able to find any examples that show: 1. How to read the Last_Modified or ETag header value

Re: ANN: Python GUI development using XULRunner

2008-09-17 Thread Todd Whiteman
Don Spaulding wrote: On Sep 16, 8:29 pm, Todd Whiteman <[EMAIL PROTECTED]> wrote: I've put together a tutorial that shows off how to build a GUI application using XULRunner (same architectural components as Firefox uses) that can be used in conjunction with the Python programming language. The

Re: Tkinter Label 'justify' Problem

2008-09-17 Thread Guilherme Polo
On Wed, Sep 17, 2008 at 2:18 PM, Dude <[EMAIL PROTECTED]> wrote: > Hi All, > I am fairly new to Python programming. I am working on a small > Tkinter project and I think I am missing something, maybe you can > help. The two lines below is all I have related to the Label widget: > > lblServer = Tk

Re: locks

2008-09-17 Thread skip
kalin> mailman has been locking one list out. the web interface just kalin> hangs and it generates a bunch of locks. it seems that it can not kalin> write to a log but not sure which one. errors are like: ... You'd probably be better off asking about Mailman problems on [EMAIL PR

Re: Converting .py files to batch files.

2008-09-17 Thread r0g
Grant Edwards wrote: > On 2008-09-17, r0g <[EMAIL PROTECTED]> wrote: > >> [EMAIL PROTECTED]:~/Desktop/py$ ls >> kickstart.py kickstart.py~ kicktest.py kicktest.py~ >> [EMAIL PROTECTED]:~/Desktop/py$ kickstart.py >> bash: kickstart.py: command not found >> >> Any ideas why this might be? > > Ye

Re: ka-ping yee tokenizer.py

2008-09-17 Thread Karl Kobata
Aaran, Thanks for your input. Your examples gave me other alternatives for what I wanted to do and it seems to work. Thanks all for your help. On Sep 16, 2:48 pm, "Karl Kobata" http://mail.python.org/mailman/listinfo/python-list> > wrote: > Hi Fredrik, > > This is exactly what I need. Th

Re: ANN: Python GUI development using XULRunner

2008-09-17 Thread Don Spaulding
On Sep 16, 8:29 pm, Todd Whiteman <[EMAIL PROTECTED]> wrote: > I've put together a tutorial that shows off how to build a GUI > application using XULRunner (same architectural components as Firefox > uses) that can be used in conjunction with the Python programming language. > > The tutorial covers

locks

2008-09-17 Thread kalin m
hi all... mailman has been locking one list out. the web interface just hangs and it generates a bunch of locks. it seems that it can not write to a log but not sure which one. errors are like: ep 17 05:09:12 2008 (18481) musiclist.lock lifetime has expired, breaking Sep 17 05:09:12 2008 (1848

Re: File Reading related query

2008-09-17 Thread r0g
Fredrik Lundh wrote: > Usman Ajmal wrote: > >> Is there any function for reading a file while ignoring *\n* occuring >> in the file? > > can you be a bit more precise? are we talking about text files or > binary files? how do you want to treat any newlines that actually > appear in the file? >

Re: translating ascii to binary

2008-09-17 Thread Canned
Steven D'Aprano schreef: > Your "ascii_to_bin" method tries to do too much in one method. You should > split the functionality into small, self-contained pieces, then combine > them. And frankly, once you got to the part where you started popping and > inserting, my brain melted. You are making

ssl server

2008-09-17 Thread Seb
I'm making a ssl server, but I'm not sure how I can verify the clients. What do I actually need to place in _verify to actually verify that the client cert is signed by me? 50 class SSLTCPServer(TCPServer): 51 keyFile = "sslcert/server.key" 52 certFile = "sslcert/server.crt" 53

Re: Python GUI for animation

2008-09-17 Thread r0g
Sean DiZazzo wrote: > On Sep 15, 11:29 pm, Virgil Stokes <[EMAIL PROTECTED]> wrote: >> I have been using Python for a short time and I find it a very flexible >> language, and easy to learn and use. I have also worked some with PyGame > Then again, you mention sliders, knobs, etc. I don't think T

Tkinter Label 'justify' Problem

2008-09-17 Thread Dude
Hi All, I am fairly new to Python programming. I am working on a small Tkinter project and I think I am missing something, maybe you can help. The two lines below is all I have related to the Label widget: lblServer = Tkinter.Label(serverFrame, text='Server:', fg='black', justify='left', relief=

Re: Client server implementation

2008-09-17 Thread r0g
Babloo wrote: > On Sep 16, 7:38 am, Benjamin <[EMAIL PROTECTED]> wrote: >> On Sep 15, 5:15 am, Babloo <[EMAIL PROTECTED]> wrote: >> >>> Hi everyone, >>> i wanted to implement a client- server connection >>> and transfer a file over the network. i was able to implement a normal >>>

Re: translating ascii to binary

2008-09-17 Thread Steven D'Aprano
On Wed, 17 Sep 2008 18:02:15 +0200, Canned wrote: > Hi, > I'm trying to write a class that can convert ascii to binary and vice > versa. I write my class based on this function I've found on internet [...] > That works perfectly, but when I try to implement it in my own class it > gives me alot

Re: Converting .py files to batch files.

2008-09-17 Thread Grant Edwards
On 2008-09-17, r0g <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED]:~/Desktop/py$ ls > kickstart.py kickstart.py~ kicktest.py kicktest.py~ > [EMAIL PROTECTED]:~/Desktop/py$ kickstart.py > bash: kickstart.py: command not found > > Any ideas why this might be? Yes. > A path thing? Yes. Linux sy

Re: Converting .py files to batch files.

2008-09-17 Thread r0g
Michael Palmer wrote: > On Sep 15, 3:04 pm, Matias Surdi <[EMAIL PROTECTED]> wrote: >> aditya shukla escribió: >> >>> How can we convert .py files to batch files? is there any library for this? >>> Aditya >>> > On Linux, you w

Re: python-mode problem, doesnt load whole module?

2008-09-17 Thread Fredrik Lundh
cnb wrote: a = parsing.unserialize("C:/users/saftarn/desktop/twok.txt") Traceback (most recent call last): File "C:\Python25\lib\pickle.py", line 1126, in find_class klass = getattr(mod, name) when reporting a traceback, please include the error message that follows after the stack

Re: translating ascii to binary

2008-09-17 Thread Fredrik Lundh
Lie wrote: Any advice about this matter would be very appreciated. Thanks in advance. It'd be easier to make a one-char version of ascii2bin then make the string version based on the one-char version. And it'd be a lot easier to read your posts if you trimmed away at least some of the origi

python-mode problem, doesnt load whole module?

2008-09-17 Thread cnb
>>> a = parsing.unserialize("C:/users/saftarn/desktop/twok.txt") Traceback (most recent call last): File "", line 1, in File "C:\Python25\Progs\NetflixRecSys\parsing.py", line 91, in unserialize return pickle.load(open(filename, 'r')) File "C:\Python25\lib\pickle.py", line 1370, in load

Re: translating ascii to binary

2008-09-17 Thread Lie
On Sep 17, 11:02 pm, Canned <[EMAIL PROTECTED]> wrote: > Hi, > I'm trying to write a class that can convert ascii to binary and vice > versa. I write my class based on this function I've found on internet > > > > > > > def ascii_to_bin(char): > > ascii = ord(char) > > bin = [] > > > while (ascii >

translating ascii to binary

2008-09-17 Thread Canned
Hi, I'm trying to write a class that can convert ascii to binary and vice versa. I write my class based on this function I've found on internet > def ascii_to_bin(char): > ascii = ord(char) > bin = [] > > while (ascii > 0): > if (ascii & 1) == 1: > bin.append("1") > else: > bin.append("0") > ascii

Re: append on lists

2008-09-17 Thread Lie
On Sep 16, 3:20 pm, Armin <[EMAIL PROTECTED]> wrote: > John Machin wrote: > > On Sep 16, 6:45 am, Armin <[EMAIL PROTECTED]> wrote: > > >> Yes, but this is very unconvenient. > >> If d should reference the list a extended with a single list element > >> you need at least two lines > > >> a.append(7)

python regex character group matches...group...gotcha

2008-09-17 Thread christopher taylor
My apologies to the respondents - I failed to screen my test cases before kicking them out to the global python-list. but yes, the 'X' character in my test case was a mistake on my part. I'll give group() a shot. ct -- http://mail.python.org/mailman/listinfo/python-list

Re: python regex character group matches

2008-09-17 Thread Fredrik Lundh
Steven D'Aprano wrote: Assuming that you want to find runs of \u escapes, simply use non-capturing parentheses: pat = re.compile(u"(?:\\\u[0-9A-F]{4})") Doesn't work for me: pat = re.compile(u"(?:\\\u[0-9A-F]{4})") it helps if you cut and paste the right line... here's a better v

Re: python regex character group matches

2008-09-17 Thread Steven D'Aprano
On Wed, 17 Sep 2008 09:27:47 -0400, christopher taylor wrote: > hello python-list! > > the other day, i was trying to match unicode character sequences that > looked like this: > > \\uAD0X... It is not clear what this is supposed to be. Is that matching a literal pair of backslashes, or a sing

Re: Problem occured while sending mail

2008-09-17 Thread Peter Pearson
On Wed, 17 Sep 2008 05:28:05 -0700 (PDT), sui <[EMAIL PROTECTED]> wrote: > On Sep 17, 5:04 pm, sui <[EMAIL PROTECTED]> wrote: >> this is my code >> >> import sys, os, glob, datetime, time >> import smtplib >> ## Parameters for SMTP session >> port=587 >> SMTPserver= 'smtp.gmail.com' >> SMTPuser= '

Re: python regex character group matches

2008-09-17 Thread Steven D'Aprano
On Wed, 17 Sep 2008 15:56:31 +0200, Fredrik Lundh wrote: > Assuming that you want to find runs of \u escapes, simply use > non-capturing parentheses: > > pat = re.compile(u"(?:\\\u[0-9A-F]{4})") Doesn't work for me: >>> pat = re.compile(u"(?:\\\u[0-9A-F]{4})") UnicodeDecodeError: 'unico

Re: Python OOP advice

2008-09-17 Thread Bruno Desthuilliers
Simon Hibbs a écrit : Great contributions, thanks both of you. I'm self-tought when it comes to Python and OOP and I haven't yet grown an intuitive feel for how to do things sensibly. While part of the OO design patterns are mostly workaround for lack of dynamism in languages like C++ or Java,

Re: Python OOP advice

2008-09-17 Thread Bruno Desthuilliers
Ben Finney a écrit : Simon Hibbs <[EMAIL PROTECTED]> writes: Orriginaly I thought I'd need to have a hull object which contains component objects, but the component objects need access to members of the hull object (e.g. the hull size) so that looks messy to implement. Was it as messy as this

Re: Generating test data from an XML Schema

2008-09-17 Thread Jonathan Fine
Mark Thomas wrote: Has anyone seen anything that might help generate test data from a schema? I'm unaware of anything in Python, but Eclipse can generate sample documents from a schema: http://help.eclipse.org/help32/index.jsp?topic=/org.eclipse.wst.xmleditor.doc.user/topics/tcrexxsd.html As

Re: python regex character group matches

2008-09-17 Thread Fredrik Lundh
christopher taylor wrote: my issue, is that the pattern i used was returning: [ '\\uAD0X', '\\u1BF3', ... ] when i expected: [ '\\uAD0X\\u1BF3', ] the code looks something like this: pat = re.compile("(\\\u[0-9A-F]{4})+", re.UNICODE|re.LOCALE) #print pat.findall(txt_line) results = pat.find

Re: Python and Open Office

2008-09-17 Thread Hartmut Goebel
Terry Reedy schrieb: One way to learn the meaning of some of the numerous attributes and values is to create a file with the wanted features with OOo, save, unzip, and examine the xml to see which tags are used for which features. The API docs are a bit hidden on the webpage. Here is the link

Re: python regex character group matches

2008-09-17 Thread Marc 'BlackJack' Rintsch
On Wed, 17 Sep 2008 09:27:47 -0400, christopher taylor wrote: > the other day, i was trying to match unicode character sequences that > looked like this: > > \\uAD0X... > > my issue, is that the pattern i used was returning: > > [ '\\uAD0X', '\\u1BF3', ... ] > > when i expected: > > [ '\\uAD0X

python regex character group matches

2008-09-17 Thread christopher taylor
hello python-list! the other day, i was trying to match unicode character sequences that looked like this: \\uAD0X... my issue, is that the pattern i used was returning: [ '\\uAD0X', '\\u1BF3', ... ] when i expected: [ '\\uAD0X\\u1BF3', ] the code looks something like this: pat = re.compile

Re: Python OOP advice

2008-09-17 Thread Simon Hibbs
Great contributions, thanks both of you. I'm self-tought when it comes to Python and OOP and I haven't yet grown an intuitive feel for how to do things sensibly. Simon -- http://mail.python.org/mailman/listinfo/python-list

Re: Python OOP advice

2008-09-17 Thread Paul McGuire
On Sep 17, 6:50 am, Simon Hibbs <[EMAIL PROTECTED]> wrote: > I'm rewriting a design application for a science fiction game. in it > you design your own starships. Each component has a mass and cost, but > the mass can either be fixed or it can be expressed as a percentage of > the tonnage of the ov

Re: Generating test data from an XML Schema

2008-09-17 Thread Mark Thomas
On Sep 17, 5:29 am, Jonathan Fine <[EMAIL PROTECTED]> wrote: > Hello > > I want to generate test data from an XML schema.  I've had a quick look > at existing tools (such as minixsv and amara) but from what I've seen > they don't seem to help. ... > A tool that provides a nice Python interface to n

Re: recursive using the os.walk(path) from the os module

2008-09-17 Thread Fredrik Lundh
A. Joseph wrote: I want to search through a directory and re-arrange all the files into e.g All .doc files go into MS WORD folder, all .pdf files goes into PDF Folder. I`m thinking of doing something with the os.walk(path) method from os module, I need some ideal how the algorithm should look

Re: recursive using the os.walk(path) from the os module

2008-09-17 Thread Simon Brunning
2008/9/17 A. Joseph <[EMAIL PROTECTED]>: > I want to search through a directory and re-arrange all the files into e.g > > All .doc files go into MS WORD folder, all .pdf files goes into PDF Folder. > > I`m thinking of doing something with the os.walk(path) method from os > module, I need some ideal

Re: Python OOP advice

2008-09-17 Thread Ben Finney
Simon Hibbs <[EMAIL PROTECTED]> writes: > Orriginaly I thought I'd need to have a hull object which contains > component objects, but the component objects need access to members > of the hull object (e.g. the hull size) so that looks messy to > implement. Was it as messy as this:: class Shi

recursive using the os.walk(path) from the os module

2008-09-17 Thread A. Joseph
Hi, I want to search through a directory and re-arrange all the files into e.g All .doc files go into MS WORD folder, all .pdf files goes into PDF Folder. I`m thinking of doing something with the os.walk(path) method from os module, I need some ideal how the algorithm should look like, maybe rec

Re: Problem occured while sending mail

2008-09-17 Thread sui
On Sep 17, 5:04 pm, sui <[EMAIL PROTECTED]> wrote: > this is my code > > import sys, os, glob, datetime, time > import smtplib > ## Parameters for SMTP session > port=587 > SMTPserver= 'smtp.gmail.com' > SMTPuser= '[EMAIL PROTECTED]' > pw= 'fill in here' > SENDER= SMTPuser > > ## Message details >

Re: SMTP via GMAIL

2008-09-17 Thread sui
On Aug 7, 12:40 am, mmm <[EMAIL PROTECTED]> wrote: > On Aug 5, 12:18 am, Tim Roberts <[EMAIL PROTECTED]> wrote: > > > >But when using smtp.gmail.com as the server I learned that any > > >@gmail.com address in the Cc: text block would > > >receive mail even if I changed the code to have the RECEIVE

Re: help on python SWIG C++ extension

2008-09-17 Thread RLC
Thanks a lot, Tim and Diez, Merci Beaucoup!! I strongly suspect the error was caused by the memory operation. I made some modifications only on PolygonMesh definition. And now I have no annoying warnings. PolygonMesh *new_PolygonMesh() { PolygonMesh *p = new PolygonMesh; // p = (PolygonMesh *)

Re: shelve file space always increase!

2008-09-17 Thread Michael Palmer
On Sep 17, 6:17 am, smalltalk <[EMAIL PROTECTED]> wrote: > >>> import shelve > >>> sf = shelve.open('e:/abc.db') > >>> for i in range(1): > > ... sf[str(i)]=i > ...>>> sf.close() > >>> sf = shelve.open('e:/abc.db') > >>> sf.clear() > >>> sf > > {} > the abc.db is always 312k though i have u

Re: shelve file space always increase!

2008-09-17 Thread skip
smalltalk> the abc.db is always 312k though i have use clear(), how can smalltalk> i shrink the space? You really can't without deleting the file. Hash file implementations trade off file size against improve key lookup performance. Similar tradeoffs are made in the implementation of Py

Problem occured while sending mail

2008-09-17 Thread sui
this is my code import sys, os, glob, datetime, time import smtplib ## Parameters for SMTP session port=587 SMTPserver= 'smtp.gmail.com' SMTPuser= '[EMAIL PROTECTED]' pw= 'fill in here' SENDER= SMTPuser ## Message details FROM= SENDER TO= '[EMAIL PROTECTED]' CC=FROM ##RECEIVERS= (TO, CC) ##pro

Python OOP advice

2008-09-17 Thread Simon Hibbs
I'm rewriting a design application for a science fiction game. in it you design your own starships. Each component has a mass and cost, but the mass can either be fixed or it can be expressed as a percentage of the tonnage of the overall ship. Orriginaly I thought I'd need to have a hull object wh

Re: Use of generators and efficiency

2008-09-17 Thread Tim Chase
To my great surprise, this approach was often considerably _slower_ to complete than the original program (up to ~40% depending on which modifiers were used), despite producing initial results more quickly. You may be interested in reading through this thread http://mail.python.org/pipermail/

Re: File Reading related query

2008-09-17 Thread Usman Ajmal
Thanks Tim. That rstrip('\r\n') worked. :) On Wed, Sep 17, 2008 at 10:45 AM, Tim Chase <[EMAIL PROTECTED]>wrote: > Is there any function for reading a file while ignoring *\n* occuring in >>> the file? >>> >> >> can you be a bit more precise? are we talking about text files or binary >> files?

Use of generators and efficiency

2008-09-17 Thread John O'Hagan
Hi, I'm writing a Python program using combinatorial algorithms to generate music. It originally was of this general form: First, a combinatorial function producing a list of sub-lists, then: For each sub-list in the list: Filter/modifier A, then append modified sub-list to new list,

Re: Python Linear Programming on Ubuntu

2008-09-17 Thread Harold Fellermann
> > http://wiki.python.org/moin/NumericAndScientific/Libraries > > > > Scroll down. > > Yes, many of those seem to be deprecated, without destinations to > links, most are poorly or not documented at all. The few that are, I > still can't get running. Of those 254, I think I have tried at least >

Re: File Reading related query

2008-09-17 Thread Tim Chase
I am talking about text file which contain multiple lines e.g following three lines are there in my textfile.txt this is python list where we get support from geeks I want sentence = this is python list where we get support from geeks whereas when i use simple read() i get something like this

Re: File Reading related query

2008-09-17 Thread Tim Chase
Is there any function for reading a file while ignoring *\n* occuring in the file? can you be a bit more precise? are we talking about text files or binary files? how do you want to treat any newlines that actually appear in the file? I believe the OP is referencing this behavior: for l

Re: File Reading related query

2008-09-17 Thread Usman Ajmal
I am talking about text file which contain multiple lines e.g following three lines are there in my textfile.txt this is python list where we get support from geeks I want sentence = this is python list where we get support from geeks whereas when i use simple read() i get something like this

Re: on-the-fly translation with gettext

2008-09-17 Thread Benjamin Sigonneau
Mike Driscoll <[EMAIL PROTECTED]> writes: > On Sep 16, 4:57 am, Benjamin Sigonneau <[EMAIL PROTECTED]> > wrote: >> Hi all, >> >> I'm a complete beginner in python and in GUI designing, yet I'm writing >> a GUI using python and Tkinter.  I need it to be available both in french >> and english, so I

shelve file space always increase!

2008-09-17 Thread smalltalk
>>> import shelve >>> sf = shelve.open('e:/abc.db') >>> for i in range(1): ... sf[str(i)]=i ... >>> sf.close() >>> sf = shelve.open('e:/abc.db') >>> sf.clear() >>> sf {} the abc.db is always 312k though i have use clear(), how can i shrink the space? -- http://mail.python.org/mailman/listin

Re: File Reading related query

2008-09-17 Thread Fredrik Lundh
Usman Ajmal wrote: Is there any function for reading a file while ignoring *\n* occuring in the file? can you be a bit more precise? are we talking about text files or binary files? how do you want to treat any newlines that actually appear in the file? -- http://mail.python.org/mailma

Re: Build Python, Numpy and Scipy source with Visual Studio 6.0 for windows

2008-09-17 Thread Richie
On Sep 16, 7:03 pm, Terry Reedy <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > Now comes the troubled bit...I now look for similar source code for > > Python extensions Numpy and Scipy but the source code and directories > > are not all obvious. Looks like these are normally built via ot

File Reading related query

2008-09-17 Thread Usman Ajmal
Hi., Is there any function for reading a file while ignoring *\n* occuring in the file? -- http://mail.python.org/mailman/listinfo/python-list

Python for the iPhone?

2008-09-17 Thread skip
Anybody tried this port of Python to the iPhone? http://www.modmyi.com/nativeapps/python-v251/ http://iphone.natetrue.com/ Hasn't been updated since July 2007. Maybe just a proof-of-concept? I'm guessing it involves jailbreaking the phone. Skip -- http://mail.python.org/mailman/listinf

  1   2   >