Re: clean way prepend an element to a numpy array

2009-07-21 Thread greg
bdb112 wrote: I saw this interest syntax on this site x[:0]=0 I guess that is cute, but could be confusing(and doesn't work) It does if you use an array of the appropriate type on the right hand side: a[:0] = array('i', [0]) -- Greg -- http://mail.python.org/mailman/listinfo/python-li

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

2009-07-21 Thread Bearophile
greg: > Posting benchmark times for Pyrex or Cython is pretty > meaningless without showing the exact code that was > used, since times can vary enormously depending on > how much you C-ify things. Was this link, shown by William, not enough? http://hg.flibuste.net/libre/games/cheval/file/46797c3a

Re: Help understanding the decisions *behind* python?

2009-07-21 Thread Steven D'Aprano
On Tue, 21 Jul 2009 06:49:59 -0700, Inky 788 wrote: > On Jul 20, 12:27 pm, Phillip B Oldham 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 a

Re: plotting graph from another file

2009-07-21 Thread Chris Rebert
On Tue, Jul 21, 2009 at 11:28 PM, jhinak sen wrote: > hello.. > > i want to plot a distribution graph for following data: > elements:   number of occurance: >    a                            2 >    b    4 >    c    1 >    d

Re: Help understanding the decisions *behind* python?

2009-07-21 Thread Steven D'Aprano
On Tue, 21 Jul 2009 00:39:24 +0200, Niels L. Ellegaard wrote: > Phillip B Oldham writes: > >> We often find we need to do manipulations like the above without >> changing the order of the original list, and languages like JS allow >> this. We can't work out how to do this in python though, other

Re: Help understanding the decisions *behind* python?

2009-07-21 Thread Hendrik van Rooyen
On Tuesday 21 July 2009 15:49:59 Inky 788 wrote: > On Jul 20, 12:27 pm, Phillip B Oldham > > 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 f

plotting graph from another file

2009-07-21 Thread jhinak sen
hello.. i want to plot a distribution graph for following data: *elements: number of occurance: a2 b4 c1 d9 e3* ( this a simple

Re: Regular exprssion for IRC messages

2009-07-21 Thread Gabriel Genellina
En Fri, 17 Jul 2009 13:59:47 -0300, nohics nohics escribió: When an IRC client receive a messages, this message in in a special format defined here: Message format in pseudo BNF( I want to transforme the message format defined in the

Re: Detect target name in descriptor __set__ method

2009-07-21 Thread Wolfgang Rohdewald
On Wednesday 22 July 2009, Wolfgang Rohdewald wrote: > On Wednesday 22 July 2009, Gabriel Genellina wrote: > > x = X() > > x.foo = "value" > > del x.foo sorry, was not yet quite awaken - I read "delete target name" instead of "detect target name" -- Wolfgang -- http://mail.python.org/mailman/li

Re: Detect target name in descriptor __set__ method

2009-07-21 Thread Wolfgang Rohdewald
On Wednesday 22 July 2009, Gabriel Genellina wrote: > x = X() > x.foo = "value" del x.foo -- Wolfgang -- http://mail.python.org/mailman/listinfo/python-list

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

2009-07-21 Thread Raffael Cavallaro
On 2009-07-21 19:06:02 -0400, Neil Hodgson said: Python uses native threads. So it can be teh-slowness on all ur cores! The global interpreter lock doesn't help much either. -- Raffael Cavallaro -- http://mail.

Detect target name in descriptor __set__ method

2009-07-21 Thread Gabriel Genellina
I have a class attribute 'foo' which is a data descriptor. I create an instance of such class. When I say instance.foo = value, the descriptor __set__ method is called. Is there any way to obtain the name being assigned to? ('foo' in this example). That is, I want to know the target name fo

Re: Python

2009-07-21 Thread Prateek
Chk dis out ... http://www.swaroopch.com/notes/Python It's gr8 guide for beginners Cheers!!! Prateek -- http://mail.python.org/mailman/listinfo/python-list

Re: Python

2009-07-21 Thread Gabriel Genellina
En Tue, 21 Jul 2009 21:37:50 -0300, David Lyon escribió: On Wed, 22 Jul 2009 07:32:22 +0700, khanh le wrote: do you have any materials about Python? can you show me the link of Python or some books? http://www.python.org/ Also see http://wiki.python.org/moin/BeginnersGuide -- Gabriel G

Re: Changing the private variables content

2009-07-21 Thread David Stanek
On Tue, Jul 21, 2009 at 6:00 PM, Rhodri James wrote: > On Tue, 21 Jul 2009 21:55:18 +0100, 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. > > There i

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

2009-07-21 Thread Pascal J. Bourguignon
Tim Bradshaw writes: > On 2009-07-19 19:31:36 +0100, Frank Buss 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

Re: tough-to-explain Python

2009-07-21 Thread Paul Rubin
greg writes: > However, I suspect that you can't improve much on what we've already > got without restricting the domain of applicability of the > language. Otherwise, you just shift the intellectual bottleneck from > writing a correct program to writing correct specifications. Really, it's easie

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

2009-07-21 Thread greg
Steven D'Aprano writes: Besides, one can legitimately disagree that 2/3 => 0 is the wrong thing to do. It's the right thing to do if you're doing integer maths. True, but the question is how best to decide whether the programmer wants to do integer maths. Deciding based on the types of the o

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 fo

Re: Python

2009-07-21 Thread David Lyon
On Wed, 22 Jul 2009 07:32:22 +0700, khanh le wrote: > do you have any materials about Python? > can you show me the link of Python or some books? http://www.python.org/ > thanks a lots! No problem. Have a nice day. -- 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 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 depe

Re: trouble with minidom

2009-07-21 Thread Gabriel Genellina
En Tue, 21 Jul 2009 21:08:57 -0300, Ronn Ross escribió: Hello I'm trying to read an xml file using minidome. The xml looks like: myProj /here/ My code looks like so: from xml.dom.minidom import parse dom = parse("myfile.xml") for node in dom.getElementsByTagName("proj

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: 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 modules

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: 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 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 need most of the time. However, whe

trouble with minidom

2009-07-21 Thread Ronn Ross
Hello I'm trying to read an xml file using minidome. The xml looks like: myProj /here/ My code looks like so: from xml.dom.minidom import parse dom = parse("myfile.xml") for node in dom.getElementsByTagName("project'): print('name: %s, path: %s \n') % (node.childNodes[0]

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. H

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 wrote: > On Jul 21, 5:29 pm, Simon Forman wrote: > > > > > On Jul 21, 5:00 pm, davidj411 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 transferre

Re: setuptools question.

2009-07-21 Thread David Lyon
On Tue, 21 Jul 2009 11:12:01 -0700, Fred C 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 shell scripts

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 th

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

2009-07-21 Thread Neil Hodgson
milanj: > and all of them use native threads (python still use green threads ?) Python uses native threads. Neil -- http://mail.python.org/mailman/listinfo/python-list

Re: comments? storing a function in an object

2009-07-21 Thread Esmail
Thanks *everyone* for your help, and sharing your knowledge. I had no idea that Python functions could have user defined attributes, and I may now not even need the object to wrap my functions in. Amazing what one can learn here .. thanks again! Esmail -- http://mail.python.org/mailman/listinf

Re: doted filenames in import statements

2009-07-21 Thread Christian Heimes
Chris Rebert wrote: > You want the imp.load_module() function: > http://docs.python.org/library/imp.html#imp.load_module > > __import__() only operates on module/package names. I'm not sure how > you even got it to work with a filename... It used to work with filenames but it was a bug. I guess s

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

2009-07-21 Thread Emile van Sebille
On 7/19/2009 4:35 PM Paul Rubin said... Emile van Sebille writes: Most people would still consider Solaris to be a "major platform". ?? I do not, but I have no idea what comes in 4th after the other three by whatever metric. one metric calls fourth as the iPhone OS... http://marketshare.hitsl

Re: doted filenames in import statements

2009-07-21 Thread Piet van Oostrum
> Jean-Michel Pichavant (JP) wrote: >JP> Hi fellows, >JP> I'd like to use the dynamic __import__ statement. It works pretty well with >JP> non dotted names, but I cannot figure how to make it work with dotted file >JP> paths. What is a dotted file path? Is that 4.6.0.0? >JP> example: >JP>

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

2009-07-21 Thread Piet van Oostrum
> davidj411 (d) wrote: >>> >>> > <--code below -->> >>> > print time.strftime('%m-%d-%Y %H:%m:%S') >>> > <--code above -->> >d> here is the function: >d> def log_out(msg,servername='std.out'): >d> print msg >d> open(log_dir + '\\' + servername + ".log",'a').write(servername + "-" >d

Re: Balanced binary tree implementation

2009-07-21 Thread Piet van Oostrum
> Lucas P Melo (LPM) wrote: >LPM> Hello, >LPM> I would like to use a balanced binary tree implementation (preferably >LPM> within some API). >LPM> Any hints about where I could find it? >LPM> I am looking for something that implements insertion, deletion, search and >LPM> a special search th

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 wrote: On Jul 21, 5:00 pm, davidj411 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

Re: Changing the private variables content

2009-07-21 Thread Rhodri James
On Tue, 21 Jul 2009 21:55:18 +0100, 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. There is no mechanism in Python that makes attributes truly private. se

Re: doted filenames in import statements

2009-07-21 Thread Chris Rebert
On Tue, Jul 21, 2009 at 2:42 PM, Jean-Michel Pichavant 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" > test = __im

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 wrote: > On Jul 21, 5:00 pm, davidj411 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 an

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 wrote: > > davidj411 (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 >

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 Piet van Oostrum
> davidj411 (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 correc

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 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 to be correc

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 Jon Clements
On 21 July, 22:00, davidj411 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 to be correct

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 n

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 t

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):

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 http://www.pyco

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 every

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 box

Re: List insertion cost

2009-07-21 Thread Daniel Stutzbach
On Tue, Jul 21, 2009 at 2:21 PM, Lucas P Melo 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), you can use the b

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: 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" wrote: sightseer wrote: Error Installing Service: Access is Denied. (5) Are you trying to do this on windows vista? -- MPHhttp://blog.dcuktec.com 'If consumed, best digested with added seasoning to own preference.' Yeah, I

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

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 attempte

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 for

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   wrote: > > >Regardless, Nicolas's example can be applied to the class too: > > class Foo(object): > >    pass > > hash(Foo) > >11443104 > >>

Re: Regular expression

2009-07-21 Thread Rhodri James
On Tue, 21 Jul 2009 17:12:53 +0100, Peter Fodrek wrote: 21.7.2009 v 17:39, Rhodri James: On Tue, 21 Jul 2009 14:30:47 +0100, Peter Fodrek > wrote: [snipped for space] This handles text file like // remark PL_OFF PARK FS MA 52.8806 , 18.0914 SS AD_W PL_ON C 52.3955 , -16.1511 , -9

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. htt

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 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 seems reasonably stable

Re: Regular expression

2009-07-21 Thread Jean-Michel Pichavant
Rhodri James wrote: On Tue, 21 Jul 2009 14:30:47 +0100, 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*)?)') Also, whoever wrote this regular expression

Re: win32api install problem

2009-07-21 Thread Tim Golden
MCIPERF wrote: On Jul 20, 9:57 am, Tim Golden 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 "C:\python_projects\euler\driveletters.py", line 1, i

Re: Issue combining gzip and subprocess

2009-07-21 Thread Piet van Oostrum
> Iwan Vosloo (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') >I

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 nee

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: Help understanding the decisions *behind* python?

2009-07-21 Thread Simon Forman
On Jul 20, 12:27 pm, Phillip B Oldham 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 related methods baffle

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 with...

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: 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 out

Re: PIL for OSX 64bit

2009-07-21 Thread Ned Deily
In article , moerchendiser2k3 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 Image.open(...).load() and got: > > ImportError: The _imaging C module is not installed [...]

Re: python function for retrieving key and encryption

2009-07-21 Thread Piet van Oostrum
> jayshree (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(): recip = M2Cry

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 c

Re: Multiple versions of python

2009-07-21 Thread CCW
On 21 July, 15:19, Dave Angel 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 the Windows E

Re: Regular expression

2009-07-21 Thread Rhodri James
On Tue, 21 Jul 2009 14:30:47 +0100, 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*)?)') Always use raw strings (r"...") when you're working with regula

Re: Help understanding the decisions *behind* python?

2009-07-21 Thread Piet van Oostrum
> David Smith (DS) wrote: >DS> Piet van Oostrum wrote: Hendrik van Rooyen (HvR) wrote: >>> >HvR> On Monday 20 July 2009 21:26:07 Phillip B Oldham wrote: >> On Jul 20, 6:08 pm, Duncan Booth wrote: > The main reason why you need both lists and tuples is that because a >

Re: missing 'xor' Boolean operator

2009-07-21 Thread Ethan Furman
Mark Dickinson wrote: On Jul 20, 11:34 pm, Ethan Furman 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: 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 in

Re: Help understanding the decisions *behind* python?

2009-07-21 Thread David Smith
Piet van Oostrum wrote: >> Hendrik van Rooyen (HvR) wrote: > >> HvR> On Monday 20 July 2009 21:26:07 Phillip B Oldham wrote: On Jul 20, 6:08 pm, Duncan Booth wrote: > The main reason why you need both lists and tuples is that because a > tuple of immutable objects is itself immu

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 Piet van Oostrum
> Hendrik van Rooyen (HvR) wrote: >HvR> On Monday 20 July 2009 21:26:07 Phillip B Oldham wrote: >>> On Jul 20, 6:08 pm, Duncan Booth 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 >>>

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 (exc

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

2009-07-21 Thread Slobodan Blazeski
On Jul 19, 7:33 pm, fft1976 wrote: > On Jul 19, 9:55 am, Frank Buss 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, now > > it returns "0.66

Re: tough-to-explain Python

2009-07-21 Thread Simon Forman
On Mon, Jul 20, 2009 at 9:54 PM, Paul Rubin wrote: > Simon Forman 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 start.

Re: invoke method on many instances

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

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 libr

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

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 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 alive, they did p

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: 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 st

Re: Help understanding the decisions *behind* python?

2009-07-21 Thread Inky 788
On Jul 20, 12:27 pm, Phillip B Oldham 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 was probably for optimi

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

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 wh

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 again

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: 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 calle

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" wrote: > sightseer wrote: > > > > > Error Installing Service: Access is Denied. (5) > > > Are you trying to do this on windows vista? > > -- > MPHhttp://blog.dcuktec.com > 'If consumed, best digested with added seasoning to own preference.' Yeah, I was t

  1   2   >