Re: Question to python C API

2009-04-17 Thread alex23
On Apr 17, 4:22 pm, Andreas Otto wrote: >         Question 1: Why you wall it "Pyrex" package ? >From the first paragraph on the Cython site: "Cython is based on the well-known Pyrex, but supports more cutting edge functionality and optimizations." > >python ./setup.py install > > Traceback (mos

Re: ANN: PyGUI 2.0.1

2009-04-17 Thread Thomas Heller
greg schrieb: > Suraj Barkale wrote: > >> I installed this and tried out the tests on Python 2.6.1 and Windows XP >> SP3. Following are my observations. > > Thanks, I'll look into these. > >> Test 33-mouse-events.py: >> 1. mouse-enter and mouse-leave events are not reported. > > That's actu

script question

2009-04-17 Thread Stefano
I have a script like this myscript.py def func01() def func02() def func03() def funcnn() How can i execute my func in the code ? import myscript for i in range(1,n): myscript.func?? many thanks stefano -- http://mail.python.org/mailman/listinfo/python-list

Re: script question

2009-04-17 Thread Chris Rebert
On Fri, Apr 17, 2009 at 12:00 AM, Stefano wrote: > I have a script like this > > myscript.py > >   def func01() >   def func02() >   def func03() >   >   def funcnn() > > How can i execute my func in the code ? > > import myscript > for i in range(1,n): >   myscript.func?? getattr(myscrip

Re: Create standalone Windows program with simple graphics?

2009-04-17 Thread Paul Rudin
Poster28 writes: > I'd like to program and compile a simple graphics program (showing something > like a chess board, some numbers and buttons, mouse support) ... 2d or 3d graphics? You could start by looking at pygame and pyopengl. > ... and provide it as a standalone binary for Windows users

Re: script question

2009-04-17 Thread Peter Otten
Stefano wrote: > I have a script like this > > myscript.py > > def func01() > def func02() > def func03() > > def funcnn() > > How can i execute my func in the code ? > > import myscript > for i in range(1,n): getattr(myscript, "func%02d" % i)() -- http://mail.p

Re: script question

2009-04-17 Thread alex23
On Apr 17, 5:00 pm, "Stefano" wrote: > How can i execute my func in the code ? > > import myscript > for i in range(1,n): >     myscript.func?? for i in range(1,n): getattr(myscript, 'func%d' % i)() -- http://mail.python.org/mailman/listinfo/python-list

Re: Non-secure execution environment

2009-04-17 Thread Ken Seehart
roge...@gmail.com wrote: Hi, I am C++ guy for the most part and don't know much of Python, so, please, bear with me if I am asking errrm..idiotic question. Old rexec module provided kinda 'secure' execution environment. I am not looking for security at this point. What I need an execution envir

Re: How to access C structures

2009-04-17 Thread Stefan Behnel
Chris Helck wrote: > I have a couple dozen C structures that define binary file records. I > need to read the file and access the records. I need to do this very > efficiantly. > > I am aware of the Python struct class, but the C structures contain > arrays of nested structures and I'm not sure if

JSON Template: Minimal but powerful templating language implemented in Python and 3 other languages

2009-04-17 Thread Andy Chu
I'm looking for some feedback based on real usage. There have been a few small features added here and there since it was made public 3 weeks ago, but more comments are appreciated. A big selling point is that it's implemented in JavaScript too, so you can use the same templates on the client and

Re: Question to python C API

2009-04-17 Thread Andreas Otto
alex23 wrote: > On Apr 17, 4:22 pm, Andreas Otto wrote: >> Question 1: Why you wall it "Pyrex" package ? > > From the first paragraph on the Cython site: "Cython is based on the > well-known Pyrex, but supports more cutting edge functionality and > optimizations." > >> >python ./setup.py instal

Re: Question to python C API

2009-04-17 Thread Andreas Otto
Andreas Otto wrote: > alex23 wrote: >> Did you unpack the Cython archive correctly? Is there a Shadow.py in >> your src/Cython-0.11.1/Cython/ folder? > > yes dev1...@linux02:~/ext/x86_64-suse-linux/thread/bin/Cython-0.11.1> ls -al Cython/Shadow.py -rw-r--r-- 1 dev1usr users 4130 3. Apr 10:52 Cy

Re: JSON Template: Minimal but powerful templating language implemented in Python and 3 other languages

2009-04-17 Thread Paul Rubin
Andy Chu writes: > I'm looking for some feedback based on real usage. There have been a > few small features added here and there since it was made public 3 > weeks ago, but more comments are appreciated. It looks cute, but very limited, and lacking in documentation unless I wasn't looking in th

Re: Man Bites Python

2009-04-17 Thread Vito De Tullio
Mikael Olofsson wrote: > I don't think the guy in question finds it that funny. I don't think the python in question finds it that funny. -- By ZeD -- http://mail.python.org/mailman/listinfo/python-list

Re: Accessing a parse tree

2009-04-17 Thread Clarendon
Thank you very much for this information. It seems to point me to the right direction. However, I do not fully understand the flatten function and its output. Some indices seem to be inaccurate. I tried to find this function at nltk.tree.Tree.flatten, but it returns a flattened tree, not a tuple.

Re: get text from rogramms runn by subprocess.Popen immediatetly

2009-04-17 Thread Piet van Oostrum
> Rüdiger Ranft <_r...@web.de> (RR) wrote: >RR> Hi all, >RR> I need to call some programms and catch their stdout and stderr streams. >RR> While the Popen class from subprocess handles the call, I get the >RR> results of the programm not until the programm finishes. Since the >RR> output of th

Re: [OT] large db question about no joins

2009-04-17 Thread Martin P. Hellwig
Daniel Fetchinson wrote: Well, I gave the concrete example of zoo/cage/animal/leg because this *is* the business logic. I need to know for example the total number of animals, this is pretty understandable if you have a zoo. Or you mean that I should give another example? It might be the busin

Re: Choose: class with static methods or module with functions

2009-04-17 Thread Dan Sommers
On Thu, 16 Apr 2009 09:55:40 -0700, bearophileHUGS wrote: > But there can be a situation where you want to keep functions even > closer, for example because in a module you have two classes and two > groups of functions related to each class. In such situation > staticmethods seem better. In orde

Re: [Python-Dev] RELEASED Python 2.6.2

2009-04-17 Thread Piet van Oostrum
> Barry Warsaw (BW) wrote: >BW> On behalf of the Python community, I'm happy to announce the availability >BW> of Python 2.6.2. This is the latest production-ready version in the >BW> Python 2.6 series. Dozens of issues have been fixed since Python 2.6.1 >BW> was released back in Decembe

Re: script question

2009-04-17 Thread Piet van Oostrum
> "Stefano" (S) wrote: >S> I have a script like this >S> myscript.py >S>def func01() >S>def func02() >S>def func03() >S> >S>def funcnn() >S> How can i execute my func in the code ? >S> import myscript >S> for i in range(1,n): >S>myscript.func?? Others have sugg

Re: script question

2009-04-17 Thread Marco Mariani
Piet van Oostrum wrote: funclist = [func01, func02, func03, ... ] for i in range(1,n): funclist[i]() Or myscript.funclist[i]() from another module. Ehm, calling a bazillion things in the right order should be a responsibility of the myscript module anyway. -- http://mail.python.org/mai

QT , Wxwidgets are not just UI framework ?

2009-04-17 Thread Deep_Feelings
qt include many libraries : network , threading,database ..etc while Wxwidgets seem similar but with less scope my question is : does these frameworks replace python's (or any other language for that matter) built-in libraries ? or python does not include that sort of libraries ? thankx -- http:/

Re: binary file compare...

2009-04-17 Thread Nigel Rantor
Adam Olsen wrote: On Apr 16, 11:15 am, SpreadTooThin wrote: And yes he is right CRCs hashing all have a probability of saying that the files are identical when in fact they are not. Here's the bottom line. It is either: A) Several hundred years of mathematics and cryptography are wrong. The

Re: QT , Wxwidgets are not just UI framework ?

2009-04-17 Thread Diez B. Roggisch
Deep_Feelings wrote: > qt include many libraries : network , threading,database ..etc while > Wxwidgets seem similar but with less scope > > my question is : does these frameworks replace python's (or any other > language for that matter) built-in libraries ? or python does not > include that sor

Re: Non-secure execution environment

2009-04-17 Thread Aaron Brady
On Apr 17, 1:47 am, roge...@gmail.com wrote: > Hi, > > I am C++ guy for the most part and don't know much of Python, so, > please, bear with me if I am asking errrm..idiotic question. > > Old rexec module provided kinda 'secure' execution environment. I am > not looking for security at this point.

Re: Man Bites Python

2009-04-17 Thread Aaron Brady
On Apr 17, 3:33 am, Vito De Tullio wrote: > Mikael Olofsson wrote: > > I don't think the guy in question finds it that funny. > > I don't think the python in question finds it that funny. > > -- > By ZeD Man bites python. Python bites dog. Dog bites man. The end. -- http://mail.python.org/mailma

how to know the importing file name from an imported file?

2009-04-17 Thread Visco Shaun
Hi Is there a way to know the name of the script(say A), which is importing a module(say B), from B? ie in above situation i should be able to get name 'A' through some way in B, when A contains an 'import B' statement. -- Thanks & Regards visco -- http://mail.python.org/mailman/listinfo/python-

Re: binary file compare...

2009-04-17 Thread Nigel Rantor
Adam Olsen wrote: On Apr 16, 4:27 pm, "Rhodri James" wrote: On Thu, 16 Apr 2009 10:44:06 +0100, Adam Olsen wrote: On Apr 16, 3:16 am, Nigel Rantor wrote: Okay, before I tell you about the empirical, real-world evidence I have could you please accept that hashes collide and that no matter ho

Re: Accessing a parse tree

2009-04-17 Thread Aaron Brady
On Apr 17, 4:03 am, Clarendon wrote: > Thank you very much for this information. It seems to point me to the > right direction. However, I do not fully understand the flatten > function and its output. Some indices seem to be inaccurate. I tried > to find this function at nltk.tree.Tree.flatten, b

Re: binary file compare...

2009-04-17 Thread Tim Wintle
On Thu, 2009-04-16 at 21:44 -0700, Adam Olsen wrote: > The Wayback Machine has 150 billion pages, so 2**37. Google's index > is a bit larger at over a trillion pages, so 2**40. A little closer > than I'd like, but that's still 56294995000 to 1 odds of having > *any* collisions between *any* o

Re: how to know the importing file name from an imported file?

2009-04-17 Thread Peter Otten
Visco Shaun wrote: > Is there a way to know the name of the script(say A), which is importing > a module(say B), from B? > ie in above situation i should be able to get name 'A' through some way > in B, when A contains an 'import B' statement. While import sys print "I'm imported by %r" % sys._g

Re: compiler package vs parser

2009-04-17 Thread Robin Becker
Kay Schluehr wrote: On 16 Apr., 11:41, Robin Becker wrote: Is the compiler package actually supposed to be equivalent to the parser module? No. The parser module creates a concrete parse tree ( CST ) whereas the compiler package transforms this CST into an AST for subsequent computations. In

how to know the importing file name from an imported file?

2009-04-17 Thread R. David Murray
Visco Shaun wrote: > Hi > > Is there a way to know the name of the script(say A), which is importing > a module(say B), from B? > ie in above situation i should be able to get name 'A' through some way > in B, when A contains an 'import B' statement. Suppose module C imports module B as well? S

sys.setcheckinterval() never gets updated second time. Bug?

2009-04-17 Thread k3xji
Hi all, Yesterday I opened a thread for this issue where I was calling sys.setcheckinterval() with sys.maxint and then try to set it to a lower value but did not succeed with that. Here it is: http://groups.google.com/group/comp.lang.python/browse_thread/thread/fc01a6470245a704/f80733445ce30a36#f8

Re: Help improve program for parsing simple rules

2009-04-17 Thread pruebauno
On Apr 16, 3:59 pm, Aaron Brady wrote: > On Apr 16, 10:57 am, prueba...@latinmail.com wrote: > > > Another interesting task for those that are looking for some > > interesting problem: > > I inherited some rule system that checks for programmers program > > outputs that to be ported: given some si

Re: [OT] large db question about no joins

2009-04-17 Thread andrew cooke
on the more general point about exactly how to handle large data sets, i found this article interesting - http://highscalability.com/unorthodox-approach-database-design-coming-shard andrew -- http://mail.python.org/mailman/listinfo/python-list

Re: how to know the importing file name from an imported file?

2009-04-17 Thread Duncan Booth
Visco Shaun wrote: > Hi > > Is there a way to know the name of the script(say A), which is importing > a module(say B), from B? > ie in above situation i should be able to get name 'A' through some way > in B, when A contains an 'import B' statement. The script always runs in module __main__, s

Re: Help improve program for parsing simple rules

2009-04-17 Thread pruebauno
On Apr 16, 9:29 pm, John Machin wrote: > On Apr 17, 1:57 am, prueba...@latinmail.com wrote: > > > COMP_REPLACERS={'LT':'<', 'GT':'>', 'LE':'<=', 'GE':'>=', '=':'==', > > '=>':'=>', '=<':'=<'} > > What do the '=>' and '=<' represent? Why are you replacing each by > itself? because of this: groups=

Re: [Python-Dev] RELEASED Python 2.6.2

2009-04-17 Thread Barry Warsaw
On Apr 17, 2009, at 5:42 AM, Piet van Oostrum wrote: Maybe a link to the MacOSX image can also be added to http://www.python.org/download Done. -Barry PGP.sig Description: This is a digitally signed message part -- http://mail.python.org/mailman/listinfo/python-list

Re: how to know the importing file name from an imported file?

2009-04-17 Thread Dave Angel
Visco Shaun wrote: Hi Is there a way to know the name of the script(say A), which is importing a module(say B), from B? ie in above situation i should be able to get name 'A' through some way in B, when A contains an 'import B' statement. The full path to the script is stored in sys.argv[0]

Re: Accessing a parse tree

2009-04-17 Thread John Machin
On 17/04/2009 7:32 PM, Clarendon wrote: Dear John Machin I presume that you replied to me instead of the list accidentally. So sorry about the typo. It should be: "the program should *see* that the designated *words* are..." "a long way" has two parentheses to the left -- (VP (DT -- before

Re: Unpreempted behavior with sys.setcheckinterval

2009-04-17 Thread Aahz
In article , k3xji wrote: > >I want unpreempted behavior for some application and do some testing >as below. Well the unpreemption behavior is working fine with >sys.setcheckinterval(sys.maxint). However, when I set the interval to >a lower value, the thread does not being preempted anymore, it r

OpenGL win32 Python

2009-04-17 Thread gintare statkute
Hello, i found an example for OpenGL in windows. It is incredibly helpful, but how to rewrite it to be useful in Python. How to give address of pfd in Python?: iFormat = ChoosePixelFormat( hDC, &pfd ); SetPixelFormat( hDC, iFormat, &pfd ); I found syntax for sizeof and pfd: #! /usr/include/py

Re: compiler package vs parser

2009-04-17 Thread Aahz
In article , Robin Becker wrote: > >My analysis of the problem is that in > > start p.py >def func(D): > for k in D: > exec '%s=D[%r]' % (k,k) > print i, j, k > print locals() > print i, j, k > >if __name__=='__main__': > func(dict(i=1,j=33)) > end p.py > >the

Re: how to know the importing file name from an imported file?

2009-04-17 Thread John Machin
On Apr 17, 9:17 pm, Visco Shaun wrote: > Hi > > Is there a way to know the name of the script(say A), which is importing > a module(say B), from B? > ie in above situation i should be able to get name 'A' through some way > in B, when A contains an 'import B' statement. I find it difficult to ima

Re: OpenGL win32 Python

2009-04-17 Thread Maxim Khitrov
On Fri, Apr 17, 2009 at 9:27 AM, gintare statkute wrote: > Hello, > > i found an example for OpenGL in windows. > It is incredibly helpful, but how to rewrite it to be useful in Python. > > How to give address of pfd in Python?: > iFormat = ChoosePixelFormat( hDC, &pfd ); > SetPixelFormat( hDC, iF

Registering Cron using CronTab

2009-04-17 Thread gurcharan . saini
Hi I'm developing a Django application which is running on Apache. We need to add crontab from the Python script and we are using Python CronTab package for this. I'm stuck with the issue - if we execute the code from Apache the crontab is not gett

Re: compiler package vs parser

2009-04-17 Thread Scott David Daniels
Robin Becker wrote: If I have messed that up then there should be some easy fix, otherwise if pycodegen is somehow not getting the semantics of the the variables i,j correct is there some way I can fix that def func(D): for k in D: exec '%s=D[%r]' % (k,k) print i, j,

Re: Registering Cron using CronTab

2009-04-17 Thread Philip Semanchuk
On Apr 17, 2009, at 9:51 AM, gurcharan.sa...@gmail.com wrote: Hi I'm developing a Django application which is running on Apache. We need to add crontab from the Python script and we are using Python CronTab package for this. I'm stuck with the

Re: script question

2009-04-17 Thread Aahz
In article , Piet van Oostrum wrote: > >Others have suggested getattr. I think a cleaner (more pythonic) way >would be: > >funclist = [func01, func02, func03, ... ] >for i in range(1,n): >funclist[i]() Go to all that trouble, you might as well make it easier: for func in funclist: func

Re: QT , Wxwidgets are not just UI framework ?

2009-04-17 Thread Deep_Feelings
On Apr 17, 1:52 pm, "Diez B. Roggisch" wrote: > Deep_Feelings wrote: > > qt include many libraries : network , threading,database ..etc while > > Wxwidgets seem similar but with less scope > > > my question is : does these frameworks replace python's (or any other > > language for that matter) bui

Re: Man Bites Python

2009-04-17 Thread Dotan Cohen
> Man bites python. > Python bites dog. > Dog bites man. > This beats rock paper scissors by a long shot. Python: Index finger extended Man: Index and middle fingers extended, thumb between them Dog: Four main fingers extended and slightly curved, thumb touches tip of middle finger -- Dotan Coh

Re: script question

2009-04-17 Thread Scott David Daniels
Marco Mariani wrote: Piet van Oostrum wrote: funclist = [func01, func02, func03, ... ] for i in range(1,n): funclist[i]() Or myscript.funclist[i]() from another module. Ehm, calling a bazillion things in the right order should be a responsibility of the myscript module anyway. For ex

Language detection with python

2009-04-17 Thread S.Selvam
Hi all, I am trying for language detection in python.I just need to check whether the input text is english or not. 1)I tried nltk's stopwords and compared with input text,but only with little success. 2)Used oice.langdet for language detection,which uses bi-gram approach.It is also inefficient.

ANN: doit 0.2.0 released

2009-04-17 Thread Eduardo Schettino
doit comes from the idea of bringing the power of build-tools to execute any kind of task. It will keep track of dependencies between “tasks” and execute them only when necessary. It was designed to be easy to use and “get out of your way”. check the new website http://python-doit.sourceforge.net/

Re: script question

2009-04-17 Thread gitulyar
On Apr 17, 5:23 pm, Scott David Daniels wrote: > Marco Mariani wrote: > > Piet van Oostrum wrote: > > >> funclist = [func01, func02, func03, ... ] > >> for i in range(1,n): > >>     funclist[i]() > > >> Or myscript.funclist[i]() from another module. > > > Ehm, calling a bazillion things in the rig

Re: script question

2009-04-17 Thread Peter Pearson
On 17 Apr 2009 07:03:18 -0700, Aahz wrote: > In article , Piet van Oostrum wrote: >> >>funclist = [func01, func02, func03, ... ] >>for i in range(1,n): >>funclist[i]() > > Go to all that trouble, you might as well make it easier: > > for func in funclist: > func() Yes. Especially because

Re: compiler package vs parser

2009-04-17 Thread Gabriel Genellina
En Fri, 17 Apr 2009 10:55:46 -0300, Scott David Daniels escribió: Robin Becker wrote: def func(D): for k in D: exec '%s=D[%r]' % (k,k) print i, j, k print locals() print i, j, k if __name__=='__main__': func(dict(i=1,j=33)) end p.py the compiler package en

Re: [OT] large db question about no joins

2009-04-17 Thread Daniel Fetchinson
>> Well, I gave the concrete example of zoo/cage/animal/leg because this >> *is* the business logic. I need to know for example the total number >> of animals, this is pretty understandable if you have a zoo. Or you >> mean that I should give another example? > > It might be the business logic but

Re: Language detection with python

2009-04-17 Thread Jeremiah Dodds
On Fri, Apr 17, 2009 at 3:19 PM, S.Selvam wrote: > Hi all, > > I am trying for language detection in python.I just need to check whether > the input text is english or not. > > 1)I tried nltk's stopwords and compared with input text,but only with > little success. > > 2)Used oice.langdet for lang

Re: QT , Wxwidgets are not just UI framework ?

2009-04-17 Thread Diez B. Roggisch
Deep_Feelings wrote: > On Apr 17, 1:52 pm, "Diez B. Roggisch" wrote: >> Deep_Feelings wrote: >> > qt include many libraries : network , threading,database ..etc while >> > Wxwidgets seem similar but with less scope >> >> > my question is : does these frameworks replace python's (or any other >> >

Re: script question

2009-04-17 Thread D'Arcy J.M. Cain
On 17 Apr 2009 07:03:18 -0700 a...@pythoncraft.com (Aahz) wrote: > Go to all that trouble, you might as well make it easier: > > for func in funclist: > func() And if you need the return values: retlist = [func() for func in funclist] -- D'Arcy J.M. Cain | Democracy is three

Re: Help improve program for parsing simple rules

2009-04-17 Thread Paul McGuire
On Apr 16, 10:57 am, prueba...@latinmail.com wrote: > Another interesting task for those that are looking for some > interesting problem: > I inherited some rule system that checks for programmers program > outputs that to be ported: given some simple rules and the values it > has to determine if t

Inheriting dictionary attributes and manipulate them in subclasses

2009-04-17 Thread Dominik Ruf
Hi, I just stumbled upon the following behaviour. >>> class base(): ... dic = {'1':'1', '2':'2'} ... >>> class child1(base): ... def __init__(self): ... self.dic.update({'1':'2'}) ... >>> class child2(base): ... pass ... >>> c1 = child1() >>> c2 = child2() >>> >>> print c1.dic {'1': '2',

Re: Help improve program for parsing simple rules

2009-04-17 Thread John Machin
On Apr 18, 1:26 am, Paul McGuire wrote: > On Apr 16, 10:57 am, prueba...@latinmail.com wrote: > > > Another interesting task for those that are looking for some > > interesting problem: > > I inherited some rule system that checks for programmers program > > outputs that to be ported: given some s

Re: Inheriting dictionary attributes and manipulate them in subclasses

2009-04-17 Thread Diez B. Roggisch
Dominik Ruf wrote: > Hi, > > I just stumbled upon the following behaviour. class base(): > ... dic = {'1':'1', '2':'2'} > ... class child1(base): > ... def __init__(self): > ... self.dic.update({'1':'2'}) > ... class child2(base): > ... pass > ... c1 = child1()

Re: binary file compare...

2009-04-17 Thread norseman
Adam Olsen wrote: On Apr 16, 11:15 am, SpreadTooThin wrote: And yes he is right CRCs hashing all have a probability of saying that the files are identical when in fact they are not. Here's the bottom line. It is either: A) Several hundred years of mathematics and cryptography are wrong. The

Re: binary file compare...

2009-04-17 Thread SpreadTooThin
On Apr 17, 4:54 am, Nigel Rantor wrote: > Adam Olsen wrote: > > On Apr 16, 11:15 am, SpreadTooThin wrote: > >> And yes he is right CRCs hashing all have a probability of saying that > >> the files are identical when in fact they are not. > > > Here's the bottom line.  It is either: > > > A) Sever

Re: Accessing a parse tree

2009-04-17 Thread Aaron Brady
On Apr 17, 8:22 am, John Machin wrote: > On 17/04/2009 7:32 PM, Clarendon wrote: > > > Dear John Machin > > I presume that you replied to me instead of the list accidentally. > > > > > So sorry about the typo. It should be: "the program should *see* that > > the designated *words* are..." > > > "a

Re: Non-secure execution environment

2009-04-17 Thread rogeeff
On Apr 17, 7:06 am, Aaron Brady wrote: > On Apr 17, 1:47 am, roge...@gmail.com wrote: > > > > > Hi, > > > I am C++ guy for the most part and don't know much of Python, so, > > please, bear with me if I am asking errrm..idiotic question. > > > Old rexec module provided kinda 'secure' execution envi

Re: get text from rogramms runn by subprocess.Popen immediatetly

2009-04-17 Thread Aaron Brady
On Apr 16, 8:02 am, Rüdiger Ranft <_r...@web.de> wrote: > Diez B. Roggisch schrieb: > > > Rüdiger Ranft schrieb: > >> Hi all, > > >> I need to call some programms and catch their stdout and stderr streams. > >> While the Popen class from subprocess handles the call, I get the > >> results of the pr

Re: Non-secure execution environment

2009-04-17 Thread Aaron Brady
On Apr 17, 11:19 am, roge...@gmail.com wrote: > On Apr 17, 7:06 am, Aaron Brady wrote: snip > > It depends what you mean by secure environment.  One option is to > > create a subprocess, to just limit access your variables.  Another is > > to compile and examine their code yourself, and prohibit t

Re: Non-secure execution environment

2009-04-17 Thread rogeeff
On Apr 17, 3:16 am, Ken Seehart wrote: > roge...@gmail.com wrote: > > Hi, > > > I am C++ guy for the most part and don't know much of Python, so, > > please, bear with me if I am asking errrm..idiotic question. > > > Old rexec module provided kinda 'secure' execution environment. I am > > not look

Re: Suggestions wanted on Tkinter problem

2009-04-17 Thread norseman
Dave Angel wrote: norseman wrote: One suggested I change the subject line - OK I also replaced the [TAB]s since I noticed the Emailer seems to get very confused with them. Problem: Using Python 2.5.2 and Tkinter ??? (came with system) List made and for loop in use lst

Re: script question

2009-04-17 Thread Scott David Daniels
gitulyar wrote: On Apr 17, 5:23 pm, Scott David Daniels wrote: Marco Mariani wrote: Piet van Oostrum wrote: funclist = [func01, func02, func03, ... ] for i in range(1,n): funclist[i]() Or myscript.funclist[i]() from another module. ... For example, you could do it like: funclist = [

cPickle and subclassing lists?

2009-04-17 Thread Reckoner
I have a large class that is a child of list. I need to pickle it, but it's not working. For example, I have reduced it to the following: class Mylist(list): def __init__(self,x=[]): list.__init__(self,x) and I cannot even get this to pickle right. >> w=Mylist([1,2,3]) >> dumps(w) P

Re: Help improve program for parsing simple rules

2009-04-17 Thread Paul McGuire
On Apr 17, 10:43 am, John Machin wrote: > > I don't see how it can handle the chained relop in the last two > testcases e. g. '0.00 LE A LE 4.00' -- unless relops are chained by > default in your parser. > John - First of all, to respect precedence of operations, higher level precedences are par

unpythonic use of property()?

2009-04-17 Thread J Kenneth King
Consider: code: class MyInterface(object): def __get_id(self): return self.__id id = property(fget=__get_id) def __init__(self, id, foo): self.__id = id self.foo = foo class MyInterf

Re: QT , Wxwidgets are not just UI framework ?

2009-04-17 Thread Phil Thompson
On Fri, 17 Apr 2009 07:04:40 -0700 (PDT), Deep_Feelings wrote: > On Apr 17, 1:52 pm, "Diez B. Roggisch" wrote: >> Deep_Feelings wrote: >> > qt include many libraries : network , threading,database ..etc while >> > Wxwidgets seem similar but with less scope >> >> > my question is : does these fram

Re: cPickle and subclassing lists?

2009-04-17 Thread Peter Otten
Reckoner wrote: > I have a large class that is a child of list. I need to pickle it, but > it's not working. For example, I have reduced it to the following: > > class Mylist(list): > def __init__(self,x=[]): > list.__init__(self,x) > > and I cannot even get this to pickle right. > >>> w=My

Re: compiler package vs parser

2009-04-17 Thread Kay Schluehr
> I realize that I probably ought to be trying this out with the newer ast > stuff, > but currently I am supporting code back to 2.3 and there's not much hope of > doing it right there without using the compiler package. You might consider using the *builtin* parser module and forget about the co

Re: cPickle and subclassing lists?

2009-04-17 Thread Reckoner
On Apr 17, 10:42 am, Peter Otten <__pete...@web.de> wrote: > Reckoner wrote: > > I have a large class that is a child of list. I need to pickle it, but > > it's not working. For example, I have reduced it to the following: > > > class Mylist(list): > > def __init__(self,x=[]): > > list.__init__

Re: [Python-Dev] RELEASED Python 2.6.2

2009-04-17 Thread Russell Owen
On Apr 16, 2009, at 11:17 PM, Ronald Oussoren wrote: On 16 Apr, 2009, at 20:58, Russell Owen wrote: I installed the Mac binary on my Intel 10.5.6 system and it works, except it still uses Apple's system Tcl/Tk 8.4.7 instead of my ActiveState 8.4.19 (which is in /Library/Frameworks where one

Re: script question

2009-04-17 Thread python
Scott, Newbie question (and I'm not the OP): What are your thoughts on having your decorator add an attribute to the functions vs. placing the functions in a global variable? def _included(f): f._included = True return f I tried experimenting with this technique, but could not find a way

Re: cPickle and subclassing lists?

2009-04-17 Thread Peter Otten
Reckoner wrote: > On Apr 17, 10:42 am, Peter Otten <__pete...@web.de> wrote: >> Reckoner wrote: >> > I have a large class that is a child of list. I need to pickle it, but >> > it's not working. For example, I have reduced it to the following: >> >> > class Mylist(list): >> > def __init__(self

Re: cPickle and subclassing lists?

2009-04-17 Thread Piet van Oostrum
> Reckoner (R) wrote: >R> I have a large class that is a child of list. I need to pickle it, but >R> it's not working. For example, I have reduced it to the following: >R> class Mylist(list): >R> def __init__(self,x=[]): >R> list.__init__(self,x) >R> and I cannot even get this to pi

Re: Help improve program for parsing simple rules

2009-04-17 Thread Aaron Brady
On Apr 17, 7:37 am, prueba...@latinmail.com wrote: > On Apr 16, 3:59 pm, Aaron Brady wrote: > > > > > On Apr 16, 10:57 am, prueba...@latinmail.com wrote: > > > > Another interesting task for those that are looking for some > > > interesting problem: > > > I inherited some rule system that checks f

Re: binary file compare...

2009-04-17 Thread Adam Olsen
On Apr 17, 5:30 am, Tim Wintle wrote: > On Thu, 2009-04-16 at 21:44 -0700, Adam Olsen wrote: > > The Wayback Machine has 150 billion pages, so 2**37.  Google's index > > is a bit larger at over a trillion pages, so 2**40.  A little closer > > than I'd like, but that's still 56294995000 to 1 od

Re: Help improve program for parsing simple rules

2009-04-17 Thread Aaron Brady
On Apr 17, 12:15 pm, Paul McGuire wrote: > On Apr 17, 10:43 am, John Machin wrote: snip > not only does this handle > "0.00 LE A LE 4.00", but it could also evaluate "0.00 LE A LE 4.00 LE > E > D".  (I see that I should actually do some short-circuiting here - > if ret is false after calling fn(v

can't install new modules after updating python

2009-04-17 Thread lie
I've updated from python 2.5 to 2.6 on my Slackware 12.2, by compiling the 2.6 source. When I try to use slapt-get to install a new module for python, it installs in the old version, and I can't use it. How can I fix this? Should I go back to 2.5? -- http://mail.python.org/mailman/listinfo/python-l

Re: binary file compare...

2009-04-17 Thread Adam Olsen
On Apr 17, 9:59 am, norseman wrote: > The more complicated the math the harder it is to keep a higher form of > math from checking (or improperly displacing) a lower one.  Which, of > course, breaks the rules.  Commonly called improper thinking. A number > of math teasers make use of that. Of cou

ANN: ConfigObj 4.6.0 and Validate 1.0.0 released

2009-04-17 Thread Fuzzyman
Finally a fresh release ConfigObj and Validate. * ConfigObj Home page: http://www.voidspace.org.uk/python/configobj.html * Validate Home page: http://www.voidspace.org.uk/python/validate.html **ConfigObj** is a simple to use but powerful Python library for the reading and writing of configuration

Re: binary file compare...

2009-04-17 Thread Adam Olsen
On Apr 17, 9:59 am, SpreadTooThin wrote: > You know this is just insane.  I'd be satisfied with a CRC16 or > something in the situation i'm in. > I have two large files, one local and one remote.  Transferring every > byte across the internet to be sure that the two files are identical > is just n

Re: need to start a new project , can python do all that ?

2009-04-17 Thread Hyuga
On Apr 15, 10:54 am, Deep_Feelings wrote: > On Apr 15, 4:05 pm, Tim Rowe wrote: > > > > > 2009/4/15 Deep_Feelings : > > > > I want to start programming a new program (electronic health care > > > center) in python and before start learning python i wanna make sure > > > that python does have all

question about xrange performance

2009-04-17 Thread _wolf
lately i realized a slow running portion of my application, and a quick profiling nourished the suspicion that, of all things, calls to `xrange().__contains__` (`x in b` where `b = xrange(L,H)`) is the culprit. to avoid any other influences, i wrote this test script with class `xxrange` being a poo

Re: Lambda alternative?

2009-04-17 Thread J. Cliff Dyer
On Thu, 2009-04-16 at 13:33 +0200, Hrvoje Niksic wrote: > mousemeat writes: > > > Correct me if i am wrong, but i can pickle an object that contains a > > bound method (it's own bound method). > > No, you can't: > > >>> import cPickle as p > >>> p.dumps([]) > '(l.' > >>> p.dumps([].append) > Tr

Re: [OT] large db question about no joins

2009-04-17 Thread J. Cliff Dyer
On Thu, 2009-04-16 at 14:11 -0700, John Fabiani wrote: > Daniel Fetchinson wrote: > > > Hi folks, I've come across many times the claim that 'joins are bad' > > for large databases because they don't scale > > IMO that's bull... OK. That makes four legs so far > -- > http://mail.python.org

Re: question about xrange performance

2009-04-17 Thread MRAB
_wolf wrote: lately i realized a slow running portion of my application, and a quick profiling nourished the suspicion that, of all things, calls to `xrange().__contains__` (`x in b` where `b = xrange(L,H)`) is the culprit. to avoid any other influences, i wrote this test script with class `xxran

Re: Lambda alternative?

2009-04-17 Thread Aaron Brady
On Apr 17, 1:43 pm, "J. Cliff Dyer" wrote: > On Thu, 2009-04-16 at 13:33 +0200, Hrvoje Niksic wrote: > > mousemeat writes: > > > > Correct me if i am wrong, but i can pickle an object that contains a > > > bound method (it's own bound method). > > > No, you can't: > > > >>> import cPickle as p >

Re: Help improve program for parsing simple rules

2009-04-17 Thread Paul McGuire
On Apr 17, 1:26 pm, Aaron Brady wrote: > Hi, not to offend; I don't know your background.   Courtesy on Usenet!!! I'm going to go buy a lottery ticket! Not to worry, I'm a big boy. People have even called my baby ugly, and I manage to keep my blood pressure under control. > One thing I like >

  1   2   >