Re: Script randomly exits for seemingly no reason with strange traceback

2012-02-03 Thread Chris Angelico
On Sat, Feb 4, 2012 at 7:14 AM, Andrew Berg wrote: > It's a rare occurrence, but sometimes my script will terminate and I get > this: > > Traceback (most recent call last): >  File "C:\path\to\script\script.py", line 992, in Do you call on potentially-buggy external modules? I'd be curious to se

Re: Script randomly exits for seemingly no reason with strange traceback

2012-02-03 Thread Steven D'Aprano
On Fri, 03 Feb 2012 19:15:30 -0500, inq1ltd wrote: > Check your code in that module for open parenthesis something like > below.. Most likely your code is looking for the closing parenthesis. > Start at the bottom and move up. > > pink = str(self.RecordKey[2] <--missing ")" If that were the

Re: Common LISP-style closures with Python

2012-02-03 Thread Chris Rebert
On Fri, Feb 3, 2012 at 4:27 PM, Antti J Ylikoski wrote: > > In Python textbooks that I have read, it is usually not mentioned that > we can very easily program Common LISP-style closures with Python.  It > is done as follows: > > - > > # Make a Common LISP-like

Re: Script randomly exits for seemingly no reason with strange traceback

2012-02-03 Thread inq1ltd
Check your code in that module for open parenthesis something like below.. Most likely your code is looking for the closing parenthesis. Start at the bottom and move up. pink = str(self.RecordKey[2] <--missing ")" jimonlinux > On Fri, 03 Feb 2012 14:14:57 -0600, Andrew Berg wrote: > >

Common LISP-style closures with Python

2012-02-03 Thread Antti J Ylikoski
In Python textbooks that I have read, it is usually not mentioned that we can very easily program Common LISP-style closures with Python. It is done as follows: - # Make a Common LISP-like closure with Python. # # Antti J Ylikoski 02-03-2012. def f1():

Re: Killing threads, and os.system()

2012-02-03 Thread Paul Rubin
John Nagle writes: > QNX's message passing looks more like a subroutine call than an > I/O operation, How do they enforce process isolation, or do they decide they don't need to? -- http://mail.python.org/mailman/listinfo/python-list

Re: Script randomly exits for seemingly no reason with strange traceback

2012-02-03 Thread Steven D'Aprano
On Fri, 03 Feb 2012 14:14:57 -0600, Andrew Berg wrote: > It's a rare occurrence, but sometimes my script will terminate and I get > this: > > Traceback (most recent call last): > File "C:\path\to\script\script.py", line 992, in > > That's it. And the line number is always the last line of the

Re: copy on write

2012-02-03 Thread 88888 Dihedral
在 2012年1月14日星期六UTC+8上午6时48分29秒,Evan Driscoll写道: > On 01/13/2012 03:20 PM, Neil Cerutti wrote: > > They perform the same action, but their semantics are different. > > operator+ will always return a new object, thanks to its > > signature, and operator+= shall never do so. That's the main > > differ

Re: [ANN] cdecimal-2.3 released

2012-02-03 Thread Stefan Krah
Paul Rubin wrote: > > Both cdecimal and libmpdec have an extremely conservative release policy. > > When new features are added, the complete test suite is run both with and > > without Valgrind on many different platforms. With the added tests against > > decNumber, this takes around 8 months on

Re: Help writelines

2012-02-03 Thread Anatoli Hristov
Thanks guys that was fast: I used for line in users: fob.write(line + "\n") fob.close() and that works Excuse me for the stupid questions, but since one week I read alot of python and I`m confused :p the only program language I knew in the time was Pascal, but i forgot all of it cheers

Re: Help writelines

2012-02-03 Thread Dave Angel
On 02/03/2012 03:27 PM, Anatoli Hristov wrote: Hi everyone, I`m totaly new in python and trying to figure out - how to write a list to a file with a newline at the end of each object. I tried alot of combinations :) like: users = ['toli','didi'] fob=open('c:/Python27/Toli/username','w') fob.writ

Re: Help writelines

2012-02-03 Thread Nick Dokos
Anatoli Hristov wrote: > Hi everyone, > > I`m totaly new in python and trying to figure out - how to write a list to a > file with a newline at the end of each object. > I tried alot of combinations :) like: > users = ['toli','didi'] > fob=open('c:/Python27/Toli/username','w') > fob.writelines(

Re: Help writelines

2012-02-03 Thread Markus Rother
Hi, You have to iterate. Either with for u in users: fob.write( u + '\n' ) or with a lambda function. always a good call: http://python.org/ greets, M. On 02/03/2012 09:27 PM, Anatoli Hristov wrote: Hi everyone, I`m totaly new in python and trying to figure out - how to write a list t

Help writelines

2012-02-03 Thread Anatoli Hristov
Hi everyone, I`m totaly new in python and trying to figure out - how to write a list to a file with a newline at the end of each object. I tried alot of combinations :) like: users = ['toli','didi'] fob=open('c:/Python27/Toli/username','w') fob.writelines(users) + '%s\N' fob.close() or fob.writel

Script randomly exits for seemingly no reason with strange traceback

2012-02-03 Thread Andrew Berg
It's a rare occurrence, but sometimes my script will terminate and I get this: Traceback (most recent call last): File "C:\path\to\script\script.py", line 992, in That's it. And the line number is always the last line of the file (which in my case is a blank line). I have not seen this on Linu

Re:

2012-02-03 Thread Aaron France
On 02/03/2012 09:14 PM, Chris Rebert wrote: On Fri, Feb 3, 2012 at 12:06 PM, Debashish Saha wrote: would u like to help me by answering some vbasic questions about python? You might prefer to ask such questions on the tutor mailing list instead: http://mail.python.org/mailman/listinfo/tutor C

Re:

2012-02-03 Thread Chris Rebert
On Fri, Feb 3, 2012 at 12:06 PM, Debashish Saha wrote: > would u like to help me by answering some vbasic questions about python? You might prefer to ask such questions on the tutor mailing list instead: http://mail.python.org/mailman/listinfo/tutor Cheers, Chris -- http://mail.python.org/mailm

[no subject]

2012-02-03 Thread Debashish Saha
would u like to help me by answering some vbasic questions about python? -- http://mail.python.org/mailman/listinfo/python-list

Linker errors when attempting to install PyCrypto

2012-02-03 Thread Alec Taylor
I'm getting linker errors when trying to install PyCrypto on Windows: C:\libraries\MinGW\bin\gcc.exe -mno-cygwin -shared -s build\temp.win-amd64-2.7\Release\src\winrand.o build\temp.win-amd64-2.7\Release\src\winrandom.def -LC:\Python27\libs -LC:\Python27\PCbuild\amd64 -lws2_32 -ladvapi32 -lpython2

Re: SnakeScript? (CoffeeScript for Python)

2012-02-03 Thread andrea crotti
2012/2/3 Dennis Lee Bieber : > On Thu, 2 Feb 2012 18:19:22 -0700, Ian Kelly >         > >        I spent nearly 20 years having to maintain the /output/ of such a > translator. > Yes I think that is the point, if the code you maintain and the code which you have to debug differ because there is a

Re: multiple constructor __init__

2012-02-03 Thread Emmanuel Mayssat
Yes, exactly like range http://coverage.livinglogic.de/Demo/classes/Range.py.html see handleargs function. Well that's short, but that's still too much code for what I want to do ;-) On Thu, Feb 2, 2012 at 7:43 PM, Terry Reedy wrote: > On 2/2/2012 8:09 PM, Emmanuel Mayssat wrote: > >> Hell

Re: copy on write

2012-02-03 Thread OKB (not okblacke)
Steven D'Aprano wrote: > Perhaps lists shouldn't define += at all, but then people will > complain that mylist += another_list is slow. Telling them to use > mylist.extend instead just makes them cranky. After all, mylist + > another_list works, so why shouldn't += work? It would work, it

Re: SnakeScript? (CoffeeScript for Python)

2012-02-03 Thread Nathan Rice
>> Mm I don't think it's what the OP is asking (unless I misunderstood...). >> I think he wants to compile some syntax TO Python. >> But I don't really see why you would something like this (if not for fun). > > Maybe because you think that Python syntax could be improved upon -- > for instance, Py

Re: SnakeScript? (CoffeeScript for Python)

2012-02-03 Thread Matej Cepl
On 3.2.2012 02:19, Ian Kelly wrote: Then how are you going to maintain the code? Maintain the compiled code or the source? As with all compiled software, you maintain the input, not the output. I don't think that's what was the question. CoffeeScript is a hopeless hack in the hopeless situat

Re: copy on write

2012-02-03 Thread John O'Hagan
On 03 Feb 2012 05:04:39 GMT Steven D'Aprano wrote: > On Fri, 03 Feb 2012 14:08:06 +1100, John O'Hagan wrote: > > > I think we're 12 years late on this one. It's PEP 203 from 2000 and > > the key phrase was: > > > > "The in-place function should always return a new reference, either > > to the o

Re: Killing threads, and os.system()

2012-02-03 Thread Steven D'Aprano
On Fri, 03 Feb 2012 00:14:33 -0800, John Nagle wrote: > I won't even get into the appalling mess around the Global Interpreter > Lock. You know full well that IronPython and Jython don't have a GIL. If the GIL was as harmful as you repeatedly tell us, why haven't you, and everyone else, migrate

Re: copy on write

2012-02-03 Thread Antoon Pardon
On 02/03/2012 06:04 AM, Steven D'Aprano wrote: Ultimately, there is no right answer, because the multitude of requirements are contradictory. No matter what Python did, somebody would complain. Which makes me wonder why it was introduced at all, or at least so fast If you see the difference in s

Re: Killing threads, and os.system()

2012-02-03 Thread John Nagle
On 1/31/2012 8:04 AM, Dennis Lee Bieber wrote: ({muse: who do we have to kill to persuade OS designers to incorporate something like the Amiga ARexx "rexxport" system}). QNX, which is a real-time microkernel which looks like POSIX to applications. actually got interprocess communication rig