Re: Exception in Python 2.3.3 Interpreter

2005-05-09 Thread Fredrik Lundh
(trying again) "Saravanan D" wrote: > > > 03 023ffaa4 1e013182 055b1250 00637470 python23!cmp_outcome(int > op > > > = 88026108, struct _object * v = 0x0001, struct _object * w = > > > 0x)+0xa9 [F:\Python-2.3.3\Python-2.3.3\Python\ceval.c @ 3880] > > > 04 023ffb18 1e016ba4 01

Re: Exception in Python 2.3.3 Interpreter

2005-05-09 Thread Fredrik Lundh
"Saravanan D" wrote: > > > 03 023ffaa4 1e013182 055b1250 00637470 python23!cmp_outcome(int > op > > > = 88026108, struct _object * v = 0x0001, struct _object * w = > > > 0x)+0xa9 [F:\Python-2.3.3\Python-2.3.3\Python\ceval.c @ 3880] > > > 04 023ffb18 1e016ba4 014f3318 0002

Re: Advice needed on __del__

2005-05-09 Thread Fredrik Lundh
"phil" wrote: > If someone doesn't know the answer to this question or if noone > knows the answer to this question there is no answer to your question. Python works as specified in the language specification, and the language specification makes no guarantees. changes in the CPython interpreter

Re: Exception in Python 2.3.3 Interpreter

2005-05-09 Thread Terry Reedy
"Saravanan D" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >> > The crash occured at the following line: >> > c = strcmp(vname, wname) (object.c) > The above one is C Code. The same line is present in object.c file of > Python Interpreter Source and the function name is > defaul

Re: is there a python object which can interpret java-script?

2005-05-09 Thread Alexander Fillips
Kartic wrote: > The Great 'Alexander Fillips' uttered these words on 5/9/2005 7:34 AM: > >> Hi, >> >> my short question: >> >> is there a python object which can interpret java-script? >> >> the whole story ;-) >> >> I wrote some streaming-scripts for the xbox mediaplayer which supports >> python

Re: Exception in Python 2.3.3 Interpreter

2005-05-09 Thread Saravanan D
"Terry Reedy" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > "Saravanan" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > Im running Python Application as a Windows Service (using windows > > extensions). But, sporadically the application crashes (crash in > > Py

Re: Exception in Python 2.3.3 Interpreter

2005-05-09 Thread Saravanan D
"Fredrik Lundh" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > "Saravanan D" <[EMAIL PROTECTED]> wrote: > > > 03 023ffaa4 1e013182 055b1250 00637470 python23!cmp_outcome(int op > > = 88026108, struct _object * v = 0x0001, struct _object * w = > > 0x)+0xa9 [F:\Py

Re: Question: Threading and embedding python in an application

2005-05-09 Thread "Martin v. Löwis"
David Harrison wrote: > I am working on an application on Mac OS X that calls out > to python via PyImport_ImportModule(). I find that if > the imported module creates and starts a python thread, > the thread seems to be killed when the import of > the module is complete. Is this expected? No

Re: Exception in Python 2.3.3 Interpreter

2005-05-09 Thread Saravanan D
Hello, Component which uses only windows extension modules and callback from C++ to Python. - Saravanan D "Fredrik Lundh" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > "Saravanan D" <[EMAIL PROTECTED]> wrote: > > > 03 023ffaa4 1e013182 055b1250 00637470 python23!cmp_outc

sync dir's

2005-05-09 Thread Timothy Smith
what would be the best tool to use to sync my local dir with a remote one, say off a http resorce (although i'm open to other options there) i haven't gotten any feed back on my problems with loading pysvn on win98, and i can apprechiate if the dev's are too busy/can't be bothered with win98. b

Re: Resize an Image without PIL

2005-05-09 Thread Bengt Richter
On 9 May 2005 09:51:34 -0700, [EMAIL PROTECTED] wrote: >Hi I would like to know how to resize an Image without using python >Imaging library. > You don't say how your image is represented, nor whether you require the same representation on both ends of the transformation. You don't say anything ab

[ANN] new version of rur-ple (0.8.5)

2005-05-09 Thread André Roberge
Version 0.8.5 of rur-ple has been released. The web site has completely changed; it includes over 35 pages. http://rur-ple.sourceforge.net/ -- Learning to program computer should be fun, for adults and children alike. RUR-PLE is an environment designed to help

Re: __brace__ (PEP?)

2005-05-09 Thread Ron Adam
James Stroud wrote: > Hello All, > > If "__call__" allows anobject() and "__getitem__" allows anobject[arange], > why > not have "__brace__" (or some other, better name) for anobject{something}. > Such braces might be useful for cross-sectioning nested data structures: > > anary = [[1,2,3],[4,

Re: Inverse confusion about floating point precision

2005-05-09 Thread Bengt Richter
On 9 May 2005 11:06:22 -0700, "Dan Bishop" <[EMAIL PROTECTED]> wrote: >Skip Montanaro wrote: >> I understand why the repr() of float("95.895") is >"95.8949996". >> What I don't understand is why if I multiply the best approximation >to >> 95.895 that the machine has by 1 I magically se

Question: Threading and embedding python in an application

2005-05-09 Thread David Harrison
I am working on an application on Mac OS X that calls out to python via PyImport_ImportModule(). I find that if the imported module creates and starts a python thread, the thread seems to be killed when the import of the module is complete. Is this expected? Does python have to be in control t

Re: pyvm -- faster python

2005-05-09 Thread Dan Christensen
djw <[EMAIL PROTECTED]> writes: > Paul Rubin wrote: >> Stelios Xanthakis <[EMAIL PROTECTED]> writes: >> >>>- The demo is an x86/linux binary only. You shouldn't trust binaries, >>> run it in a chrooted environment not as root! >> >> >> Are you going to release the source? If not, it's a lot

Re: Advice needed on __del__

2005-05-09 Thread André Roberge
Scott David Daniels wrote: > André Roberge wrote: > >>... Each time I refresh the screen, I could >>force that call, then check to see if Evil has been >>destroyed by Python, which would give me the information >>I need to destroy Evil_twin behind the scene myself - >>which is what I am really af

Re: Unique Elements in a List

2005-05-09 Thread Rune Strand
You're right. I somehow missed the index part :-o. It's easy to fix though. -- http://mail.python.org/mailman/listinfo/python-list

Re: Unique Elements in a List

2005-05-09 Thread Paul Rubin
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > Is there an easy way to grab the Unique elements from a list? > For Example: > data = [0.1,0.5,0.6,0.4,0.1,0.5,0.6,0.9] Untested: here's an iterator that gives you the index and value, without reordering. Uses dicts instead of sets for backwards c

Re: Unique Elements in a List

2005-05-09 Thread Aahz
In article <[EMAIL PROTECTED]>, runes <[EMAIL PROTECTED]> wrote: > >This is not the most beautiful idiom, but it works... > >d = {} >for k in data: >try: >d[k] += 1 >except: >d[k] = 1 > >for k,v in d.items(): >if v == 1: >print k Only if "works" does not include

Re: Advice needed on __del__

2005-05-09 Thread phil
> > Fredrik Lundh wrote: > >>Python is not C++. >> Praise the Lord. >> > > I dunno if this makes QOTW, but I vote we put this in our list text that > goes out with each and every list message. > > There will still be a lot of people who don't read it, but at least > we'll get to say, "We t

Re: Advice needed on __del__

2005-05-09 Thread Mike Meyer
phil <[EMAIL PROTECTED]> writes: > By the way, I understand that __del__ is only called when the last > reference to an instance is deled. That's fine, if consistent. Actually, __del__ is called when the instance is garbage collected. Exactly when that is is implementation dependent. In the impl

Re: Unique Elements in a List

2005-05-09 Thread Michael J. Fromberger
In article <[EMAIL PROTECTED]>, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Is there an easy way to grab the Unique elements from a list? > For Example: > data = [0.1,0.5,0.6,0.4,0.1,0.5,0.6,0.9] > > what I am looking for is the unique elements 0.4 and 0.9 with their > index from the list.

Re: Advice needed on __del__

2005-05-09 Thread Ivan Van Laningham
Hi All-- Fredrik Lundh wrote: > > Python is not C++. > I dunno if this makes QOTW, but I vote we put this in our list text that goes out with each and every list message. There will still be a lot of people who don't read it, but at least we'll get to say, "We told you so." -ly y'rs, Ivan;-)

Re: Advice needed on __del__

2005-05-09 Thread Scott David Daniels
André Roberge wrote: > ... Each time I refresh the screen, I could > force that call, then check to see if Evil has been > destroyed by Python, which would give me the information > I need to destroy Evil_twin behind the scene myself - > which is what I am really after. What might work is to keep

Re: Unique Elements in a List

2005-05-09 Thread bearophileHUGS
runes: > d = {} > for k in data: > try: > d[k] += 1 > except: > d[k] = 1 > > for k,v in d.items(): > if v == 1: > print k For this problem, if duplicated keys are common enough, this version is probably the faster. With this *different* problem, it seems that

Re: file corruption on windows - possible bug

2005-05-09 Thread Bengt Richter
On Mon, 09 May 2005 10:54:22 -0400, Jeremy Jones <[EMAIL PROTECTED]> wrote: >I've written a piece of code that iterates through a list of items and >determines the filename to write some piece of data to based on >something in the item itself. Here is a small example piece of code to >show the ty

RE: py23-pysvn-svn114-1.2.0-415.exe << won't load on win98

2005-05-09 Thread Timothy Smith
hello there, i get the following error when attempting to load pysvn on a win98 system Traceback (most recent call last): > File "PubWare.py", line 11, in ? > File "Main.pyc", line 46, in ? > File "pysvn\__init__.pyc", line 12, in ? > File "pysvn\_pysvn.pyc", line 9, in ? > File "pysvn\_pysvn

Re: Unique Elements in a List

2005-05-09 Thread runes
Your set-approach is very nice, but if the list of data is huge, it is rather slow because you'll have to loop through the data list and count every member. -- http://mail.python.org/mailman/listinfo/python-list

Re: replace string patern with different value

2005-05-09 Thread Bengt Richter
On Mon, 9 May 2005 15:48:14 +0200, "Fredrik Lundh" <[EMAIL PROTECTED]> wrote: >Bill Mill wrote: > > for rep in L: >> ... source = source.replace(token, rep, 1) > >here's another way to do it: > L = ["11", "22", "33"] S = "xyzzy text we've got xyzzy text xyzzy yeah yeah yeah"

Re: Unique Elements in a List

2005-05-09 Thread James Stroud
On Monday 09 May 2005 03:15 pm, [EMAIL PROTECTED] wrote: > Is there an easy way to grab the Unique elements from a list? > For Example: > data = [0.1,0.5,0.6,0.4,0.1,0.5,0.6,0.9] > > what I am looking for is the unique elements 0.4 and 0.9 with their > index from the list. > Probably something like

Unique Elements in a List

2005-05-09 Thread James Stroud
On Monday 09 May 2005 03:15 pm, [EMAIL PROTECTED] wrote: > Is there an easy way to grab the Unique elements from a list? from sets import Set data = [0.1,0.5,0.6,0.4,0.1,0.5,0.6,0.9] [x for x in Set(data) if data.count(x) == 1] -- James Stroud UCLA-DOE Institute for Genomics and Proteomics Box

Re: Unique Elements in a List

2005-05-09 Thread Roie Kerstein
[EMAIL PROTECTED] wrote: > Is there an easy way to grab the Unique elements from a list? > Yes. The set data type. Look in the reference of python 2.4. -- Best regards Roie Kerstein -- http://mail.python.org/mailman/listinfo/python-list

Re: Unique Elements in a List

2005-05-09 Thread [EMAIL PROTECTED]
OK I need to be more clear I guess!Unique Elements I mean, elements that are non repeating. so in the above list 0.4, 0.9 are unique as they exist only once in the list. -- http://mail.python.org/mailman/listinfo/python-list

Re: Unique Elements in a List

2005-05-09 Thread runes
This is not the most beautiful idiom, but it works... d = {} for k in data: try: d[k] += 1 except: d[k] = 1 for k,v in d.items(): if v == 1: print k -- http://mail.python.org/mailman/listinfo/python-list

Re: Encryption with Python?

2005-05-09 Thread Paul Rubin
"Anthra Norell" <[EMAIL PROTECTED]> writes: > I don't follow. There is no bitwise correlation between a plain-text > character and its encoded equivalent. What's more, there is no detectable > correlation at all. Your question was how could you tell if two ciphertexts were encrypted with the same

Re: Language documentation ( was Re: Computing Industry shams)

2005-05-09 Thread Sean Burke
alex goldman <[EMAIL PROTECTED]> writes: > vermicule wrote: > > > > > What is so hard to understand ? > > Should be perfectly clear even to a first year undergraduate. > > > > As for "greedy" even a minimal exposure to Djikstra's shortest path > > algorithm would have made the concept intuitiv

Dr. Dobb's Python-URL! - weekly Python news and links (May 9)

2005-05-09 Thread Simon Brunning
QOTW: "It's not perfect, but then nobody in this thread has offered anything even remotely resembling perfect documentation for regular expressions yet. " - Peter Hansen "Python's flavor of OO is perfectly valid and usable, even though it doesn't follow the Java Holy Bible of Object Orientation (g

Unique Elements in a List

2005-05-09 Thread [EMAIL PROTECTED]
Is there an easy way to grab the Unique elements from a list? For Example: data = [0.1,0.5,0.6,0.4,0.1,0.5,0.6,0.9] what I am looking for is the unique elements 0.4 and 0.9 with their index from the list. Probably something like a Hash Table approach!! I would like to get this done without unneces

Re: pyvm -- faster python

2005-05-09 Thread djw
Paul Rubin wrote: > Stelios Xanthakis <[EMAIL PROTECTED]> writes: > >>- The demo is an x86/linux binary only. You shouldn't trust binaries, >> run it in a chrooted environment not as root! > > > Are you going to release the source? If not, it's a lot less interesting. From the website: "..

Re: Encryption with Python?

2005-05-09 Thread Anthra Norell
Paul, I thank you too for your response. Let me just tell you what goes through my mind. - Original Message - From: "Paul Rubin" <"http://phr.cx"@NOSPAM.invalid> Newsgroups: comp.lang.python To: Sent: Monday, May 09, 2005 9:45 PM Subject: Re: Encryption with Python? > "Anthra Nor

Re: Trouble saving unicode text to file

2005-05-09 Thread "Martin v. Löwis"
John Machin wrote: > Terminology disambiguation: what I call "users" wouldn't know what > 'cp1252' and 'iso-8859-1' were. They're not expected to know. They > just type in whatever characters they can see on their keyboard or > find in the charmap utility. It's what I'd call 'admins' and > 'develop

GTK progress bar not working properly with pulse()

2005-05-09 Thread lamthierry
My python file(progressbar.py) looks like the following: pbar = gtk.ProgressBar() def updateBar(percentage): print percentage pbar.pulse() class ProgressBar: def __init__(self): # other gui codes align.add(pbar) pbar.show() My C++ codes look like the followi

Re: Resize an Image without PIL

2005-05-09 Thread James Carroll
Or if you're using wxPython, wx.Image can load, rescale and save. There's also a Python wrapper for imageMagick, which will do just about anything to medium-small files. One way or another you'll need to incorporate (depend on) something that can decode the various image file formats that you nee

cimport from different packages [Pyrex]

2005-05-09 Thread George Sakkis
Does cimport work for importing from different packages in Pyrex ? Here's a minimal example: # in ./foo/bar.pxd cdef class Bar: cdef int i # in ./foo/bar.pyx cdef class Bar: def __init__(self, i): self.i = i # in ./tmp.pyx cimport foo.bar $ pyrexc foo/bar.pyx $ pyrexc tmp.pyx tm

Re: Advice needed on __del__

2005-05-09 Thread André Roberge
Fredrik Lundh wrote: > André Roberge wrote: > > > >>This morning I had the following thought: >>I can, when I create a Jekyll object, update >>an outside_list. >>If, somehow, I could update that list when >>a Jekyll object disappears >>(perhaps by using __del__, which I have never touched) > >

Re: [Python.NET] Announce: Python for .NET 1.0 RC1 released

2005-05-09 Thread Guy Robinson
Great Stuff!!! >(probably including a few specific > examples of embedding Python for .NET in a .NET application). Cool!! :-) Guy Brian Lloyd wrote: > Hi all - > > I'm happy to announce the release of Python for .NET 1.0 RC1. > You can download it from: > > http://www.zope.org/Members/Bri

Re: Advice needed on __del__

2005-05-09 Thread Fredrik Lundh
"phil" wrote: > > Python makes no guarantees whatsover about when and how to > > run __del__, so relying on it to remove user-visible resources is a > > rather bad idea. > What does that mean? Is it a destructor or not? it's a finalizer. most Python implementations do a reasonable attempt to c

PyAr - Python Argentina 9th Meeting, this Thursday

2005-05-09 Thread Batista, Facundo
Title: PyAr - Python Argentina 9th Meeting, this Thursday The Argentine Python User Group, PyAr, will have its nineth meeting this Thursday, May 12nd at 7:00pm. Agenda -- Despite our agenda tends to be rather open, this time we would like to cover these topics: - See what we'll do w

Re: global lists

2005-05-09 Thread Dan Christensen
andrea crotti <[EMAIL PROTECTED]> writes: > Hi everbybody again, > I have a little "problem", I don't understand the reason of this: > > a = [10,1,2,3] > def foo(): > global a > for n in range(len(a)): > a[n] = a[n]*2 If I type the above, and then call foo, I get what looks like reasonabl

Re: Declaring self in PyObject_CallMethod

2005-05-09 Thread Fredrik Lundh
"[EMAIL PROTECTED]" wrote: > Calling a python method from C++ has the following signature: > > PyObject * > PyObject_CallMethod(PyObject *self, char *method_name, > char *arg_format, ...); > > I'm having trouble figuring out how to declare self. Reading the C API documentation

Re: Encryption with Python?

2005-05-09 Thread Paul Rubin
"Anthra Norell" <[EMAIL PROTECTED]> writes: > The non-randomness of the difference is evidence of having guessed the key, > right? Why then do I need two samples? If I hack away at a single sample I > get a probably more conspicuous non-randomness twice as fast. No. Let's say you encrypt two asci

Re: Resize an Image without PIL

2005-05-09 Thread Larry Bates
PIL is the best way. Or you can call some external program to do it (using os.system). Larry Bates [EMAIL PROTECTED] wrote: > Hi I would like to know how to resize an Image without using python > Imaging library. > -- http://mail.python.org/mailman/listinfo/python-list

Re: Question about extending the interperter

2005-05-09 Thread Fredrik Lundh
"Eli" wrote: > I've followed the Python docs about extending the Python interperter > and created an extension library. > I've added my functions like this: > > static PyMethodDef pmylib_methods[] = { > {"foo", pmylib_foo, METH_VARARGS, "foo() doc string"}, > ... > } > static PyObject *pmylib_foo(

Re: Advice needed on __del__

2005-05-09 Thread Fredrik Lundh
André Roberge wrote: > This morning I had the following thought: > I can, when I create a Jekyll object, update > an outside_list. > If, somehow, I could update that list when > a Jekyll object disappears > (perhaps by using __del__, which I have never touched) Python makes no guarantees whatsov

Re: Strip white spaces from source

2005-05-09 Thread qwweeeit
Hi Richie, thank you for your answer. Your solution is interesting but does not take into account some white spaces (like those after the commas, before or after mathematical operands etc...). Besides that I'm a almost a newbie in Python, and I have the very old programmers' habits (I don't use cla

Re: Inverse confusion about floating point precision

2005-05-09 Thread Tim Peters
[Dan] >Dan> The floating-point representation of 95.895 is exactly >Dan> 6748010722917089 * 2**-46. [Skip Montanaro] > I seem to recall seeing some way to extract/calculate fp representation from > Python but can't find it now. I didn't see anything obvious in the > distribution. For Da

py2exe to share binary files

2005-05-09 Thread Laguna
Hi, With py2exe-0.3.3 for Python 2.2 in Windows XP, how to configure setup.py such that multiple executables can share the dll files (like wx*.dll etc.) as follows: # Source folders \Program1 Program1.py Program1WX.py \Program2 Program2.py Program2WX.py # Output binary folders \Sha

Re: Inverse confusion about floating point precision

2005-05-09 Thread Skip Montanaro
>> Why isn't the last result "958949.996"? IOW, how'd I get >> back the lost bits? Dan> You were just lucky. Thanks for the response (and to Tim as well). Dan> The floating-point representation of 95.895 is exactly Dan> 6748010722917089 * 2**-46. I seem to recall se

Re: __brace__ (PEP?)

2005-05-09 Thread Kay Schluehr
Roy Smith wrote: > "Kay Schluehr" <[EMAIL PROTECTED]> wrote: > > > Roy Smith wrote: > > > > > foo->bar ==> foo.__arrrow__(bar) > > > foo$bar ==> foo.__dollar__(bar) > > > foo#bar ==> foo.__hash__(bar) > > > foo::bar ==> foo.__scope__(bar) > > > > I'm strongly in favor for the arrow ( but with two "

Re: replace string patern with different value

2005-05-09 Thread [EMAIL PROTECTED]
Thank you. -- http://mail.python.org/mailman/listinfo/python-list

Dr. Dobb's Python-URL! - weekly Python news and links (May 9)

2005-05-09 Thread Simon Brunning
QOTW: "It's not perfect, but then nobody in this thread has offered anything even remotely resembling perfect documentation for regular expressions yet. " - Peter Hansen "Python's flavor of OO is perfectly valid and usable, even though it doesn't follow the Java Holy Bible of Object Orientation (g

Re: Inverse confusion about floating point precision

2005-05-09 Thread Dan Bishop
Skip Montanaro wrote: > I understand why the repr() of float("95.895") is "95.8949996". > What I don't understand is why if I multiply the best approximation to > 95.895 that the machine has by 1 I magically seem to get the lost > precision back. To wit: > > % python > Python 2

Re: Does anybody know the status of PyCon recordings?

2005-05-09 Thread Sébastien Boisgérault
http://www.pycon.org/talks/ Cheers, SB -- http://mail.python.org/mailman/listinfo/python-list

Advice needed on __del__

2005-05-09 Thread André Roberge
Suppose I have two classes: 'Jekyll' and 'Hyde' that are related in a particular way. When I create a Jekyll object, a Hyde one gets automatically created (and displayed on a screen). drum roll to announce Python script === Nice = Jekyll()# Nice_twin, a Hyde object, gets created. Nice.

Re: Inverse confusion about floating point precision

2005-05-09 Thread Tim Peters
[Skip Montanaro] > I understand why the repr() of float("95.895") is "95.8949996". > What I don't understand is why if I multiply the best approximation to > 95.895 that the machine has by 1 I magically seem to get the lost > precision back. To wit: > >% python >Python 2.3.4 (#

Does anybody know the status of PyCon recordings?

2005-05-09 Thread Bill Mill
Hey all, There was a lot of talk on this list about recording pycon 2005 talks, but I never saw any messages saying that they'd actually been recorded. The wiki page ( http://www.python.org/moin/PyConDC2005/TalkRecording ) doesn't give links to any recordings. Does anybody know if these recording

Inverse confusion about floating point precision

2005-05-09 Thread Skip Montanaro
I understand why the repr() of float("95.895") is "95.8949996". What I don't understand is why if I multiply the best approximation to 95.895 that the machine has by 1 I magically seem to get the lost precision back. To wit: % python Python 2.3.4 (#12, Jul 2 2004, 09:48:10)

Re: Listing of declared variables and functions

2005-05-09 Thread Bill Mill
On 9 May 2005 09:58:19 -0700, ohms377 <[EMAIL PROTECTED]> wrote: > Dear python users, > > In interactive mode, I was wondering if there is a way to list all > declared variables and functions (and from global workspace). > >>> x = 12 >>> z = 13 >>> import re >>> locals() {'__builtins__': , 're':

Listing of declared variables and functions

2005-05-09 Thread ohms377
Dear python users, In interactive mode, I was wondering if there is a way to list all declared variables and functions (and from global workspace). Thanks, -frankie -- http://mail.python.org/mailman/listinfo/python-list

Resize an Image without PIL

2005-05-09 Thread querypk
Hi I would like to know how to resize an Image without using python Imaging library. -- http://mail.python.org/mailman/listinfo/python-list

Re: Outlook-MAPI

2005-05-09 Thread erinhouston
This code should help. code import win32com.client olMailItem = 0x0 obj = win32com.client.Dispatch("Outlook.Application") newMail = obj.CreateItem(olMailItem) newMail.Subject = "This works" newMail.Body = "It worked aging\n" newMail.display() V.C.Sekhar wrote: > Hi there, > > Can any

Re: Calling a python function from C++

2005-05-09 Thread djw
[EMAIL PROTECTED] wrote: > Let's say I have a python function do some math like the following: > > def doMath(self): >self.val = self.val + 1 > > > How can I call this python function from C++? Assuming I have some sort > of Python wrapper around my C++ codes. > Elmer? http://elmer.source

Question about extending the interperter

2005-05-09 Thread Eli
Hi, I've followed the Python docs about extending the Python interperter and created an extension library. I've added my functions like this: static PyMethodDef pmylib_methods[] = { {"foo", pmylib_foo, METH_VARARGS, "foo() doc string"}, ... } static PyObject *pmylib_foo(PyObject *self, PyObject *a

Re: Exception in Python 2.3.3 Interpreter

2005-05-09 Thread Terry Reedy
"Saravanan" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Im running Python Application as a Windows Service (using windows > extensions). But, sporadically the application crashes (crash in > Python23.dll) and this stops the service. This problem cann't be > reproduced easily i

Re: include "apythonscript.py"

2005-05-09 Thread Duncan Booth
wrote: > Ah damn , that's the way. > > And what if you have a very big class and want to include some class > functions ? > > class ThisIsAClass: > def __init__(self): > > Here I want to import a class def > The usual way to handle that would be to not write a 'very big class' at a

Re: replace string patern with different value

2005-05-09 Thread Paul McGuire
Well, not to be left out, here is a pyparsing solution. But this looks suspiciously like some form of mail-merge or templating application. Google for 'python templating' for existing approaches to this problem. Interestingly, using an iterator of L sidesteps a number of other problems. My origi

Re: file corruption on windows - possible bug

2005-05-09 Thread Jeremy Jones
Fredrik Lundh wrote: Jeremy Jones wrote: # file_dict = {} a_list = [("a", "a%s" % i) for i in range(2500)] b_list = [("b", "b%s" % i) for i in range(2500)] c_list = [("c", "c%s" % i) for i in range(2500)] d_list = [("d", "d%s" % i) for i in range(2

Re: file corruption on windows - possible bug

2005-05-09 Thread Duncan Booth
Fredrik Lundh wrote: > you do realize that this opens the file again every time, so you end > up having 4x2500 file handles pointing to 4 physical files. that's a > bad idea. > Assuming he is using the common C Python most of those file handles get closed immediately after opening, so he never

M2Crypto SSL memory leaks - fixes or alternatives ??

2005-05-09 Thread adsheehan
Hi folks, I notice that M2Crypto (a python wrap of OpenSSL) leaks (haemorrhages) memory significantly and affects my long running app very badly. Does anyone know of fixes to this problem? Does anyone recommmend alternatives to M2C ? e.g pyopenssl. I notice that Guido Van Rossum has flamed abou

Re: Trouble saving unicode text to file

2005-05-09 Thread Fredrik Lundh
Max M wrote: >> (I just noticed that there's no euro sign on my swedish keyboard. I've >> never missed it ;-) > > It's probably "AltGR + E" like here in DK ah, there it is. almost entirely worn out. and it doesn't work. but a little fooling around reveals that AltGr+5 does work. oh well, you

Re: include "apythonscript.py"

2005-05-09 Thread martijn
Ah damn , that's the way. And what if you have a very big class and want to include some class functions ? class ThisIsAClass: def __init__(self): Here I want to import a class def -- http://mail.python.org/mailman/listinfo/python-list

Re: file corruption on windows - possible bug

2005-05-09 Thread Duncan Booth
Jeremy Jones wrote: > Here is a small example piece of code to > show the type of thing I'm doing:: > > # > file_dict = {} > > a_list = [("a", "a%s" % i) for i in range(2500)] > b_list = [("b", "b%s" % i) for i in range(2500)] > c_list = [("c", "c%s" % i) for i in

Re: Encryption with Python?

2005-05-09 Thread Anthra Norell
Robert, Thanks a lot for your thorough explanations. - Original Message - From: "Robert Kern" <[EMAIL PROTECTED]> To: Sent: Saturday, May 07, 2005 3:18 PM Subject: Re: Encryption with Python? ( snip ) > >>You do realize that if I have two ciphertexts encrypted with the same > >>ke

Adapt PyShell's code completion into DrPython

2005-05-09 Thread dcrespo
I would like to adapt the PyShell code completion to DrPython, because both programs are very good... Any clue for start finding the code location in both programs to accomplish this? Thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: file corruption on windows - possible bug

2005-05-09 Thread Fredrik Lundh
Jeremy Jones wrote: > # > file_dict = {} > > a_list = [("a", "a%s" % i) for i in range(2500)] > b_list = [("b", "b%s" % i) for i in range(2500)] > c_list = [("c", "c%s" % i) for i in range(2500)] > d_list = [("d", "d%s" % i) for i in range(2500)] > > > joined_list =

Re: include "apythonscript.py"

2005-05-09 Thread Chris Curvey
the PHP include doesn't have an exact match in Python, but I think you can do what you intend. To follow the first example from php.net, this would work vars.py color = 'green' fruit = 'apple' test.py from vars import * print "A " , color, fruit HTH -- http://mail.python.org/mailman/listinfo

Re: include "apythonscript.py"

2005-05-09 Thread Larry Bates
How about? put apythonscript_function.py in a separate file then inculde apythonscript_function.py at the top of maincode.py Looks like you probably need to go back and read the tutorial. -Larry [EMAIL PROTECTED] wrote: > H! > > I'm trying to find a python function to use like this: > > --

file corruption on windows - possible bug

2005-05-09 Thread Jeremy Jones
I've written a piece of code that iterates through a list of items and determines the filename to write some piece of data to based on something in the item itself. Here is a small example piece of code to show the type of thing I'm doing:: # file_dict = {} a_list

include "apythonscript.py"

2005-05-09 Thread martijn
H! I'm trying to find a python function to use like this: -- maincode.py Include "apythonscript_function.py" -- end So I can split the maincode.py file in smalle pieces. Or yust save the function's in other file and include them once. I really want to use this because else { the maincode.py wi

ANN: Boston Python Interest Group Meeting

2005-05-09 Thread Chris Curvey
Thursday, 7PM Harvard Science Center 1 Oxford St Room 507 Cambridge, mA 02101 'Nuff said. -- http://mail.python.org/mailman/listinfo/python-list

Re: Trouble saving unicode text to file

2005-05-09 Thread Simon Brunning
On 5/9/05, Max M <[EMAIL PROTECTED]> wrote: > Fredrik Lundh wrote: > > > (I just noticed that there's no euro sign on my swedish keyboard. I've > > never missed it ;-) > > It's probably "AltGR + E" like here in DK My UK keyboard has it as AltGr + 4, FWIW. -- Cheers, Simon B, [EMAIL PROTECTED]

Re: Trouble saving unicode text to file

2005-05-09 Thread Max M
Fredrik Lundh wrote: > (I just noticed that there's no euro sign on my swedish keyboard. I've > never missed it ;-) It's probably "AltGR + E" like here in DK -- hilsen/regards Max M, Denmark http://www.mxm.dk/ IT's Mad Science -- http://mail.python.org/mailman/listinfo/python-list

Re: replace string patern with different value

2005-05-09 Thread Fredrik Lundh
Bill Mill wrote: for rep in L: > ... source = source.replace(token, rep, 1) here's another way to do it: >>> L = ["11", "22", "33"] >>> S = "xyzzy text we've got xyzzy text xyzzy yeah yeah yeah" >>> L.reverse() >>> re.sub("xyzzy", lambda x: L.pop(), S) "11 text we've got 22 text 33 yeah

Re: replace string patern with different value

2005-05-09 Thread Duncan Booth
[EMAIL PROTECTED] wrote: > I would like to replace string with different values, > For example : > source = 'kode1 bla bla kode1 bla kode1' > I have a list with each member will replace each of kode1. > L = [11,22,33] > So the new source will become: > newsource = '11 bla bla 22 bla 33' > > How c

Re: replace string patern with different value

2005-05-09 Thread Peter Otten
[EMAIL PROTECTED] wrote: > I would like to replace string with different values, > For example : > source = 'kode1 bla bla kode1 bla kode1' > I have a list with each member will replace each of kode1. > L = [11,22,33] > So the new source will become: > newsource = '11 bla bla 22 bla 33' Here's on

replace string patern with different value

2005-05-09 Thread Bill Mill
On 9 May 2005 06:23:41 -0700, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Hello, > > I would like to replace string with different values, > For example : > source = 'kode1 bla bla kode1 bla kode1' > I have a list with each member will replace each of kode1. > L = [11,22,33] > So the new source

Re: Trouble saving unicode text to file

2005-05-09 Thread Fredrik Lundh
John Machin wrote: > I find it a bit hard to imagine that the euro sign wouldn't get a fair > bit of usage in Swedish data processing even if it's not their own > currency. it's spelled "Euro" or "EUR" in swedish. (if you live in a country that use letters to represent its own currency, you tend

replace string patern with different value

2005-05-09 Thread [EMAIL PROTECTED]
Hello, I would like to replace string with different values, For example : source = 'kode1 bla bla kode1 bla kode1' I have a list with each member will replace each of kode1. L = [11,22,33] So the new source will become: newsource = '11 bla bla 22 bla 33' How can I do it ? I tried to find using s

Re: __brace__ (PEP?)

2005-05-09 Thread Roy Smith
"Kay Schluehr" <[EMAIL PROTECTED]> wrote: > Roy Smith wrote: > > > foo->bar ==> foo.__arrrow__(bar) > > foo$bar ==> foo.__dollar__(bar) > > foo#bar ==> foo.__hash__(bar) > > foo::bar ==> foo.__scope__(bar) > > I'm strongly in favor for the arrow ( but with two "r" only ). The > question is simpl

  1   2   >