Re: Question about raw string and regex

2006-03-23 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > 1.5.2? Aren't we at 2.4.2 now? So the regs documentation was pulled, > yet the source code shipped with the installer still uses it? How are > people suppose to make heads or tails of a language when it ships with > deprecated, undocumented code? $ more classfix.py #

s = raw_input ("hello whats your name? ")

2006-03-23 Thread cm012b5105
Hi there i am hoping some one could help me out with a small problem i am in the process of learning python.I am trying to write an interactive programme, This is a short example. if s = raw_input ("hello what’s your name? ") if s=='carmel': Print "Ahh the boss’s wife" What i would like to

Capturing gdb output in pyhton script using gdb -batch -x arguments

2006-03-23 Thread Surendra
Hi Friends, I am in need of gudance for getting ouput from the gdb objfile -batch -x gdb batch_command_file But I am not able to see messages on display. So kindly guide me if u have any experience about it. batch_command_file: list *0x840230fd echo bla bla... -- http://mail.python.org/mai

Re: Strings and % sign fails - Help Please

2006-03-23 Thread Christoph Zwerschke
Erik Max Francis wrote: > His problem is that cursor.execute does format expansion with %, so a > single % is not legal. Yes, I think psycopg uses paramstyle='pyformat', i.e. it expands parameters in your sql in the usual Python way where % has a special meaning. If you really mean the % sign o

Re: Terminating a subprocess '.exe'

2006-03-23 Thread Fredrik Lundh
"Ernesto" wrote: > I launch a Windows executable and wish to close it from Python. The > code is below. Normally, my program waits for rib.exe to finish, but > I'd like to be able to close it from python if possible. (I suppose if > I was going to do this, I wouldn't use .wait() ) Any ideas ?

Re: overlapping sets

2006-03-23 Thread Adam DePrince
On Thu, 2006-03-23 at 22:55 -0800, kpp9c wrote: > I have a question... and ... whew ... i am gonna be honest, i haven't > the slightest clue how to even start ... i am not sure if i used up all > my good will here or can take a mulligan.. i love to try to at least > post some lame broken code of my

Re: RELEASED Python 2.4.3, release candidate 1

2006-03-23 Thread Fredrik Lundh
Delaney, Timothy wrote: > However, there were definitely things found that were real bugs, and > subsequently fixed. absolutely. but a significant chunk of those bugs were in the "will leak references or access null pointers under extreme low-memory conditions, but it's not very likely that you

Re: Remove integer from float number

2006-03-23 Thread kpp9c
okay... out of curiousity... how would you then seperate the interger value from the fractional part do something to one side and then put it back together... like if you had 8.01 and you want to add to the '8' part in one way (ordinary decimal) and add to the .01 part modulo something .. like say

Re: Programming challenge: wildcard exclusion in cartesian products

2006-03-23 Thread Dirk Thierbach
Dinko Tenev <[EMAIL PROTECTED]> wrote: >> > I don't see immediately how exactly this is going to work. Unless I'm >> > very much mistaken, a FSA in the classical sense will accept or reject >> > only after the whole sequence has been consumed, and this spells >> > exponential times. >> Exponentia

overlapping sets

2006-03-23 Thread kpp9c
I have a question... and ... whew ... i am gonna be honest, i haven't the slightest clue how to even start ... i am not sure if i used up all my good will here or can take a mulligan.. i love to try to at least post some lame broken code of my own at first... but like i said, not being a math perso

Re: COM callbacks in Python

2006-03-23 Thread Roger Upole
"Dan" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >I need to register for a COM callback under Windows. I am using an ADO > recordset interface like this: > > import win32com.client > import time > connect = win32com.client.Dispatch("ADODB.Connection") > recordset = win32com.clien

Re: RELEASED Python 2.4.3, release candidate 1

2006-03-23 Thread Paddy
I just Googled and found the Python-Dev thread 'About "Coverity Study Ranks LAMP Code Quality" '. I was heartened by the type of issues raised in the discussion - it leaves me content with whats 'under-the-hood' in Python. You maintainers don't seem to bang your own drum, which is a good thing, bu

Re: Strings and % sign fails - Help Please

2006-03-23 Thread Erik Max Francis
Jorge Godoy wrote: > I know. I'm just trying to see if there might be some magic going on with his > driver... Since raw strings have no effect on format specifiers, that won't tell you anything. >>> r'%' == '%' True His problem is that cursor.execute does format expansion with %, so a sin

Re: Strings and % sign fails - Help Please

2006-03-23 Thread Jorge Godoy
Erik Max Francis <[EMAIL PROTECTED]> writes: > Raw strings don't have anything to do with format specifiers. I know. I'm just trying to see if there might be some magic going on with his driver... -- Jorge Godoy <[EMAIL PROTECTED]> "Quidquid latine dictum sit, altum sonatur." - Qualquer

Re: New development windows, IronPython or PythonWin

2006-03-23 Thread Jorge Godoy
Casey Hawthorne <[EMAIL PROTECTED]> writes: > Butternut squash <[EMAIL PROTECTED]> wrote: > >>[EMAIL PROTECTED] wrote: >> >>> IronPython is currently nowhere near production quality. I would not >>> recommend it. >> >>But it's so cool. > > It's cool to have bugs? > > That really BUGS ME! You're c

Re: Multiplying all the values in a dictionary

2006-03-23 Thread Adam DePrince
Excuse me, I mean python2.4 -mtimeit -s 'from numarray import array; d = {(100,500):[5,5], (100,501):[6,6], (100,502):[7,7]}; x = dict(d);' 'for i in x.values(): i[0]*=1;i[1]*=1' 100 loops, best of 3: 1.72 usec per loop i[0]*=1, not j[0]*=1 ... -- http://mail.python.org/mailman/listinfo/p

Re: Multiplying all the values in a dictionary

2006-03-23 Thread Adam DePrince
Wait! It occured to me. Why are we touching the key at all. This is a dictionary with mutable values. [EMAIL PROTECTED] ~]$ python2.4 -mtimeit -s 'd = {(100,500):[5,5], (100,501):[6,6], (100,502):[7,7]}; x = dict(d)' 'for i in x.values(): i[:]=[j*1 for j in i]' 10 loops, best of 3: 2.79 us

Re: Question about raw string and regex

2006-03-23 Thread John Machin
On 24/03/2006 2:57 PM, [EMAIL PROTECTED] wrote: > Gotta love the attitude of people on .lang newsgroups > > > The unraw '\t' might work, but all the example in the tutorial use raw > strings, so why not be consistent in the example scripts? classfix.py is not an *example* script. It is (was

Re: encoding problems (é and è)

2006-03-23 Thread John Machin
On 24/03/2006 2:19 PM, Jean-Paul Calderone wrote: > On Fri, 24 Mar 2006 09:33:19 +1100, John Machin <[EMAIL PROTECTED]> > wrote: > >> On 24/03/2006 8:36 AM, Peter Otten wrote: >> >>> John Machin wrote: >>> You can replace ALL of this upshifting and accent removal in one blow by us

Re: __slots__

2006-03-23 Thread David Isaac
"Ziga Seilnacht" <[EMAIL PROTECTED]> wrote: > If you want to restrict attribute asignment, you should use the > __setattr__ special method, see: > http://docs.python.org/ref/attribute-access.html That "should" is what I am asking about. If I understand, in the simplest case, you want me to say so

Re: New development windows, IronPython or PythonWin

2006-03-23 Thread Casey Hawthorne
Butternut squash <[EMAIL PROTECTED]> wrote: >[EMAIL PROTECTED] wrote: > >> IronPython is currently nowhere near production quality. I would not >> recommend it. > >But it's so cool. It's cool to have bugs? That really BUGS ME! -- Regards, Casey -- http://mail.python.org/mailman/listinfo/python-

Re: Strings and % sign fails - Help Please

2006-03-23 Thread Erik Max Francis
Jorge Godoy wrote: > [EMAIL PROTECTED] writes: > >> heh.. It works except I am using psycopg.Binary(somebinarystructure), >> and I am not really doing it by hand to just add the extra %, and >> psycopg.Binary doesn't do it. I'd imagine it's a bug with psycopg >> package. Any quick way to project

Re: Question about raw string and regex

2006-03-23 Thread jlowery
Gotta love the attitude of people on .lang newsgroups The unraw '\t' might work, but all the example in the tutorial use raw strings, so why not be consistent in the example scripts? 1.5.2? Aren't we at 2.4.2 now? So the regs documentation was pulled, yet the source code shipped with the

Re: Multiplying all the values in a dictionary

2006-03-23 Thread Adam DePrince
Yes, I cede that explicit indexing is faster by quite a bit. There is a somewhat philosophical decision for why I avoided that. I prefer to try to present python with as big of a picture of what I want as possiable. update tells python what I want to do, whereas the for-loop describes how to. I

Re: New development windows, IronPython or PythonWin

2006-03-23 Thread Butternut squash
[EMAIL PROTECTED] wrote: > IronPython is currently nowhere near production quality. I would not > recommend it. But it's so cool. -- http://mail.python.org/mailman/listinfo/python-list

Re: Strings and % sign fails - Help Please

2006-03-23 Thread Jorge Godoy
[EMAIL PROTECTED] writes: > heh.. It works except I am using psycopg.Binary(somebinarystructure), > and I am not really doing it by hand to just add the extra %, and > psycopg.Binary doesn't do it. I'd imagine it's a bug with psycopg > package. Any quick way to project a string from freak '%' pro

Re: Convert Word .doc to Acrobat .pdf files

2006-03-23 Thread Justin Ezequiel
## this creates a postscript file which you can then convert to PDF ## using Acrobat Distiller ## ## BTW, I spent an hour trying to get this working with ## win32com.client.Dispatch ## (the save file dialog still appeared) ## Then I remembered win32com.client.dynamic.Dispatch ## ## Can somebody ple

Re: encoding problems (é and è)

2006-03-23 Thread Jean-Paul Calderone
On Fri, 24 Mar 2006 09:33:19 +1100, John Machin <[EMAIL PROTECTED]> wrote: >On 24/03/2006 8:36 AM, Peter Otten wrote: >> John Machin wrote: >> >>>You can replace ALL of this upshifting and accent removal in one blow by >>>using the string translate() method with a suitable table. >> >> Only if you

Re: Strings and % sign fails - Help Please

2006-03-23 Thread siasookhteh
heh.. It works except I am using psycopg.Binary(somebinarystructure), and I am not really doing it by hand to just add the extra %, and psycopg.Binary doesn't do it. I'd imagine it's a bug with psycopg package. Any quick way to project a string from freak '%' problems? Thanks, Sia Jorge Godoy w

Re: Getting a loop to activate a loop above it

2006-03-23 Thread adam . deprince
This is how python is supposed to work. I'm sure not what languages you have used ... it seems that you are expecting some sort rule based system like make, or prolog. Grab a cup of joe, pull up a chair and let me help you out here. Python is an imperative language, you can envision the presence

Re: Strings and % sign fails - Help Please

2006-03-23 Thread Jorge Godoy
[EMAIL PROTECTED] writes: > The following statement fails because it has the '%' sign in it. > cursor.execute("select '%'") > > The error is: IndexError: list index out of range > > How do I address this problem? Use "%%". -- Jorge Godoy <[EMAIL PROTECTED]> "Quidquid latine dictum sit, a

Strings and % sign fails - Help Please

2006-03-23 Thread siasookhteh
I also posted this in Django Users group, but figured it probably has more relevance for python group. It seems like a freak problem to me. I spent a long hour to track the problem down and here it is: The following statement fails because it has the '%' sign in it. cursor.execute("select '%'")

Re: Multiplying all the values in a dictionary

2006-03-23 Thread Felipe Almeida Lessa
Em Qui, 2006-03-23 às 18:01 -0800, [EMAIL PROTECTED] escreveu: > >for key in d: > > d[key] = [x*2 for x in d[key]] > > > > Naw, if you are going to use list interpolation go all the way and save > yourself all of that ugly indexing into the dict. > > >>> d = {(100,500):[5,5], (100,501):[6,6

Re: Question about raw string and regex

2006-03-23 Thread John Machin
On 24/03/2006 12:36 PM, [EMAIL PROTECTED] wrote: > I doubt it, although it might work anyway. You could dispel all doubt in about 15 seconds flat were you to actually try it out. >>> import regex __main__:1: DeprecationWarning: the regex module is deprecated; please use the re module >>> rege

Re: Multiplying all the values in a dictionary

2006-03-23 Thread Felipe Almeida Lessa
Em Qui, 2006-03-23 às 17:54 -0800, Scott David Daniels escreveu: > John McMonagle wrote: > > Say I have a dictionary like below: > > > > d = {(100,500):[5,5], (100,501):[6,6], (100,502):[7,7]} > > > > Say I want to multiply all the values of the dictionary by 2: > > for key in d.keys(): > > d[k

Re: New development windows, IronPython or PythonWin

2006-03-23 Thread sanxiyn
IronPython is currently nowhere near production quality. I would not recommend it. -- http://mail.python.org/mailman/listinfo/python-list

Re: Multiplying all the values in a dictionary

2006-03-23 Thread adam . deprince
>for key in d: > d[key] = [x*2 for x in d[key]] > Naw, if you are going to use list interpolation go all the way and save yourself all of that ugly indexing into the dict. >>> d = {(100,500):[5,5], (100,501):[6,6], (100,502):[7,7]} >>> d.update( [[key,[x*2 for x in item]] for key,item in d.

Re: Multiplying all the values in a dictionary

2006-03-23 Thread Scott David Daniels
John McMonagle wrote: > Say I have a dictionary like below: > > d = {(100,500):[5,5], (100,501):[6,6], (100,502):[7,7]} > > Say I want to multiply all the values of the dictionary by 2: > for key in d.keys(): > d[key] = map(lambda x: x*2, d.get(key)) > Is there a better/faster/cleaner way to ac

Re: Question about raw string and regex

2006-03-23 Thread jlowery
I doubt it, although it might work anyway. Here's another from the same program: (a0, b0), (a1, b1), (a2, b2) = classprog.regs[:3] Nothing in the Python lib reference on the regs attribute for regex objects. -- http://mail.python.org/mailman/listinfo/python-list

Announcing xe and PyFeed, for XML and syndication feeds

2006-03-23 Thread Steve R. Hastings
xe.py is a Python module to make it very easy to work with XML. I have attempted to make xe classes very Pythonic and intuitive. xe is intended for working with structured XML, such as syndication feed files, but I have added some support for unstructured XML as well. Example: >>> import xe >>>

Re: Question about raw string and regex

2006-03-23 Thread Felipe Almeida Lessa
Em Qui, 2006-03-23 às 17:11 -0800, [EMAIL PROTECTED] escreveu: > Since the classexpr isn't a raw string (not r prefix), doesn't the \t > get converted to a tab character before it gets to the regex compiler? >>> print '^\([ \t]*class +[a-zA-Z0-9_]+\) *( *) *\(\(=.*\)?\):' ^\([]*class +[a-zA-Z0

Re: Multiplying all the values in a dictionary

2006-03-23 Thread Felipe Almeida Lessa
Em Sex, 2006-03-24 às 11:04 +1000, John McMonagle escreveu: > Is there a better/faster/cleaner way to achieve this ? Maybe... for key in d: d[key] = [x*2 for x in d[key]] ...? I can't thing of anything better :(... HTH, -- Felipe. -- http://mail.python.org/mailman/listinfo/python-

Question about raw string and regex

2006-03-23 Thread jlowery
I'm looking through the tools/scripts folder from the python install, trying to get reacquanted with the language. Got a question on the following classfix.py snippet: # This expression doesn't catch *all* class definition headers, # but it's pretty darn close. classexpr = '^\([ \t]*class +[a-zA-

Multiplying all the values in a dictionary

2006-03-23 Thread John McMonagle
Say I have a dictionary like below: d = {(100,500):[5,5], (100,501):[6,6], (100,502):[7,7]} Say I want to multiply all the values of the dictionary by 2: for key in d.keys(): d[key] = map(lambda x: x*2, d.get(key)) Is there a better/faster/cleaner way to achieve this ? Thanks, John -- Th

Re: Multiplying sequences with floats

2006-03-23 Thread Christoph Zwerschke
Dan Sommers wrote: > Christoph Zwerschke wrote: >> I was wondering whether this should be allowed, i.e. multiplication of >> a sequence with a float. There could be either an implicit typecast to >> int (i.e. rounding) ... > > Explicit is better than implicit. I already knew using the word "impli

Re: UPDATE imap folder scanner

2006-03-23 Thread Kun
Okay So I got the 'search' part to work, which outputs me a long list of message numbers. how do i use that list of message numbers to fetch the 'from' address for each one and send them a confirmation email? is this some sort for loop? any help would be greatly appreciated. cheers. Kun wrot

Re: Multiplying sequences with floats

2006-03-23 Thread Dan Sommers
On Fri, 24 Mar 2006 00:35:44 +0100, Christoph Zwerschke <[EMAIL PROTECTED]> wrote: > Currently, if you write 3*'*', you will get '***', but if you write > 3.0*'*', you will get an error (can't multiply sequence by non-int). > I was wondering whether this should be allowed, i.e. multiplication of

Re: datetime iso8601 string input

2006-03-23 Thread Ben Finney
Magnus Lycka <[EMAIL PROTECTED]> writes: > As I've written before, the ISO 8601 spec contains many variations > in date formats. Making a full ISO 8601 parser is probably possible > if we ignore time deltas, but it's hardly worth the effort. Writing > something that parses a few percent of the pos

imap folder scanner

2006-03-23 Thread Kun
Hey guys, I would like to have a code in python (as simple as possible) to scan a specific folder in my mailbox and if the subject is equal to, say, 'BIKES', I would like to have the code automatically send the SENDER an email saying something like "We have received your Email". Furthermore, I

Re: Remove integer from float number

2006-03-23 Thread Ben Finney
"Michael Yanowitz" <[EMAIL PROTECTED]> writes: > Sorry, got it backwards: You also got the reply backwards (in both cases). http://en.wikipedia.org/Top_posting> -- \"No one ever went broke underestimating the taste of the | `\American public." --

Terminating a subprocess '.exe'

2006-03-23 Thread Ernesto
I launch a Windows executable and wish to close it from Python. The code is below. Normally, my program waits for rib.exe to finish, but I'd like to be able to close it from python if possible. (I suppose if I was going to do this, I wouldn't use .wait() ) Any ideas ? # Launch a program witho

Multiplying sequences with floats

2006-03-23 Thread Christoph Zwerschke
Currently, if you write 3*'*', you will get '***', but if you write 3.0*'*', you will get an error (can't multiply sequence by non-int). I was wondering whether this should be allowed, i.e. multiplication of a sequence with a float. There could be either an implicit typecast to int (i.e. roun

Command line option -Q (floor division)

2006-03-23 Thread Christoph Zwerschke
I noticed that contrary to what is said in http://www.python.org/doc/2.2.3/whatsnew/node7.html, namely that integer divison should print deprecation warnings beginning with Python 2.3, even Python 2.4 is still quiet about it, i.e. you still need to explicitely set the -Q warn option to see the warn

Re: Python has a new Logo

2006-03-23 Thread Robert Hicks
You are s lame. -- http://mail.python.org/mailman/listinfo/python-list

Re: Can't get the real contents form page in internet as the tag "no-chche"

2006-03-23 Thread John J. Lee
"dongdong" <[EMAIL PROTECTED]> writes: > oh~~~! offer my thanks to Tim Roberts and all persons above! > I see now, it's the different url causes! > contents can only be got from the later (real ) url. > I made a mistick not to look at the different urls taking effect. If you use ClientCooki

Re: encoding problems (é and è)

2006-03-23 Thread John Machin
On 24/03/2006 8:36 AM, Peter Otten wrote: > John Machin wrote: > >>You can replace ALL of this upshifting and accent removal in one blow by >>using the string translate() method with a suitable table. > > Only if you convert to unicode first or if your data maintains 1 byte == 1 > character, in p

Re: Remove integer from float number

2006-03-23 Thread Grant Edwards
On 2006-03-23, Michael Yanowitz <[EMAIL PROTECTED]> wrote: > Sorry, got it backwards: > def printDecimal(number): > if (number >= 0): > print number - int(number) > else: > print int(number) - number Still top posted and still doesn't work: >>> def printDecimal(number): .

Re: Remove integer from float number

2006-03-23 Thread Grant Edwards
On 2006-03-23, Michael Yanowitz <[EMAIL PROTECTED]> wrote: >> With that terse description and the subject line I would interpret the >> OP like so: >> > print re.sub(".*\.",".","0.666") >> .666 > print re.sub(".*\.",".","123.666") >> .666 > > Or if you're allergic to regular expressions: >

RE: Remove integer from float number

2006-03-23 Thread Michael Yanowitz
Sorry, got it backwards: def printDecimal(number): if (number >= 0): print number - int(number) else: print int(number) - number -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Michael Yanowitz Sent: Thursday, March 23, 2006 5:21

RE: RELEASED Python 2.4.3, release candidate 1

2006-03-23 Thread Delaney, Timothy (Tim)
Fredrik Lundh wrote: > (and there was never 96 real errors in the code base, of course; > coverity is a remarkable tool, but there's plenty of room for > mistakes when used on a code base this large) Yep - from the discussions on python-dev, a lot of the "error-fixing" was telling Coverity what t

RE: Remove integer from float number

2006-03-23 Thread Michael Yanowitz
how about this solution: def printDecimal(number): if (number < 0): print number - int(number) else: print int(number) - number -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Grant Edwards Sent: Thursday, March 23, 2006 5:11 PM

Re: Per instance descriptors ?

2006-03-23 Thread bruno at modulix
Steven Bethard wrote: (snip code) > > But that looks pretty nasty to me. > It sounds like your architecture > could use some redesigning Done - in much more sane way. Got rid of some more boilerplate and of the whole problem of per-instance descriptors BTW !-) I should probably sleep more

Re: python-announce moderation (was: Re: ANN: ClientForm 0.2.2 released)

2006-03-23 Thread John J. Lee
[EMAIL PROTECTED] (Aahz) writes: [...] > H hschilling is NOT one of the python-announce moderators, so I see. > zir e-mail setup is probably b0rken, accounting for all the problems you > mentioned. Could be. > I frequently send e-mail to python-announce, python-list, and > baypiggies

Re: Remove integer from float number

2006-03-23 Thread Grant Edwards
On 2006-03-23, Arne Ludwig <[EMAIL PROTECTED]> wrote: > With that terse description and the subject line I would interpret the > OP like so: > print re.sub(".*\.",".","0.666") > .666 print re.sub(".*\.",".","123.666") > .666 Or if you're allergic to regular expressions: >>> print "." +

Re: Function params with **? what do these mean?

2006-03-23 Thread Ben Finney
Scott David Daniels <[EMAIL PROTECTED]> writes: > At the risk of being thought of as beating a dead horse, this was a > _great_ way to ask this question. [...] > So, anyhow, thanks for taking the time to write your question properly. Take that risk, please. There's enough lambasting of (and proba

Re: An Efficient Scalar Class in Python

2006-03-23 Thread konrad . hinsen
On 23.03.2006, at 22:48, Ben Finney wrote: > "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > >> A Python class was designed to represent physical scalars and to >> eliminate errors involving implied physical units (e.g., confusing >> angular degrees and radians). > > This sounds like a useful ab

Re: Getting a loop to activate a loop above it

2006-03-23 Thread Arne Ludwig
I think the problem is this line: > x == input('What is x now?: ') which should not have a == but a = -- http://mail.python.org/mailman/listinfo/python-list

Re: Remove integer from float number

2006-03-23 Thread Arne Ludwig
With that terse description and the subject line I would interpret the OP like so: >>> print re.sub(".*\.",".","0.666") .666 >>> print re.sub(".*\.",".","123.666") .666 -- http://mail.python.org/mailman/listinfo/python-list

Re: removing file by inode

2006-03-23 Thread Arne Ludwig
Actually under Linux he could probably pipe "clri %d" to debugfs if that is what he wanted to do. On the other hand he said "unix environment" which could be anything really. -- http://mail.python.org/mailman/listinfo/python-list

Re: An Efficient Scalar Class in Python

2006-03-23 Thread Ben Finney
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > A Python class was designed to represent physical scalars and to > eliminate errors involving implied physical units (e.g., confusing > angular degrees and radians). This sounds like a useful abstraction; I'm not sure if there are established ways

Re: Convert Word .doc to Acrobat .pdf files

2006-03-23 Thread kbperry
Thanks again Duncan! I will use the OpenOffice solution as a last resort. It isn't the standard office suite at my corp. I would like the code to be as portable as possible, and it would seem like a pain in the arse to have the end user install OpenOffice just to run my script. Sure it would ju

Re: encoding problems (é and è)

2006-03-23 Thread Peter Otten
John Machin wrote: > You can replace ALL of this upshifting and accent removal in one blow by > using the string translate() method with a suitable table. Only if you convert to unicode first or if your data maintains 1 byte == 1 character, in particular it is not UTF-8. Peter -- http://mail.

Re: removing file by inode

2006-03-23 Thread Arne Ludwig
> under SunOS there was a way to delete a file given it's i-node. Yes and no. You probably mean "clri" which cleared the inode, but did not "remove the file", i.e. all the entries in directories pointing to it. In older Unices there was also "ncheck" to find the filesystem names for inode numbers

Re: Remove integer from float number

2006-03-23 Thread Larry Bates
John Machin wrote: > On 24/03/2006 6:44 AM, Larry Bates wrote: >> Derek Basch wrote: >> >>> How can I return: >>> >>> ".666" >>> >>> from float: >>> >>> "0.666" >>> >>> This is what I have so far: >>> >>> >> "%.6f" % x >>> >>> Thanks Everyone, >>> Derek Basch >>> >> >> >> This works but I'm not

Re: boost python tutorial

2006-03-23 Thread Roman Yakovenko
On 23 Mar 2006 12:36:17 -0800, MakaMaka <[EMAIL PROTECTED]> wrote: > I checked and it is. I can't use news servers at work b/c of the > firewall. Is there another way to access this mailing list? Yes, try to subscribe: http://www.python.org/community/sigs/. See c++-sig If you can use your mail o

Re: encoding problems (é and è)

2006-03-23 Thread John Machin
On 23/03/2006 10:07 PM, bussiere bussiere wrote: > hi i'am making a program for formatting string, > or > i've added : > #!/usr/bin/python > # -*- coding: utf-8 -*- > > in the begining of my script but > > str = str.replace('Ç', 'C') > str = str.replace('é', 'E') > str = str.repl

COM callbacks in Python

2006-03-23 Thread Dan
I need to register for a COM callback under Windows. I am using an ADO recordset interface like this: import win32com.client import time connect = win32com.client.Dispatch("ADODB.Connection") recordset = win32com.client.Dispatch("ADODB.Recordset") connect.Open("Driver={SQLServer};Server=devserver

Re: Integrating python with smalltalk

2006-03-23 Thread Chronos
nelson wrote: > On windows i know i can create in > python a COM server and call it from smalltalk, but i wonder if there > is a more general solution (platform independent). SOAP. -- http://mail.python.org/mailman/listinfo/python-list

Re: python-announce moderation (was: Re: ANN: ClientForm 0.2.2 released)

2006-03-23 Thread Aahz
In article <[EMAIL PROTECTED]>, John J. Lee <[EMAIL PROTECTED]> wrote: >[EMAIL PROTECTED] (Aahz) writes: >> In article <[EMAIL PROTECTED]>, >> John J Lee <[EMAIL PROTECTED]> wrote: >>> >>>Hmm, [EMAIL PROTECTED], who are you? python-announce moderator? I >>>didn't put you on my To: line (nor pyt

Re: Barking up the wrong tree with extension types and modules?

2006-03-23 Thread Robert Kern
Steve Juranich wrote: > We have a large suite of "legacy" tools (based on stand-alone executables > and shell scripts) that we would like to integrate into a suite of Python > modules. I'm having a little trouble getting my head around how the best > way to implement the whole thing, though. > >

Re: boost python tutorial

2006-03-23 Thread MakaMaka
I checked and it is. I can't use news servers at work b/c of the firewall. Is there another way to access this mailing list? -- http://mail.python.org/mailman/listinfo/python-list

Barking up the wrong tree with extension types and modules?

2006-03-23 Thread Steve Juranich
We have a large suite of "legacy" tools (based on stand-alone executables and shell scripts) that we would like to integrate into a suite of Python modules. I'm having a little trouble getting my head around how the best way to implement the whole thing, though. Here's (roughly) the situation: W

Re: RELEASED Python 2.4.3, release candidate 1

2006-03-23 Thread Fredrik Lundh
"Paddy" wrote: > I followed the links to the coverity page that shows their table of > errors found, and subsequently fixed in tools used for the LAMP stack. > They say that they informed the maintainers of the software about the > precise errors found and the number of errors has been tracked sin

Re: Function params with **? what do these mean?

2006-03-23 Thread Scott David Daniels
J Rice wrote: > I'm sorry for such a basic question, but I haven't been able to phrase > a search that gets me an answer and my books are totally silent on > this. I have seen a number of python function defs that take > parameters of the form (**param1). Looks like a pointer... but my > books on

Re: How to find out the next Friday using RelativeDateTime

2006-03-23 Thread fumanchu
> a = now() > delta = ReltaiveDateTime(days=+6, weekday(mx.DateTime.Friday, 0)) > Next Friday: a+delta > a: march 23 > a+delta: Gives me March 31st and not March 24th > Any ideas? Just an off-beat idea: use Python's datetime instead of mx.DateTime, and my recur module: http://projects.amor.org/mis

Re: MS word document generator

2006-03-23 Thread Raja Raman Sundararajan
Hi paron, I am using PyRTF as of now and it seems to fit my need quite well and it works like a charm :-). I have made a wrapper around it so that it will easier for me to switch the backend for generating the word/RTF docs later. May be, it will be openoffice :-) I appreciate your input. Thank

Re: RELEASED Python 2.4.3, release candidate 1

2006-03-23 Thread Paddy
I followed the links to the coverity page that shows their table of errors found, and subsequently fixed in tools used for the LAMP stack. They say that they informed the maintainers of the software about the precise errors found and the number of errors has been tracked since then. It seems there

Re: Remove integer from float number

2006-03-23 Thread John Machin
On 24/03/2006 6:44 AM, Larry Bates wrote: > Derek Basch wrote: > >>How can I return: >> >>".666" >> >>from float: >> >>"0.666" >> >>This is what I have so far: >> >> >"%.6f" % x >> >>Thanks Everyone, >>Derek Basch >> > > > This works but I'm not entirely sure I know what you are > trying to

Re: Remove integer from float number

2006-03-23 Thread Paul Rubin
"Derek Basch" <[EMAIL PROTECTED]> writes: > Ahh yes you have to put parenthases around the string formatting to > remove the integer using indexes. Thanks, that's just what I needed! I think it's better to remove leading zeros explicitly: ('%.3x' % x).lstrip('0') -- http://mail.python.org/ma

Re: beginer question of list comprehensions

2006-03-23 Thread Larry Bates
Echo wrote: > Ok, this is the first list comprehension that I have done. > Surprisinly, it works for the most part. > The problem with it is that it returns a list with two lists in it, > instead of just one list. Can anyone tell me what I am doing wrong or > how to fix it. > > Here is my code: >

Find Paths in log text - How to?

2006-03-23 Thread citizenkahn
I am trying to parse a build log for errors. I figure I can do this one of three ways: - find the absolute platonic form of an error and search for that item - create definitions of what patterns describe errors for each tool which is used (ant, MSDEV, etc). - rework the build such that all the re

Re: python-announce moderation (was: Re: ANN: ClientForm 0.2.2 released)

2006-03-23 Thread John J. Lee
[EMAIL PROTECTED] (Aahz) writes: > In article <[EMAIL PROTECTED]>, > John J Lee <[EMAIL PROTECTED]> wrote: > > > >Hmm, [EMAIL PROTECTED], who are you? python-announce moderator? I > >didn't put you on my To: line (nor python-list for that matter, but I > >guess that's a reasonable place for i

Re: boost python tutorial

2006-03-23 Thread Roman Yakovenko
On 23 Mar 2006 11:17:46 -0800, MakaMaka <[EMAIL PROTECTED]> wrote: > Hi, > I'm trying to build the basic boost.python tutorial that comes with the > distribution. I'm using bjam and mingw. It builds the module, but > upon import, it gives this error: > > ImportError: dynamic module does not defin

Re: Remove integer from float number

2006-03-23 Thread Derek Basch
Ahh yes you have to put parenthases around the string formatting to remove the integer using indexes. Thanks, that's just what I needed! Derek Basch -- http://mail.python.org/mailman/listinfo/python-list

Re: How to find out the next Friday using RelativeDateTime

2006-03-23 Thread John Machin
On 24/03/2006 6:30 AM, vj wrote: > I figured out how to do it. This does not work: > > delta = ReltaiveDateTime(days=0, weekday(mx.DateTime.Friday, 0)) > > But this works: > > delta = ReltaiveDateTime(days=+0, weekday(mx.DateTime.Friday, 0)) > vj, NEITHER of those work, because you still have

Re: Remove integer from float number

2006-03-23 Thread Larry Bates
Derek Basch wrote: > How can I return: > > ".666" > > from float: > > "0.666" > > This is what I have so far: > "%.6f" % x > > Thanks Everyone, > Derek Basch > This works but I'm not entirely sure I know what you are trying to accomplish. ("%.3f" % x)[1:] -Larry Bates -- http://mai

Remove integer from float number

2006-03-23 Thread Derek Basch
How can I return: ".666" from float: "0.666" This is what I have so far: >>> "%.6f" % x Thanks Everyone, Derek Basch -- http://mail.python.org/mailman/listinfo/python-list

Re: How to find out the next Friday using RelativeDateTime

2006-03-23 Thread vj
Thanks for pointing out that the days=+0 is not necessary. Your other points are well noted. Thanks VJ -- http://mail.python.org/mailman/listinfo/python-list

Re: How to find out the next Friday using RelativeDateTime

2006-03-23 Thread John Machin
On 24/03/2006 5:18 AM, Dennis Lee Bieber wrote: > On 23 Mar 2006 09:37:13 -0800, "vj" <[EMAIL PROTECTED]> declaimed the > following in comp.lang.python: > > >>I'm doing: >> >>a = now() >>delta = ReltaiveDateTime(days=+6, weekday(mx.DateTime.Friday, 0)) >>Next Friday: a+delta >> >>a: march 23 >>a+

Re: How to find out the next Friday using RelativeDateTime

2006-03-23 Thread vj
I figured out how to do it. This does not work: delta = ReltaiveDateTime(days=0, weekday(mx.DateTime.Friday, 0)) But this works: delta = ReltaiveDateTime(days=+0, weekday(mx.DateTime.Friday, 0)) -- http://mail.python.org/mailman/listinfo/python-list

  1   2   3   >