ANN: SfePy 2009.3 released

2009-07-21 Thread Robert Cimrman
I am pleased to announce release 2009.3 of SfePy. Description --- SfePy (simple finite elements in Python) is a software, distributed under the BSD license, for solving systems of coupled partial differential equations by the finite element method. The code is based on NumPy and SciPy

Re: ignore special characters in python regex

2009-07-21 Thread John Machin
On Jul 21, 3:02 pm, Astan Chee astan.c...@al.com.au wrote: Hi, I'm reading text from a file (per line) and I want to do a regex using these lines but I want the regex to ignore any special characters and treat them like normal strings. Is there a regex function that can do this? It would

Re: any suggestions to synchronize typed text and speech ?

2009-07-21 Thread Che M
On Jul 19, 4:15 pm, Stef Mientki stef.mien...@gmail.com wrote: hello, I'm using Scintilla as a wxPython widget with great pleasure. I now have an application where I want to make notes during a conversation, but also want to record the speech during that conversation. I'm using Scintilla as

Re: comments? storing a function in an object

2009-07-21 Thread I V
On Mon, 20 Jul 2009 21:53:59 -0400, Esmail wrote: In general I would agree with you, but in my specific case I want so store some additional meta-data with each function, such as the valid range for input values, where the max or minimum are located, the name/source for the function etc. I am

python function for retrieving key and encryption

2009-07-21 Thread jayshree
M2Crypto package not showing the 'recipient_public_key.pem' file at linux terminal .how do i get/connect with recipient public key. exactly i need to check how can i open this file through linux commands. import M2Crypto def encrypt(): recip = M2Crypto.RSA.load_pub_key(open

Re: Why aren't OrderedDicts comparable with etc?

2009-07-21 Thread Jack Diederich
On Mon, Jul 20, 2009 at 10:00 AM, Steven D'Apranost...@remove-this-cybersource.com.au wrote: On Mon, 20 Jul 2009 09:34:24 +, Sion Arrowsmith wrote: Terry Reedy  tjre...@udel.edu wrote: Sion Arrowsmith wrote: Jack Diederich  jackd...@gmail.com wrote: It isn't an OrderedDict thing, it is a

Re: comments? storing a function in an object

2009-07-21 Thread Gabriel Genellina
En Mon, 20 Jul 2009 22:53:59 -0300, Esmail ebo...@hotmail.com escribió: Gabriel Genellina wrote: If you follow the above suggestions, you'll see that your Function class becomes almost useless: a normal function already IS an object, so you don't have to wrap it inside ANOTHER object

Re: ignore special characters in python regex

2009-07-21 Thread Astan Chee
I think the re.escape did the trick. to answer your questions: By ignore i meant instead of using non-alphanumeric characters that have special significance in regular expression (e.g. [|\]) and treat them as normal strings (i.e preceded by \), but since I don't know all the characters in

Re: If Scheme is so good why MIT drops it?

2009-07-21 Thread Rainer Joswig
On 21 Jul., 06:57, Frank Buss f...@frank-buss.de wrote: Scott Burson wrote: Have you looked at ECL? http://ecls.sourceforge.net/ I've used it only a little, so I can't vouch for its stability, but it fits the threading and license requirements (well, some corporate lawyers have trouble

Re: Mutable Strings - Any libraries that offer this?

2009-07-21 Thread Thomas Guettler
casebash schrieb: Hi, I have searched this list and found out that Python doesn't have a mutable string class (it had an inefficient one, but this was removed in 3.0). Are there any libraries outside the core that offer this? Hi, you could use a list of characters. It would not be

PIL for OSX 64bit

2009-07-21 Thread moerchendiser2k3
Hi, I have a problem with Python and the Python Image Library to get it work on OSX 64 bit. Maybe anyone can help me? I started Python in 64 bit mode and called Image.open(...).load() and got: ImportError: The _imaging C module is not installed Yes, it seems PIL is not available in 64 bit on my

Re: Running a Python Service under the LocalService or NetworkService Account

2009-07-21 Thread sightseer
On Jul 20, 5:25 pm, David Adamo Jr. dtgead...@yahoo.com wrote: On Jul 20, 5:14 pm, Tim Golden m...@timgolden.me.uk wrote: mistersexy wrote: On Jul 20, 3:03 pm, Tim Golden m...@timgolden.me.uk wrote: mistersexy wrote: I am trying to create a Windows service in Python using pywin32. I

Re: Help understanding the decisions *behind* python?

2009-07-21 Thread Hendrik van Rooyen
On Monday 20 July 2009 21:26:07 Phillip B Oldham wrote: On Jul 20, 6:08 pm, Duncan Booth duncan.bo...@invalid.invalid wrote: The main reason why you need both lists and tuples is that because a tuple of immutable objects is itself immutable you can use it as a dictionary key. Really? That

Re: ANN: Shed Skin 0.2, an experimental (restricted) Python-to-C++ compiler

2009-07-21 Thread William Dode
On 20-07-2009, srepmub wrote: Nice timings, can you please show me the Python, Java and C code versions? I may do more tests. Of course, the codes are here : http://hg.flibuste.net/libre/games/cheval Like you'll see, i tried to use exactly the same code for each langage. also, which

Re: ANN: Shed Skin 0.2, an experimental (restricted) Python-to-C++ compiler

2009-07-21 Thread William Dode
On 20-07-2009, Bearophile wrote: Skip Montanaro: I read just enough French to know that avec means with, but I don't understand the difference between avec malloc *int and avec [].  Can you explain please? Maybe it's the time difference between using a Python list from Cython and using a C

Re: Mutable Strings - Any libraries that offer this?

2009-07-21 Thread Ben Finney
John Machin sjmac...@lexicon.net writes: OK, I'll bite: where does the Python 3.x bytearray type I wasn't previously aware of it, thanks for bringing it to my attention URL:http://docs.python.org/3.1/library/stdtypes.html#bytes-methods. fit into your taxonomy? At first glance it appears to be

Re: Mutable Strings - Any libraries that offer this?

2009-07-21 Thread Ben Finney
Steven D'Aprano st...@remove-this-cybersource.com.au writes: On Mon, 20 Jul 2009 21:08:22 +1000, Ben Finney wrote: A mutable string would not (AFAICT) be usefully implementable as a subclass of the built-in string types. So even if such a type existed, it would not be useable with all the

Re: missing 'xor' Boolean operator

2009-07-21 Thread Mark Dickinson
On Jul 20, 11:34 pm, Ethan Furman et...@stoneleaf.us wrote: Dr. Phillip M. Feldman wrote:   Suppose that 'xor' returns the value that is true when only one value is   true, and False otherwise.  This definition of xor doesn't have the standard   associative property, that is,     (a xor b)

Re: If Scheme is so good why MIT drops it?

2009-07-21 Thread Juanjo
On Jul 21, 6:57 am, Frank Buss f...@frank-buss.de wrote: Scott Burson wrote: Have you looked atECL? http://ecls.sourceforge.net/ I've used it only a little, so I can't vouch for its stability, but it fits the threading and license requirements (well, some corporate lawyers have trouble

Re: If Scheme is so good why MIT drops it?

2009-07-21 Thread milanj
On Jul 19, 8:31 pm, Frank Buss f...@frank-buss.de wrote: Python is not that bad. Unlike Lisp, there is much less undefined behavior, there is one free unique implementation on the 3 major platforms Linux, Windows and MacOS X, which is stable, support multithreading and has a default GUI

Re: Running a Python Service under the LocalService or NetworkService Account

2009-07-21 Thread Martin P. Hellwig
sightseer wrote: knip Error Installing Service: Access is Denied. (5) knip Are you trying to do this on windows vista? -- MPH http://blog.dcuktec.com 'If consumed, best digested with added seasoning to own preference.' -- http://mail.python.org/mailman/listinfo/python-list

Re: ignore special characters in python regex

2009-07-21 Thread Gabriel Genellina
En Tue, 21 Jul 2009 02:02:57 -0300, Astan Chee astan.c...@al.com.au escribió: I'm reading text from a file (per line) and I want to do a regex using these lines but I want the regex to ignore any special characters and treat them like normal strings. Is there a regex function that can do

Re: Help understanding the decisions *behind* python?

2009-07-21 Thread Duncan Booth
Hrvoje Niksic hnik...@xemacs.org wrote: Chris Rebert c...@rebertia.com writes: x = [2,1,3] print sorted(x)[0] DB 3 What kind of Python produces that? Assuming you're referring to the latter example, it was added in version 2.4 If you meant the former example, I think that's purely

Re: How to import pydoc and then use it?

2009-07-21 Thread Jean-Michel Pichavant
Albert Hopkins wrote: On Mon, 2009-07-20 at 13:38 -0700, mrstevegross wrote: I know how to use pydoc from the command line. However, because of complicated environmental setup, it would be preferable to run it within a python script as a native API call. That is, my python runner looks a bit

Re: ANN: Shed Skin 0.2, an experimental (restricted) Python-to-C++ compiler

2009-07-21 Thread srepmub
With -bw and -O3 -fomit-frame-pointer -msse2 i have 5.5s (instead of 8) Let me know if you find better. thanks. now I'm wondering how fast does the C version become with these flags..? :-) mark. -- http://mail.python.org/mailman/listinfo/python-list

Re: ANN: Shed Skin 0.2, an experimental (restricted) Python-to-C++ compiler

2009-07-21 Thread Nick Craig-Wood
Mark Dufour mark.duf...@gmail.com wrote: I have just released version 0.2 of Shed Skin, an experimental (restricted) Python-to-C++ compiler (http://shedskin.googlecode.com). It comes with 7 new example programs (for a total of 40 example programs, at over 12,000 lines) and several

Re: ANN: Shed Skin 0.2, an experimental (restricted) Python-to-C++ compiler

2009-07-21 Thread William Dode
On 21-07-2009, srepmub wrote: With -bw and -O3 -fomit-frame-pointer -msse2 i have 5.5s (instead of 8) Let me know if you find better. thanks. now I'm wondering how fast does the C version become with these flags..? :-) I don't see any difference... -- William Dodé - http://flibuste.net

Re: Running a Python Service under the LocalService or NetworkService Account

2009-07-21 Thread David Adamo Jr.
On Jul 21, 10:40 am, Martin P. Hellwig martin.hell...@dcuktec.org wrote: sightseer wrote: knip Error Installing Service: Access is Denied. (5) knip Are you trying to do this on windows vista? -- MPHhttp://blog.dcuktec.com 'If consumed, best digested with added seasoning to own

Re: JavaScript toolkits (was Re: ANN: Porcupine Web Application Server 0.6 is released!)

2009-07-21 Thread Paul Boddie
On 20 Jul, 18:00, a...@pythoncraft.com (Aahz) wrote: Out of curiosity, are there any JavaScript toolkits that generate code that degrades gracefully when JavaScript is disabled? You mean Web toolkits which use JavaScript, I presume. I have written (and use myself) a toolkit/framework called

Particle research opens door for new technology

2009-07-21 Thread Rashid Ali Soomro
Big uses for small particles will be explored at the annual Particle Technology Research Centre Conference at The University of Western Ontario July 9 and 10.more link http://0nanotechnology0.blogspot.com/ -- http://mail.python.org/mailman/listinfo/python-list

RE: Auto-generate GUI from a database table structure

2009-07-21 Thread Boyd, Craig1
Gabriel, Thanks for pointing this out. It does not look like it supports Oracle at this time, which is one of my requirements, but that is based on doing a quick read of the wiki. I will dig in further and see. Perhaps it supports ODBC which would be an acceptable work-around. Thanks

Multiple versions of python

2009-07-21 Thread ChrisW
Hi, I have installed 2 versions of python on my Windows XP computer - I originally had 3.0.1, but then found that the MySQL module only supported 2.*, so I've now installed that. I have found that if I change the Windows Environment Variable path, then I can change the version of python called

Regular expression

2009-07-21 Thread Peter Fodrek
Dear conference! I have third party regular expression self.pattern_main = re.compile('(\s+|\w(?:[+])?\d*(?:\.\d*)?|\w\#\d+|\(.*?\)| \#\d+\=(?:[+])?\d*(?:\.\d*)?)') with code def readline(self): self.line = self.file_in.readline().rstrip() if (len(self.line)) : return True

Re: Help understanding the decisions *behind* python?

2009-07-21 Thread Inky 788
On Jul 20, 12:27 pm, Phillip B Oldham phillip.old...@gmail.com wrote: [snip] We understand that lists are mutable and tuples are not, but we're a little lost as to why the two were kept separate from the start. They both perform a very similar job as far as we can tell. My guess is that it

Re: Mutable Strings - Any libraries that offer this?

2009-07-21 Thread Scott David Daniels
Steven D'Aprano wrote: On Mon, 20 Jul 2009 21:08:22 +1000, Ben Finney wrote: What is it you're trying to do that makes you search for a mutable string type? It's likely that a better approach can be found. When dealing with very large strings, it is wasteful to have to duplicate the entire

Re: Multiple versions of python

2009-07-21 Thread Scott David Daniels
ChrisW wrote: Hi, I have installed 2 versions of python on my Windows XP computer - I originally had 3.0.1, but then found that the MySQL module only supported 2.*, so I've now installed that. I have found that if I change the Windows Environment Variable path, then I can change the version of

Re: If Scheme is so good why MIT drops it?

2009-07-21 Thread Raffael Cavallaro
On 2009-07-21 05:37:27 -0400, milanj mil...@gmail.com said: Someone should mention Clozure CL - http://trac.clozure.com/openmcl As you can see there is os x, freebsd, linux, solaris and windows port and all of them use native threads (python still use green threads ?) and development is pretty

Re: Multiple versions of python

2009-07-21 Thread Dave Angel
ChrisW wrote: Hi, I have installed 2 versions of python on my Windows XP computer - I originally had 3.0.1, but then found that the MySQL module only supported 2.*, so I've now installed that. I have found that if I change the Windows Environment Variable path, then I can change the version of

Workflow Libraries (DB vs Code)

2009-07-21 Thread Thomas Guettler
Hi, I need to write some simple workflows with web interface. For the web stuff I will use django, but I am not sure how to do the workflow part. Here are ideas: Do it myself. I don't think it will be difficult, I did things like this before. But they were not reusable. Use spiff Workflow

Re: invoke method on many instances

2009-07-21 Thread Simon Forman
On Jul 20, 3:29 am, Gabriel Genellina gagsl-...@yahoo.com.ar wrote: En Sat, 18 Jul 2009 12:31:46 -0300, Alan G Isaac alan.is...@gmail.com   escribió: On Fri, 17 Jul 2009 05:19:50 +, Alan G Isaac wrote: def apply2(itr, methodname, *args, **kwargs):     f =

Re: tough-to-explain Python

2009-07-21 Thread Simon Forman
On Mon, Jul 20, 2009 at 9:54 PM, Paul Rubinhttp://phr...@nospam.invalid wrote: Simon Forman sajmik...@gmail.com writes: But I'm glad it's there to study, these are wheels I don't have to invent for myself. http://dwheeler.com/essays/high-assurance-floss.html might be an interesting place to

Re: If Scheme is so good why MIT drops it?

2009-07-21 Thread Slobodan Blazeski
On Jul 19, 7:33 pm, fft1976 fft1...@gmail.com wrote: On Jul 19, 9:55 am, Frank Buss f...@frank-buss.de wrote: E.g. the number system: In many Lisp implementations (/ 2 3) results in the fractional object 2/3. In Python 2.6 2 / 3 results in 0. Looks like with Python 3.1 they have fixed it,

Re: ANN: Shed Skin 0.2, an experimental (restricted) Python-to-C++ compiler

2009-07-21 Thread Bearophile
Nick Craig-Wood: Can you give a hint as to how I debug this?  I presume my program has some instances of non static types which is causing the problem, but it is going to be a very long debugging session if it takes me an hour each cycle ;-) The program is about 700 lines of python

Re: Help understanding the decisions *behind* python?

2009-07-21 Thread Piet van Oostrum
Hendrik van Rooyen hend...@microcorp.co.za (HvR) wrote: HvR On Monday 20 July 2009 21:26:07 Phillip B Oldham wrote: On Jul 20, 6:08 pm, Duncan Booth duncan.bo...@invalid.invalid wrote: The main reason why you need both lists and tuples is that because a tuple of immutable objects is itself

Re: ANN: Shed Skin 0.2, an experimental (restricted) Python-to-C++ compiler

2009-07-21 Thread Bearophile
William Dode': http://hg.flibuste.net/libre/games/cheval Like you'll see, i tried to use exactly the same code for each langage. It's a cute solver. Few more versions of mine: #1, a Psyco version of mine: http://codepad.org/9m5rf7kX #2, unrolled Psyco version: http://codepad.org/gKFLu34M

Re: Help understanding the decisions *behind* python?

2009-07-21 Thread David Smith
Piet van Oostrum wrote: Hendrik van Rooyen hend...@microcorp.co.za (HvR) wrote: HvR On Monday 20 July 2009 21:26:07 Phillip B Oldham wrote: On Jul 20, 6:08 pm, Duncan Booth duncan.bo...@invalid.invalid wrote: The main reason why you need both lists and tuples is that because a tuple of

Re: Regular expression

2009-07-21 Thread MRAB
Peter Fodrek wrote: Dear conference! I have third party regular expression self.pattern_main = re.compile('(\s+|\w(?:[+])?\d*(?:\.\d*)?|\w\#\d+|\(.*?\)| \#\d+\=(?:[+])?\d*(?:\.\d*)?)') [snip] It handles file correctly with two exceptions 1) omits ',' in the a output 2) omits minus sign

Re: missing 'xor' Boolean operator

2009-07-21 Thread Ethan Furman
Mark Dickinson wrote: On Jul 20, 11:34 pm, Ethan Furman et...@stoneleaf.us wrote: Dr. Phillip M. Feldman wrote: Suppose that 'xor' returns the value that is true when only one value is true, and False otherwise. This definition of xor doesn't have the standard associative property, that

Re: Help understanding the decisions *behind* python?

2009-07-21 Thread Piet van Oostrum
David Smith d...@cornell.edu (DS) wrote: DS Piet van Oostrum wrote: Hendrik van Rooyen hend...@microcorp.co.za (HvR) wrote: HvR On Monday 20 July 2009 21:26:07 Phillip B Oldham wrote: On Jul 20, 6:08 pm, Duncan Booth duncan.bo...@invalid.invalid wrote: The main reason why you need both

Re: Regular expression

2009-07-21 Thread Rhodri James
On Tue, 21 Jul 2009 14:30:47 +0100, Peter Fodrek peter.fod...@stuba.sk wrote: Dear conference! I have third party regular expression self.pattern_main = re.compile('(\s+|\w(?:[+])?\d*(?:\.\d*)?|\w\#\d+|\(.*?\)| \#\d+\=(?:[+])?\d*(?:\.\d*)?)') Always use raw strings (r...) when you're

Re: Multiple versions of python

2009-07-21 Thread CCW
On 21 July, 15:19, Dave Angel da...@dejaviewphoto.com wrote: ChrisW wrote: Hi, I have installed 2 versions of python on my Windows XP computer - I originally had 3.0.1, but then found that the MySQL module only supported 2.*, so I've now installed that.  I have found that if I change

Re: Workflow Libraries (DB vs Code)

2009-07-21 Thread Diez B. Roggisch
Thomas Guettler wrote: Hi, I need to write some simple workflows with web interface. For the web stuff I will use django, but I am not sure how to do the workflow part. Did you consider using OpenERP? It comes with a web-frontend (TG1.0.8-based), but also offers a XMLRPC-server to

Re: python function for retrieving key and encryption

2009-07-21 Thread Piet van Oostrum
jayshree jayshree06c...@gmail.com (j) wrote: j M2Crypto package not showing the 'recipient_public_key.pem' file at j linux terminal .how do i get/connect with recipient public key. j exactly i need to check how can i open this file through linux j commands. j import M2Crypto def encrypt():

Re: PIL for OSX 64bit

2009-07-21 Thread Ned Deily
In article e0564f03-f736-4d0f-8c50-e1bce0eb5...@r2g2000yqm.googlegroups.com, moerchendiser2k3 googler.1.webmas...@spamgourmet.com wrote: I have a problem with Python and the Python Image Library to get it work on OSX 64 bit. Maybe anyone can help me? I started Python in 64 bit mode and called

Re: Regular expression

2009-07-21 Thread Peter Fodrek
21.7.2009 v 16:50, MRAB: Peter Fodrek wrote: Dear conference! I have third party regular expression self.pattern_main = re.compile('(\s+|\w(?:[+])?\d*(?:\.\d*)?|\w\#\d +|\(.*?\)| \#\d+\=(?:[+])?\d*(?:\.\d*)?)') [snip] It handles file correctly with two exceptions 1) omits ',' in the a

Issue combining gzip and subprocess

2009-07-21 Thread Iwan Vosloo
Hi there, We tried to gzip the output of a shell command, but this results in a strange error: the resulting file seems to be the concatenation of the plaintext file with the zipped content. For example: f = gzip.open(filename, 'w') subprocess.check_call(['ls','-la'], stdout=f) f.close() Using

Re: any suggestions to synchronize typed text and speech ?

2009-07-21 Thread Stef Mientki
hi Marcus, That sounds like a very specialized type of thing, Well from an application point of view, with the current netbooks, this looks like a perfect tool for any conversation or meeting. which only the few people with experience with wxPython, PyAudio, and Scintilla could help you

Re: Help understanding the decisions *behind* python?

2009-07-21 Thread Simon Forman
On Jul 20, 12:27 pm, Phillip B Oldham phillip.old...@gmail.com wrote: My colleagues and I have been working with python for around 6 months now, and while we love a lot of what python has done for us and what it enables us to do some of the decisions behind such certain data-types and their

Re: If Scheme is so good why MIT drops it?

2009-07-21 Thread Frank Buss
Rainer Joswig wrote: I'm not sure if it is fair to post a reference to a single post by someone without context and without having used ECL. If there are stability problems, people can report to the ECL mailing list. The maintainers are very active. This was just one example. Another one:

Re: Pep 342 (val = yield MyGenerator(foo)), synchronous os.system() that doesn't block gui event loops

2009-07-21 Thread John Nagle
Ville Vainio wrote: Has anyone implementing something like what the subject line indicates? The idea: To run functions that execute a series of system commands without blocking the ui, *and* without adding state machine logic. At some level, there's going to be state machine logic. You

Re: Issue combining gzip and subprocess

2009-07-21 Thread Piet van Oostrum
Iwan Vosloo i...@reahl.org (IV) wrote: IV Hi there, IV We tried to gzip the output of a shell command, but this results in a IV strange error: the resulting file seems to be the concatenation of the IV plaintext file with the zipped content. IV For example: IV f = gzip.open(filename, 'w') IV

Re: win32api install problem

2009-07-21 Thread Tim Golden
MCIPERF wrote: On Jul 20, 9:57 am, Tim Golden m...@timgolden.me.uk wrote: Gerry wrote: I'm running Python 2.6 under XP. I've installed Windows 32 extensions for Python 2.6 version 1.4 (pywin32-214.win32-py2.6.exe). But If I try to import win32api, I get: File

Re: Regular expression

2009-07-21 Thread Jean-Michel Pichavant
Rhodri James wrote: On Tue, 21 Jul 2009 14:30:47 +0100, Peter Fodrek peter.fod...@stuba.sk wrote: Dear conference! I have third party regular expression self.pattern_main = re.compile('(\s+|\w(?:[+])?\d*(?:\.\d*)?|\w\#\d+|\(.*?\)| \#\d+\=(?:[+])?\d*(?:\.\d*)?)') Also, whoever wrote

Re: If Scheme is so good why MIT drops it?

2009-07-21 Thread Tim Bradshaw
On 2009-07-19 19:31:36 +0100, Frank Buss f...@frank-buss.de said: (e.g. I don't know of a free modern and stable Lisp implemenation with mulithreading support for Windows, with a licence with which you can use it in closed source commercial programs, like you can do with Python). Openmcl

Re: clean way prepend an element to a numpy array

2009-07-21 Thread Robert Kern
On 2009-07-20 22:56, bdb112 wrote: If I want to add an element at the beginning of an array, it seems like I must make a list, insert in place, then make an array again. the_array = numpy.concatenate([new_value, the_array]) You will want to ask numpy questions on the numpy mailing list.

Re: Regular expression

2009-07-21 Thread Rhodri James
On Tue, 21 Jul 2009 17:12:53 +0100, Peter Fodrek peter.fod...@stuba.sk wrote: 21.7.2009 v 17:39, Rhodri James: On Tue, 21 Jul 2009 14:30:47 +0100, Peter Fodrek peter.fod...@stuba.sk wrote: [snipped for space] This handles text file like // remark PL_OFF PARK FS MA 52.8806 , 18.0914

Re: are user defined classes hashable?

2009-07-21 Thread Hyuga
On Jul 20, 10:53 pm, a...@pythoncraft.com (Aahz) wrote: In article 373d6c69-6965-4a88-bdd2-8028ef850...@k6g2000yqn.googlegroups.com, Hyuga  hyugaricd...@gmail.com wrote: Regardless, Nicolas's example can be applied to the class too: class Foo(object):    pass hash(Foo) 11443104

Re: ANN: Shed Skin 0.2, an experimental (restricted) Python-to-C++ compiler

2009-07-21 Thread Terry Reedy
Nick Craig-Wood wrote: I tried it on a program I wrote to solve a puzzle (Rush Hour). (Actually it solves the meta-puzzle - trying to make the hardest possible Rush Hour puzzle.) After a bit of twiddling (remove psyco and profiling) I got it to start compiling, but unfortunately it compiled

setuptools question.

2009-07-21 Thread Fred C
I have a python program and when I install this program from the module home directory using setup.py everything works fine. But easy_install fails with the following error, because I am trying to install some start up shell scripts into /etc/init.d The package setup script has

Re: Pep 342 (val = yield MyGenerator(foo)), synchronous os.system() that doesn't block gui event loops

2009-07-21 Thread Terry Reedy
Ville Vainio wrote: Has anyone implementing something like what the subject line indicates? Your subject line is so long that it is cut off even on my wide screen. Better to repeat the question in the body. -- http://mail.python.org/mailman/listinfo/python-list

Re: Running a Python Service under the LocalService or NetworkService Account

2009-07-21 Thread Martin P. Hellwig
David Adamo Jr. wrote: On Jul 21, 10:40 am, Martin P. Hellwig martin.hell...@dcuktec.org wrote: sightseer wrote: knip Error Installing Service: Access is Denied. (5) knip Are you trying to do this on windows vista? -- MPHhttp://blog.dcuktec.com 'If consumed, best digested with added

List insertion cost

2009-07-21 Thread Lucas P Melo
Hello, I would like to know how much it costs to insert an element into a list using this operation: a[2:2] = [ 1 ] i. e, what is the complexity of the operation above (given that len(a) = n)? Thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: List insertion cost

2009-07-21 Thread Daniel Stutzbach
On Tue, Jul 21, 2009 at 2:21 PM, Lucas P Melo lukepada...@gmail.com wrote: I would like to know how much it costs to insert an element into a list using this operation: a[2:2] = [ 1 ] i. e, what is the complexity of the operation above (given that len(a) = n)? O(n) If you want O(log n),

Pyserial and pyQt

2009-07-21 Thread Seth
I have used pyserial in the past but this is my first experience with pyQt. I am using the Python xy package for windows current but might move to linux. I have a small device that is outputting a basic text string. I want to be able to read this string(from the comm port) and update a text

Re: List insertion cost

2009-07-21 Thread Robert Kern
On 2009-07-21 14:21, Lucas P Melo wrote: Hello, I would like to know how much it costs to insert an element into a list using this operation: a[2:2] = [ 1 ] i. e, what is the complexity of the operation above (given that len(a) = n)? O(n). Python lists are contiguous arrays in memory, and

Re: List insertion cost

2009-07-21 Thread Lucas P Melo
Robert Kern wrote: O(n). Python lists are contiguous arrays in memory, and everything after the insertion point needs to be moved. Raymond Hettinger has a good talk about the implementation of Python lists and other container objects. http://www.youtube.com/watch?v=hYUsssClE94

Changing the private variables content

2009-07-21 Thread Ryniek90
Hi. I'm writing some class, and decided to use inside private method and some private variables. While with method i haven't got any problem's with variables i have. Maybe some example. A class with private method and private variable: class Secret(object): # def __init__(self):

time.strftime('%m-%d-%Y %H:%m:%S') to log is out of order

2009-07-21 Thread davidj411
I am using a recursive function to print the time and a few other things on each pass. ( the function calculates size of file that is being transferred and if not 100 % copied, it waits 20 secs and checks again). i would expect the time to be correct anytime it is used: --code below -- print

Balanced binary tree implementation

2009-07-21 Thread Lucas P Melo
Hello, I would like to use a balanced binary tree implementation (preferably within some API). Any hints about where I could find it? I am looking for something that implements insertion, deletion, search and a special search that returns the lesser element bigger than a given key [1]. A

Re: time.strftime('%m-%d-%Y %H:%m:%S') to log is out of order

2009-07-21 Thread Jon Clements
On 21 July, 22:00, davidj411 davidj...@gmail.com wrote: I am using a recursive function to print the time and a few other things on each pass. ( the function calculates size of file that is being transferred and if not 100 % copied, it waits 20 secs and checks again). i would expect the time

Re: Changing the private variables content

2009-07-21 Thread Gary Herron
Ryniek90 wrote: Hi. I'm writing some class, and decided to use inside private method and some private variables. While with method i haven't got any problem's with variables i have. Maybe some example. A class with private method and private variable: class Secret(object): # def

Re: time.strftime('%m-%d-%Y %H:%m:%S') to log is out of order

2009-07-21 Thread Simon Forman
On Jul 21, 5:00 pm, davidj411 davidj...@gmail.com wrote: I am using a recursive function to print the time and a few other things on each pass. ( the function calculates size of file that is being transferred and if not 100 % copied, it waits 20 secs and checks again). i would expect the

Re: time.strftime('%m-%d-%Y %H:%m:%S') to log is out of order

2009-07-21 Thread Piet van Oostrum
davidj411 davidj...@gmail.com (d) wrote: d I am using a recursive function to print the time and a few other d things on each pass. ( the function calculates size of file that is d being transferred and if not 100 % copied, it waits 20 secs and checks d again). d i would expect the time to be

doted filenames in import statements

2009-07-21 Thread Jean-Michel Pichavant
Hi fellows, I'd like to use the dynamic __import__ statement. It works pretty well with non dotted names, but I cannot figure how to make it work with dotted file paths. example: file = /home/dsp/test.py test = __import__(file) works like a charm file = /home/dsp/4.6.0.0/test.py test =

Re: time.strftime('%m-%d-%Y %H:%m:%S') to log is out of order

2009-07-21 Thread Jon Clements
On 21 July, 22:38, Piet van Oostrum p...@cs.uu.nl wrote: davidj411 davidj...@gmail.com (d) wrote: d I am using a recursive function to print the time and a few other d things on each pass. ( the function calculates size of file that is d being transferred and if not 100 % copied, it waits 20

Re: time.strftime('%m-%d-%Y %H:%m:%S') to log is out of order

2009-07-21 Thread davidj411
On Jul 21, 5:29 pm, Simon Forman sajmik...@gmail.com wrote: On Jul 21, 5:00 pm, davidj411 davidj...@gmail.com wrote: I am using a recursive function to print the time and a few other things on each pass. ( the function calculates size of file that is being transferred and if not 100 %

Re: doted filenames in import statements

2009-07-21 Thread Chris Rebert
On Tue, Jul 21, 2009 at 2:42 PM, Jean-Michel Pichavantjeanmic...@sequans.com wrote: Hi fellows, I'd like to use the dynamic __import__ statement. It works pretty well with non dotted names, but I cannot figure how to make it work with dotted file paths. example: file = /home/dsp/test.py

Re: time.strftime('%m-%d-%Y %H:%m:%S') to log is out of order

2009-07-21 Thread MRAB
davidj411 wrote: On Jul 21, 5:29 pm, Simon Forman sajmik...@gmail.com wrote: On Jul 21, 5:00 pm, davidj411 davidj...@gmail.com wrote: I am using a recursive function to print the time and a few other things on each pass. ( the function calculates size of file that is being transferred and

Re: Pyserial and pyQt

2009-07-21 Thread David Boddie
On Tuesday 21 July 2009 21:37, Seth wrote: I have used pyserial in the past but this is my first experience with pyQt. I am using the Python xy package for windows current but might move to linux. I have a small device that is outputting a basic text string. I want to be able to read this

Re: setuptools question.

2009-07-21 Thread David Lyon
On Tue, 21 Jul 2009 11:12:01 -0700, Fred C f...@bsdhost.net wrote: I have a python program and when I install this program from the module home directory using setup.py everything works fine. But easy_install fails with the following error, because I am trying to install some start up

Re: time.strftime('%m-%d-%Y %H:%m:%S') to log is out of order

2009-07-21 Thread Simon Forman
On Jul 21, 5:53 pm, davidj411 davidj...@gmail.com wrote: On Jul 21, 5:29 pm, Simon Forman sajmik...@gmail.com wrote: On Jul 21, 5:00 pm, davidj411 davidj...@gmail.com wrote: I am using a recursive function to print the time and a few other things on each pass. ( the function

Fast reading and unpacking of binary data (struct module)

2009-07-21 Thread Daniel Platz
Hi, I have a Python newbie question about reading data from a binary file. I have an huge binary file from an external program. I want to read and process the data in this file in a reasonable time. It turns out that the reading of the data itself and the processing do not need most of the time.

trouble with minidom

2009-07-21 Thread Ronn Ross
Hello I'm trying to read an xml file using minidome. The xml looks like: rootNode project namemyProj/name path/here//path /project /rootNode My code looks like so: from xml.dom.minidom import parse dom = parse(myfile.xml) for node in dom.getElementsByTagName(project'):

Re: Fast reading and unpacking of binary data (struct module)

2009-07-21 Thread Gabriel Genellina
En Tue, 21 Jul 2009 21:00:13 -0300, Daniel Platz mail.to.daniel.pl...@googlemail.com escribió: I have an huge binary file from an external program. I want to read and process the data in this file in a reasonable time. It turns out that the reading of the data itself and the processing do not

Re: tough-to-explain Python

2009-07-21 Thread greg
Simon Forman wrote: My understanding (so far) is that you (hope to) /derive/ correct code using formal logic, rather than writing code and then proving its soundness. But to the extent you can rigorously formalise it, all you've done is create Yet Another Programming Language. Which is fine,

Re: Mutable Strings - Any libraries that offer this?

2009-07-21 Thread greg
Ben Finney wrote: My point was rather meant to imply that subclassing the built-in (immutable) string types was the best way to usefully get all their functionality However, it would be difficult to do that without changing all C code that deals with strings, including that in extension

Python

2009-07-21 Thread khanh le
do you have any materials about Python? can you show me the link of Python or some books? thanks a lots! -- Regard! Khanh -- http://mail.python.org/mailman/listinfo/python-list

Re: trouble with minidom

2009-07-21 Thread Gabriel Genellina
En Tue, 21 Jul 2009 21:08:57 -0300, Ronn Ross ronn.r...@gmail.com escribió: Hello I'm trying to read an xml file using minidome. The xml looks like: rootNode project namemyProj/name path/here//path /project /rootNode My code looks like so: from xml.dom.minidom import parse

Re: ANN: Shed Skin 0.2, an experimental (restricted) Python-to-C++ compiler

2009-07-21 Thread greg
William Dode wrote: I just tested it with a litle game, to find the places of horse on a board 5x5. The result is : cython avec malloc *int 18s Posting benchmark times for Pyrex or Cython is pretty meaningless without showing the exact code that was used, since times can vary enormously

SMTPlib and SMTPd Performance Issues

2009-07-21 Thread Casey McGinty
Hi, I just wanted mention a few workarounds I've come up with for the Python SMTP modules in regards to performance. Before I started, I was getting about 15MB/s while sending e-mail from smtplib to smptd over a local connection. (i.e. both client/server running on the same machine). After the

  1   2   >