Re: Does Python really follow its philosophy of "Readability counts"?

2009-01-22 Thread Steven D'Aprano
On Wed, 21 Jan 2009 01:02:37 -0800, Aaron Brady wrote: >> >>> class Parrot: >> >> ...     _private = 'spam' >> ...>>> p = Parrot() >> >>> p._private = 'ham'  # allowed by default from protection import >> >>> lock >> >>> lock(p)._private >> >>> p._private = 'spam' >> >> Traceback (most recent call

Re: malloc (error code=12)

2009-01-22 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Arash Arfaee wrote: > Very BIG Jesse It works on a huge Boolean function. > And thanks Roger. Do you think it will be solved if I run it over > another OS like windows? By far the simplest solution is to use a 64 bit process on a 64 bit operating

Re: English-like Python

2009-01-22 Thread Steven D'Aprano
On Wed, 21 Jan 2009 08:17:34 -0700, Joe Strout wrote: > Steven D'Aprano wrote: ... >> But even if RB doesn't have these things, I question that the syntax is >> "beautiful". Consider some arbitrary method Foo. If you see this: >> >> Foo >> >> Is that legal RB syntax? > > You betcha! How

Re: English-like Python

2009-01-22 Thread Aaron Brady
On Jan 22, 1:46 am, Steven D'Aprano wrote: > On Wed, 21 Jan 2009 00:57:49 -0800, Aaron Brady wrote: > > Natural language doesn't have the equivalent of parentheses, > > I take it you mean natural language doesn't have the equivalent of > parentheses for *calling*, since NLs can (and do) use parent

Re: Does Python really follow its philosophy of "Readability counts"?

2009-01-22 Thread Steven D'Aprano
On Wed, 21 Jan 2009 12:55:42 -0500, Luis Zarrabeitia wrote: > Btw, the correctness of a program (on a turing-complete language) cannot > be statically proven. Ask Turing about it. The correctness of *all* *arbitrary* programs cannot be proven. That doesn't mean that no programs can be proven.

Re: English-like Python

2009-01-22 Thread Aaron Brady
On Jan 22, 2:17 am, Steven D'Aprano wrote: > On Wed, 21 Jan 2009 08:17:34 -0700, Joe Strout wrote: > > But of course.  Any method call is legal only if the form of the call > > matches the method prototype -- if you try to call a function that > > requires 4 parameters, and give it only 3, that's

Re: Dictionary : items()

2009-01-22 Thread Steven D'Aprano
On Wed, 21 Jan 2009 23:02:11 -0800, koranthala wrote: > Hi, >Dictionary has the items method which returns the value as a list > of tuples. >I was wondering whether it would be a good idea to have an extra > parameter - sort - to allow the tuples to be sorted as the desire of > users. >

Re: Dictionary : items()

2009-01-22 Thread Paul Rubin
Steven D'Aprano writes: > That is better written as: > l = sorted(abcd.items(), key=lambda x:(x[1].lower(), x[0])) In Python 2.x, I prefer the style l = sorted(abcd.iteritems(), key=lambda (k,v): (v.lower(), k)) but Python 3.0 breaks the tuple unpacking per some PEP. -- http://mail.python.org

Re: Does Python really follow its philosophy of "Readability counts"?

2009-01-22 Thread Paul Rubin
Tim Rowe writes: > Programs done in Ada are, by objective measures, more reliable than > those done in C and C++ (the very best released C++ programs are about > as good as the worst released Ada programs), although I've always > wondered how much of that is because of language differences and how

A different kind of interface

2009-01-22 Thread bearophileHUGS
I use the Python shell daily, plus of course normal editors to edit python scripts. They both are very useful for different purposes. But the default interactive shell isn't much handy if you want to modify the past code to run it again, or you want to embed a bit of text in the code, or if you wan

Re: Logging help

2009-01-22 Thread Vinay Sajip
On Jan 22, 6:49 am, koranthala wrote: > I understand Vinay. But my point is that I wanted a mechanism to > rotate the log files based on data - i.e. today one log, tomorrow Did you mean "based on date"? > another. This is easier because when trouble tickets are raised, users > mention that X fai

Seeking pure Python AES/RSA library compatible with OpenSSL

2009-01-22 Thread novosibirsk
Hello, I am faced with the following problem: 0. In pure Python, encrypt some data using AES. 1. In pure Python, encrypt the key used in 0 with RSA, given a private key in PEM format. 2. In C, using OpenSSL, decrypt the AES key from 0 using the public key that corresponds to private key in 1. 3.

Re: Does Python really follow its philosophy of "Readability counts"?

2009-01-22 Thread Bruno Desthuilliers
Steven D'Aprano a écrit : On Wed, 21 Jan 2009 12:54:31 +0100, Bruno Desthuilliers wrote: Russ P. a écrit : (snip) In any case, I have suggested that Python should perhaps get a new keyword, "private" or "priv". And quite a few people - most of them using Python daily - answered they didn't wa

Re: is this pythonic?

2009-01-22 Thread Peter Otten
TP wrote: > Hi, > > Is the following code pythonic: > l=[{"title":"to", "value":2},{"title":"ti","value":"coucou"}] dict = [ dict for dict in l if dict['title']=='ti'] l.remove(*dict) l > [{'title': 'to', 'value': 2}] > > Precision: I have stored data in the list of dictiona

Formal specification and proof (was : Does Python really follow its philosophy of "Readability counts"?)

2009-01-22 Thread Ricardo Aráoz
Mark Wooding wrote: > Steven D'Aprano writes: > > > >> No it's not. It's *practical*. There are domains where *by law* code >> needs to meet all sorts of strict standards to prove safety and >> security, and Python *simply cannot meet those standards*. >> > > Codswallop. One can prove stu

Re: Seeking pure Python AES/RSA library compatible with OpenSSL

2009-01-22 Thread Paul Rubin
novosibi...@gmail.com writes: > 0. In pure Python, encrypt some data using AES. > 1. In pure Python, encrypt the key used in 0 with RSA, given a private > key in PEM format. > Question --- is there a library I can use for steps 0 and 1? I know there are some AES libs around, try google. The libs

Re: A different kind of interface

2009-01-22 Thread Ben Finney
bearophileh...@lycos.com writes: > I use the Python shell daily, plus of course normal editors to edit > python scripts. They both are very useful for different purposes. > But the default interactive shell isn't much handy if you want to > modify the past code to run it again, or you want to embe

Re: A different kind of interface

2009-01-22 Thread Ben Finney
bearophileh...@lycos.com writes: > I use the Python shell daily, plus of course normal editors to edit > python scripts. They both are very useful for different purposes. > But the default interactive shell isn't much handy if you want to > modify the past code to run it again, or you want to embe

Re: Does Python really follow its philosophy of "Readability counts"?

2009-01-22 Thread Bruno Desthuilliers
Paul Rubin a écrit : Bruno Desthuilliers writes: In my limited experience with Haskell (statically typed but very high level), "dynamic" and "static" were not meant to concern typing here (or at least not only typing). I'm not sure what you mean by those terms then. Python (and some other

Re: A different kind of interface

2009-01-22 Thread Bruno Desthuilliers
bearophileh...@lycos.com a écrit : I use the Python shell daily, plus of course normal editors to edit python scripts. They both are very useful for different purposes. But the default interactive shell isn't much handy if you want to modify the past code to run it again, or you want to embed a b

Re: Seeking pure Python AES/RSA library compatible with OpenSSL

2009-01-22 Thread novosibirsk
On Jan 22, 1:42 am, Paul Rubin wrote: > novosibi...@gmail.com writes: > > 0. In pure Python, encrypt some data using AES. > > 1. In pure Python, encrypt the key used in 0 with RSA, given a private > > key in PEM format. > > Question --- is there a library I can use fo

Re: USB in python

2009-01-22 Thread Diez B. Roggisch
Astan Chee wrote: > Hi, > Im trying to write a program for my USB device and I'm thinking of using > python to do this. The USB device is of my own making and it is > activated when one of the two data pins of the USB is given about 5V (or > similar to whatever the power pin is getting). Now I'm c

Re: USB in python

2009-01-22 Thread Tino Wildenhain
Astan Chee wrote: Hi, Im trying to write a program for my USB device and I'm thinking of using python to do this. The USB device is of my own making and it is activated when one of the two data pins of the USB is given about 5V (or similar to whatever the power pin is getting). Now I'm confuse

Re: List comprehension - NameError: name '_[1]' is not defined ?

2009-01-22 Thread mario ruggier
On Jan 16, 7:17 pm, Paul Rubin wrote: > mario ruggier writes: > > All the above attempts will be blocked this way. Any other disallow- > > sub-strings to add to the list above? > > I think what you are trying to do is fundamentally hopeless.  You > might look at web.

Re: Ideas to optimize this getitem/eval call?

2009-01-22 Thread mario g
On Sun, Jan 4, 2009 at 6:46 PM, Tino Wildenhain wrote: > mario wrote: >> >> On Jan 3, 7:16 am, Steven D'Aprano > cybersource.com.au> wrote: >> >>> I was about to make a comment about this being a security hole, >> >> Strange that you say this, as you are also implying that *all* the >> widely-used

Re: Start Python at client side from web app

2009-01-22 Thread Thomas Guettler
Bryan Olson schrieb: > Thomas Guettler wrote: >> Sorry, I described my problem not well. Here is more information: > > Actually you did pretty well. > > [...] >> The main application is the intranet web application used with IE (ms >> windows client). > > Your idea of a custom mime-type, with a

Re: Start Python at client side from web app

2009-01-22 Thread Thomas Guettler
Diez B. Roggisch schrieb: > >> 2) create a localhost web server, for the client side manipulation. >> Then have your remote webserver render a form that posts via >> javavscript to the localhost webserver. The localhost server would >> post back in >> the same way. > > AFAIK the JS security mode

Re: Does Python really follow its philosophy of "Readability counts"?

2009-01-22 Thread Tim Rowe
> Btw, the correctness of a program (on a turing-complete language) cannot be > statically proven. Ask Turing about it. For the most safety critical of programmes, for which static proof is required, restrictions are placed on the use of the language that effectively mean that it is not Turing-com

Re: file write collision consideration

2009-01-22 Thread Gary
It would help to know which version of Python when giving examples... I recollect that so-called mutex operation wasn't actually thread safe when using Python 2.5, but perhaps that was wrong, or subsequent versions have fixed that? -- http://mail.python.org/mailman/listinfo/python-list

Tutorial on working with Excel files in Python (without COM and cross platform!) at PyConUS 2009

2009-01-22 Thread Chris Withers
Hi All, Too many people in the Python community think the only way to work with Excel files in Python is using COM on Windows. To try and correct this, I'm giving a tutorial at this year's PyCon in Chicago on Wednesday, 25th March that will cover working with Excel files in Python using the pu

Re: Start Python at client side from web app

2009-01-22 Thread Thomas Guettler
Paul Rubin schrieb: > Thomas Guettler writes: >> 1. The user pushes a button in the web app. >> 2. Webserver sends signed python code to the client with own mime type >> 3. IE sends code to the python application. >> 4. Signature gets checked, Python code on the client gets executed. >> 5. Maybe s

Re: A different kind of interface

2009-01-22 Thread bearophileHUGS
Ben Finney: > Adding an editor to Python solves this problem only for Python. I'm sure that once such "editor" (I use the word editor for lack of a better term) is created, it can also be quickly adapted with other dynamic languages, like Ruby, TCL, Lua, Io, Perl, Awk, ecc. Probably it can't be a

Recommended SOAP library?

2009-01-22 Thread morphex
Hi, I have to implement a service which involves some SOAP/WSDL. So far I've found http://pywebsvcs.sourceforge.net/ Is that the recommended library to build some logic which sets/ retrieves some information from a web service? Thanks, Morten -- http://mail.python.org/mailman/listinfo/python-

Re: Recommended SOAP library?

2009-01-22 Thread GHZ
if you require a SOAP client, then I would recommend SUDS https://fedorahosted.org/suds/ Other options are not in active development, so is difficult to get support. -- http://mail.python.org/mailman/listinfo/python-list

Re: A different kind of interface

2009-01-22 Thread Stef Mientki
Several guys are working on a MatLab like editor / IDE, based on wxPython, including myself ;-) see http://mientki.ruhosting.nl/data_www/pylab_works/pw_debug.html e.g. with F9 it runs either the selected code or if nothing selected the whole code or even more powerfull (depending on your needs)

Re: Python 3: exec arg 1

2009-01-22 Thread Alan G Isaac
On 1/20/2009 3:53 PM Rob Williscroft apparently wrote: http://bugs.python.org/issue1762972 (*) Useful. Thanks. Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list

Re: Does Python really follow its philosophy of "Readability counts"?

2009-01-22 Thread Steven D'Aprano
On Thu, 22 Jan 2009 10:33:26 +0100, Bruno Desthuilliers wrote: > Steven D'Aprano a écrit : >> On Wed, 21 Jan 2009 12:54:31 +0100, Bruno Desthuilliers wrote: >> >>> Russ P. a écrit : >>> (snip) In any case, I have suggested that Python should perhaps get a new keyword, "private" or "priv

Re: is this pythonic?

2009-01-22 Thread TP
Peter Otten wrote: > If you can change the rest of your program to work smoothly with a > dictionary I would suggest the following: [snip] >>> from collections import defaultdict [snip] Thanks a lot. I didn't know defaultdict. It is powerful. I begin to understand that people prefer using dictio

subclass PyDictObject -- any gotchas?

2009-01-22 Thread Aaron Brady
Hello all, I am trying to create a mapping class similar to the base dictionary, but with some added behaviors that affect pointers on a low level. I have a bare-bones version I compiled with MinGW, and it is working! I want to know if there is anything that is going to bite me later, when I sta

Re: pep 8 constants

2009-01-22 Thread Benjamin Kaplan
On Thu, Jan 22, 2009 at 1:16 AM, Aahz wrote: > In article , > Brendan Miller wrote: > > > >PEP 8 doesn't mention anything about using all caps to indicate a > constant. > > Now it does! See > http://www.python.org/dev/peps/pep-0008/ > > Thanks for bringing this up! Since the constants in the

Why GIL? (was Re: what's the point of rpython?)

2009-01-22 Thread Aahz
In article <7xd4ele060@ruckus.brouhaha.com>, Paul Rubin wrote: >alex23 writes: >> >> Here's an article by Guido talking about the last attempt to remove >> the GIL and the performance issues that arose: >> >> "I'd welcome a set of patches into Py3k *only if* th

Re: what's the point of rpython?

2009-01-22 Thread Aahz
In article , Ross Ridge wrote: >Scott David Daniels wrote: >> >>The opcode cannot simply talk to its cache, it must either go directly >>to off-chip memory or communicate to other processors that it (and it >>alone) owns the increment target. > >In fact all it does simply talk to its cache. Fr

Re: Recommended SOAP library?

2009-01-22 Thread morphex
On 22 Jan, 13:38, GHZ wrote: > if you require a SOAP client, then I would recommend > SUDShttps://fedorahosted.org/suds/ > > Other options are not in active development, so is difficult to get > support. SUDS looks great, thanks for the tip! :) -Morten -- http://mail.python.org/mailman/listinfo

Re: Does Python really follow its philosophy of "Readability counts"?

2009-01-22 Thread Bruno Desthuilliers
Steven D'Aprano a écrit : On Thu, 22 Jan 2009 10:33:26 +0100, Bruno Desthuilliers wrote: Steven D'Aprano a écrit : On Wed, 21 Jan 2009 12:54:31 +0100, Bruno Desthuilliers wrote: Russ P. a écrit : (snip) In any case, I have suggested that Python should perhaps get a new keyword, "private" or

Jabber xml-rpc

2009-01-22 Thread makkalot
Hi all i have a program which does some xml-rpc work over SSL, i want now to add some NAT capibilites to my program. The way i thought is to use jabber and send my calls over jabber xml-rpc and ssl it. - Is it the best way to make sth 'natted'? - If yes which library do u reccommend ? twisted o

Executing previous stack frame

2009-01-22 Thread sturlamolden
frame = sys._getframe().f_back is the previous stack frame. Is there any way to execute (with exec or eval) frame.f_code beginning from frame.f_lasti or frame.f_lineno? I am trying to spawn a thread that is initialized with the code and state of the previous stack frame. S.M. -- http://mail.py

About SCons Re: [Python-Dev] progress: compiling python2.5 under msys (specifically but not exclusively under wine) with msvcr80

2009-01-22 Thread anatoly techtonik
On Thu, Jan 22, 2009 at 12:51 AM, Roumen Petrov wrote: >> >> Against 2.3, rejected due to dependence on SCons. >> Also appears to have been incomplete, needing more work. > > No it was complete but use SCons. Most of changes changes in code you will > see again in 3871. > I would better use SCons

Re: is this pythonic?

2009-01-22 Thread pruebauno
On Jan 21, 4:23 pm, Scott David Daniels wrote: > prueba...@latinmail.com wrote: > > ... If you have duplicates this will not work. You will have to do > > something like this instead: > > o=[] > i=0 > ln=len(l) > while i >    if l[i]['title']=='ti': > >            o.append(l.po

Re: is this pythonic?

2009-01-22 Thread pruebauno
On Jan 21, 4:23 pm, Scott David Daniels wrote: > prueba...@latinmail.com wrote: > > ... If you have duplicates this will not work. You will have to do > > something like this instead: > > o=[] > i=0 > ln=len(l) > while i >    if l[i]['title']=='ti': > >            o.append(l.po

Re: Does Python really follow its philosophy of "Readability counts"?

2009-01-22 Thread Mark Wooding
Paul Rubin writes: > Also, the application area matters. There is a difference between > programming for one's own enjoyment or to do a personal task, and > writing programs whose reliability or lack of it can affect other > people's lives. I've never done any safe

Re: what's the point of rpython?

2009-01-22 Thread MRAB
Paul Rubin wrote: Ross Ridge writes: Scott David Daniels wrote: The opcode cannot simply talk to its cache, it must either go directly to off-chip memory or communicate to other processors that it (and it alone) owns the increment target. The cache coherency mechanism automatically preven

Re: Logging help

2009-01-22 Thread koranthala
On Jan 22, 2:14 pm, Vinay Sajip wrote: > On Jan 22, 6:49 am,koranthala wrote: > > > I understand Vinay. But my point is that I wanted a mechanism to > > rotate the log files based on data - i.e. today one log, tomorrow > > Did you mean "based on date"? > > > another. This is easier because when tr

Python Style Question

2009-01-22 Thread K-Dawg
I am trying to become more pythonic as I learn python and get my mind around it instead of other languages I have used. I have an app that has a series of classes for objects it uses. From a style perspective, which should be done: Different py file for each class or One py file with all the c

Re: English-like Python

2009-01-22 Thread Joe Strout
Steven D'Aprano wrote: Foo Is that legal RB syntax? You betcha! How do you know? I haven't specified what Foo does. You haven't specified whether "Foo" is a valid identifier at all, so I'm assuming that it is both valid and used correctly here. The syntax is certainly valid -- it m

Re: Python Style Question

2009-01-22 Thread Steve Holden
K-Dawg wrote: > I am trying to become more pythonic as I learn python and get my mind > around it instead of other languages I have used. > > I have an app that has a series of classes for objects it uses. From a > style perspective, which should be done: > > Different py file for each class >

Re: A different kind of interface

2009-01-22 Thread Vic Kelson
How about IDLE? It's a nice tool for the Python programmer. I've tried lots of IDEs, but when it comes down to it, on small-to-medium jobs I am be very productive indeed using IDLE... --v -- http://mail.python.org/mailman/listinfo/python-list

Re: subclass PyDictObject -- any gotchas?

2009-01-22 Thread Aaron Brady
On Jan 22, 7:49 am, Aaron Brady wrote: > Hello all, > > I am trying to create a mapping class similar to the base dictionary, > but with some added behaviors that affect pointers on a low level.  I > have a bare-bones version I compiled with MinGW, and it is working!  I > want to know if there is

Re: A different kind of interface

2009-01-22 Thread Doug Morse
On Thu, 22 Jan 2009 08:13:49 -0800 (PST), Vic Kelson wrote: > > > How about IDLE? It's a nice tool for the Python programmer. I've tried > lots of IDEs, but when it comes down to it, on small-to-medium jobs I > am be very productive indeed using IDLE... > > --v I find Stani's Python Edito

Re: A different kind of interface

2009-01-22 Thread Steve Holden
Doug Morse wrote: > On Thu, 22 Jan 2009 08:13:49 -0800 (PST), Vic Kelson > wrote: >> >> How about IDLE? It's a nice tool for the Python programmer. I've tried >> lots of IDEs, but when it comes down to it, on small-to-medium jobs I >> am be very productive indeed using IDLE... >> >> --v > >

Re: A different kind of interface

2009-01-22 Thread Eduardo O. Padoan
On Thu, Jan 22, 2009 at 7:10 AM, wrote: > I use the Python shell daily, plus of course normal editors to edit > python scripts. They both are very useful for different purposes. But > the default interactive shell isn't much handy if you want to modify > the past code to run it again, or you want

Re: Python Style Question

2009-01-22 Thread Terry Reedy
Steve Holden wrote: K-Dawg wrote: I am trying to become more pythonic as I learn python and get my mind around it instead of other languages I have used. I have an app that has a series of classes for objects it uses. From a style perspective, which should be done: Different py file for each

Re: pep 8 constants

2009-01-22 Thread Terry Reedy
Benjamin Kaplan wrote: On Thu, Jan 22, 2009 at 1:16 AM, Aahz > wrote: In article mailto:mailman.7174.1231915778.3487.python-l...@python.org>>, Brendan Miller mailto:catph...@catphive.net>> wrote: > >PEP 8 doesn't mention anything about using all

Re: Does Python really follow its philosophy of "Readability counts"?

2009-01-22 Thread Steven D'Aprano
On Thu, 22 Jan 2009 15:12:31 +0100, Bruno Desthuilliers wrote: > Steven D'Aprano a écrit : >> On Thu, 22 Jan 2009 10:33:26 +0100, Bruno Desthuilliers wrote: >> >>> Steven D'Aprano a écrit : On Wed, 21 Jan 2009 12:54:31 +0100, Bruno Desthuilliers wrote: > Russ P. a écrit : > (sni

Re: A different kind of interface

2009-01-22 Thread Terry Reedy
Steve Holden wrote: Doug Morse wrote: On Thu, 22 Jan 2009 08:13:49 -0800 (PST), Vic Kelson wrote: How about IDLE? It's a nice tool for the Python programmer. I've tried lots of IDEs, but when it comes down to it, on small-to-medium jobs I am be very productive indeed using IDLE... Since I

Re: what's the point of rpython?

2009-01-22 Thread Ross Ridge
Ross Ridge writes: > The same cache coherency mechanism that prevents ordinary "unlocked" > instructions from simulanteously modifying the same cache line on > two different processors also provides the guarantee with "locked" > instructions. There's no additional hardware locks involved, and no

Re: Logging help

2009-01-22 Thread Vinay Sajip
On Jan 22, 3:40 pm, koranthala wrote: > Thank you very much Vinay. You have been extremely helpful. > This was my first design - but then I found that log system was taking > up quite a huge chunk of the memory. > That is why I went to rotating file handler. Using just plain FileHandler takes up

Counter Class -- Bag/Multiset

2009-01-22 Thread Raymond Hettinger
The collections module in Python 2.7 and Python 3.1 has gotten a new Counter class that works like bags and multisets in other languages. I've adapted it for Python2.5/2.6 so people can start using it right away: http://docs.python.org/dev/library/collections.html#counter-objects Here's a link

Re: Counter Class -- Bag/Multiset

2009-01-22 Thread Raymond Hettinger
> I've adapted it for Python2.5/2.6 so people can start using it right > away: That should just be Python2.6. -- http://mail.python.org/mailman/listinfo/python-list

Re: A different kind of interface

2009-01-22 Thread bearophileHUGS
Eduardo O. Padoan: > You are almost *describing* reinteract: - Thank you for the link and the software, I have not tried it yet, but from the screencast it looks quite nice. - I am glad that there are people that don't think that Emacs is (despite being good) the alpha and omega of editing. There'

Re: Does Python really follow its philosophy of "Readability counts"?

2009-01-22 Thread Mark Wooding
Steven D'Aprano writes: > On Thu, 22 Jan 2009 15:12:31 +0100, Bruno Desthuilliers wrote: >> Steven D'Aprano a écrit : >>> But if you have free access to attributes, then *everything* is >>> interface. >> >> Nope. > > How could anyone fail to be convinced by an argument that detailed and > carefu

Re: Start Python at client side from web app

2009-01-22 Thread Diez B. Roggisch
Rob Williscroft schrieb: Diez B. Roggisch wrote in news:6tpo16fbacf...@mid.uni-berlin.de in comp.lang.python: 2) create a localhost web server, for the client side manipulation. Then have your remote webserver render a form that posts via javavscript to the localhost webserver. The localhost

Re: Executing previous stack frame

2009-01-22 Thread Jeff McNeil
On Jan 22, 9:49 am, sturlamolden wrote: > frame = sys._getframe().f_back is the previous stack frame. Is there > any way to execute (with exec or eval) frame.f_code beginning from > frame.f_lasti or frame.f_lineno? > > I am trying to spawn a thread that is initialized with the code and > state of

Dealing with large memory under linux or How to Build 64bit Python

2009-01-22 Thread proteus...@gmail.com
I've got an Ubuntu (2.6.27-9-server SMP i686 GNU/Linux) setup with 6GB RAM running python 2.5. I'm running a simulation program that is breaking as soon as it hits ~3GB RAM even though I have plenty of RAM free. I'm guessing that it's because my python is only 32-bit? Appreciate any pointers on h

Re: Dealing with large memory under linux or How to Build 64bit Python

2009-01-22 Thread Martin v. Löwis
> I've got an Ubuntu (2.6.27-9-server SMP i686 GNU/Linux) setup with > 6GB RAM running python 2.5. I'm running a simulation program that is > breaking as soon as it hits ~3GB RAM even though I have plenty of RAM > free. I'm guessing that it's because my python is only 32-bit? If you do use a 32-b

Re: Does Python really follow its philosophy of "Readability counts"?

2009-01-22 Thread Scott David Daniels
Tim Rowe wrote: Btw, the correctness of a program (on a turing-complete language) cannot be statically proven. Ask Turing about it. For the most safety critical of programmes, for which static proof is required, restrictions are placed on the use of the language that effectively mean that it is

Re: Counter Class -- Bag/Multiset

2009-01-22 Thread Raymond Hettinger
> That should just be Python2.6. Fixed. Now runs of Python 2.5 as well. -- http://mail.python.org/mailman/listinfo/python-list

Re: USB in python

2009-01-22 Thread Brian Allen Vanderburg II
astan.c...@al.com.au wrote: Hi, Im trying to write a program for my USB device and I'm thinking of using python to do this. The USB device is of my own making and it is activated when one of the two data pins of the USB is given about 5V (or similar to whatever the power pin is getting). Now I

Re: Does Python really follow its philosophy of "Readability counts"?

2009-01-22 Thread Mark Wooding
Bruno Desthuilliers writes: > Paul Rubin a écrit : >> I'd say that Python's FP characteristics are an important part of its >> expressiveness. > > Indeed - but they do not make Python a functional language[1]. Python is > based on objects, not on functions, I'd have a good go at defining a func

Re: pep 8 constants

2009-01-22 Thread Brian Allen Vanderburg II
bock...@virgilio.it wrote: Constants would be a nice addition in python, sure enough. But I'm not sure that this can be done without a run-time check every time the constant is used, and python is already slow enough. Maybe a check that is disabled when running with optimizing flags ? But I'm su

Re: Executing previous stack frame

2009-01-22 Thread sturlamolden
On Jan 22, 8:47 pm, Jeff McNeil wrote: > What are you trying to accomplish? On Jan 22, 8:47 pm, Jeff McNeil wrote: > What are you trying to accomplish? While it's possible to do, I can't > believe it's going to be very safe. I am trying to implement a completely new concurrency abstraction

Re: Start Python at client side from web app

2009-01-22 Thread Rob Williscroft
Thomas Guettler wrote in news:6tr453fca5h...@mid.individual.net in comp.lang.python: > Diez B. Roggisch schrieb: >> >>> 2) create a localhost web server, for the client side manipulation. >>> Then have your remote webserver render a form that posts via >>> javavscript to the localhost webserver.

Re: Does Python really follow its philosophy of "Readability counts"?

2009-01-22 Thread Luis Zarrabeitia
On Thursday 22 January 2009 08:32:51 am Steven D'Aprano wrote: > And now I have accidentally broken the spam() method, due to a name clash. True, that's bad. I wish that were 'fixed'. > Besides, double-underscore names are a PITA to work with: Isn't that example the point of having self.__privat

Re: Mechanize hanging

2009-01-22 Thread Gabriel Genellina
En Wed, 21 Jan 2009 23:21:06 -0200, K-Dawg escribió: I am trying to use mechanize to connect and log into Yahoo! Here is my code: #c:\Python25\python import re import urllib import urllib2 import mechanize print "print1" br = mechanize.Browser() br.set_handle_robots(False) br.open("https://l

Re: Does Python really follow its philosophy of "Readability counts"?

2009-01-22 Thread Ricardo Aráoz
Paul Rubin wrote: > Mark Wooding writes: > >> Some people (let's call them `type A programmers') have decided that >> they want to be assisted with writing correct programs... >> Other people (`type B programmers') don't like having their (apparently? >> possibly?) correct programs rejected

Re: Start Python at client side from web app

2009-01-22 Thread Rob Williscroft
Diez B. Roggisch wrote in news:6ts0dnfc9s0...@mid.uni-berlin.de in comp.lang.python: > Rob Williscroft schrieb: >> Diez B. Roggisch wrote in news:6tpo16fbacf...@mid.uni-berlin.de in >> comp.lang.python: >> 2) create a localhost web server, for the client side manipulation. Then have y

Re: One Bug of Python 3.0

2009-01-22 Thread Gabriel Genellina
En Fri, 16 Jan 2009 01:56:23 -0200, escribiste en el grupo gmane.comp.python.general I met a bug of CGIXMLRPCRequestHandler in Python3.0. Because of the bug, couldn't use RPC in Apache CGI. You should file a bug report at http://bugs.python.org -- Gabriel Genellina -- http://mail.python.

unzip array of arrays?

2009-01-22 Thread Tobiah
Although it's trivial to program, I wondered whether there was a builtin or particularly concise way to express this idea: > a = [(1, 2), (3, 4), (5, 6)] > field[a, 2] [2, 4, 6] where field() is some made up function. Thanks, Toby -- http://mail.python.org/mailman/listinfo/python-list

Idea to support public/private.

2009-01-22 Thread Brian Allen Vanderburg II
Okay so I don't really care about public/private but I was watching the lists (Does python follow its idea of readability or something like that) and I thought of a 'possible' way to add this support to the language. I have implemented a class which allows creating both a private as well as a

Re: unzip array of arrays?

2009-01-22 Thread Chris Rebert
On Thu, Jan 22, 2009 at 2:04 PM, Tobiah wrote: > Although it's trivial to program, I wondered whether > there was a builtin or particularly concise way to > express this idea: > >> a = [(1, 2), (3, 4), (5, 6)] >> field[a, 2] > [2, 4, 6] > > where field() is some made up function. Python 2.6 (r26:

Re: unzip array of arrays?

2009-01-22 Thread Grant Edwards
On 2009-01-22, Tobiah wrote: > Although it's trivial to program, I wondered whether > there was a builtin or particularly concise way to > express this idea: > >> a = [(1, 2), (3, 4), (5, 6)] >> field[a, 2] > [2, 4, 6] > > where field() is some made up function. The above example is a great appli

Re: os.path.getmtime on windows, error: 206 - path or extension too long

2009-01-22 Thread Gabriel Genellina
En Wed, 21 Jan 2009 08:50:53 -0200, mynthon escribió: I have very long path on windows and i get error when try to get modification time. So i tried do chdir path and then get file. It now gives me error that file doesn't exists [...] it works for other files so i suppose it is not my fault.

Find all available Tkinter cursor names?

2009-01-22 Thread r
Anybody know how to find all the available Tkinter cursor icon names, or where the icons are stored? like "paintbrush" "pencil" etc... -- http://mail.python.org/mailman/listinfo/python-list

Re: Idea to support public/private.

2009-01-22 Thread Brian Allen Vanderburg II
There was a small error in setprivate/getprivate: import sys import inspect def get_private_codes(class_): codes = [] for i in class_.__dict__: value = class_.__dict__[i] if inspect.isfunction(value): codes.append(value.func_code) return codes def get_protect

Re: Start Python at client side from web app

2009-01-22 Thread Paul Rubin
"Diez B. Roggisch" writes: > Before posting, I tried a jQuery-ajax-call inside Firebug from some > random site to google. It bailed out with a security execption. You should be able to get around the security policy with XUL in Firefox, or with an ActiveX control in MSIE. In the Netscape Navigat

Re: unzip array of arrays?

2009-01-22 Thread Robert Kern
Unknown wrote: On 2009-01-22, Tobiah wrote: Although it's trivial to program, I wondered whether there was a builtin or particularly concise way to express this idea: a = [(1, 2), (3, 4), (5, 6)] field[a, 2] [2, 4, 6] where field() is some made up function. The above example is a great ap

Re: ossaudiodev problem: sawtooth noise

2009-01-22 Thread Gabriel Genellina
En Mon, 19 Jan 2009 21:57:04 -0200, Peter Pearson escribió: The following code uses ossaudiodev to read 1000 values from my sound card at a rate of 12,000 samples per second: When I select a sample rate that is not a power of 2 times 3000 samples/second, a strong and very regular sawtooth is

To: Julian Snitow

2009-01-22 Thread SabbySF
I got this from a website and have no idea if you will get this. Since you are in charge of Anime at Boskone 46, do you know when the schedule will be published on line.For the last two years the Anime schedule was not published on line and that meant I could not do research on anime that I wa

Re: Formal specification and proof (was : Does Python really follow its philosophy of "Readability counts"?)

2009-01-22 Thread James Mills
On Thu, Jan 22, 2009 at 8:42 PM, Ricardo Aráoz wrote: (...) > What I've seen engineers do when they need extra safety is to put in place > independently developed and operated redundant systems, at least three, and > the system will do whatever two of the independent systems agree on. So I > gues

Re: Find all available Tkinter cursor names?

2009-01-22 Thread Kevin Walzer
r wrote: Anybody know how to find all the available Tkinter cursor icon names, or where the icons are stored? like "paintbrush" "pencil" etc... http://www.tcl.tk/man/tcl8.4/TkCmd/cursors.htm -- Kevin Walzer Code by Kevin http://www.codebykevin.com -- http://mail.python.org/mailman/listinfo/py

Re: A different kind of interface

2009-01-22 Thread Marc 'BlackJack' Rintsch
On Thu, 22 Jan 2009 04:17:57 -0800, bearophileHUGS wrote: > Ben Finney: > >> Many of us solve this by using a single full-featured programmer's >> editor that allows invoking a program +IBQ- written in any of *dozens >> or hundreds* of different languages +IBQ- from within the editor. > > I don'

  1   2   >