Pydev 1.3.23 Released

2008-10-26 Thread Fabio Zadrozny
Hi All, Pydev and Pydev Extensions 1.3.23 have been released Details on Pydev Extensions: http://www.fabioz.com/pydev Details on Pydev: http://pydev.sf.net Details on its development: http://pydev.blogspot.com Release Highlights in Pydev Extensions:

Re: Ordering python sets

2008-10-26 Thread Marc 'BlackJack' Rintsch
On Sat, 25 Oct 2008 21:53:10 +, Lie Ryan wrote: Oh no, the two dict implementation would work _exactly_ the same from the outside, they are transparently interchangeable. Only the performance characteristic differs because of the different implementation. They are not 100%

Re: dictionary

2008-10-26 Thread Bob Martin
in 86949 20081024 205720 Hendrik van Rooyen [EMAIL PROTECTED] wrote: Steven D'Aprano ste...-this-cybersource.com.au wrote: On Fri, 24 Oct 2008 14:53:19 +, Peter Pearson wrote: On 24 Oct 2008 13:17:45 GMT, Steven D'Aprano wrote: What are programmers coming to these days? When I was their

Re: @property decorator doesn't raise exceptions

2008-10-26 Thread Duncan Booth
Rafe [EMAIL PROTECTED] wrote: Peter Oten pointed me in the right direction. I tried to reply to his post 2 times and in spite of GoogleGroups reporting the post was successful, it never showed up. This is the third variant on your message that has shown up in the newsgroup. Please be aware

Re: How can I handle the char immediately after its input, without waiting an endline?

2008-10-26 Thread Duncan Booth
Lie Ryan [EMAIL PROTECTED] wrote: And as far as I know, it is impossible to implement a press any key feature with python in a simple way (as it should be). press any key is a misfeature at the best of times. Quite apart from the people who can't find the key with 'any' written on it there

Re: 2.6, 3.0, and truly independent intepreters

2008-10-26 Thread Martin v. Löwis
As far as I can tell, it seems CPython's current state can't CPU bound parallelization in the same address space. That's not true. Um... So let's say you have a opaque object ref from the OS that represents hundreds of megs of data (e.g. memory-resident video). How do you get that back

Re:: 2.6, 3.0, and truly independent intepreters

2008-10-26 Thread Hendrik van Rooyen
Andy O'Meara Wrote: Um... So let's say you have a opaque object ref from the OS that represents hundreds of megs of data (e.g. memory-resident video). How do you get that back to the parent process without serialization and IPC? What should really happen is just use the same address space so

Re: Improving interpreter startup speed

2008-10-26 Thread James Mills
On Sun, Oct 26, 2008 at 11:23 AM, BJörn Lindqvist [EMAIL PROTECTED] wrote: How are you getting those numbers? 330 μs is still pretty fast, isn't it? :) Most disks have a seek time of 10-20 ms so it seem implausible to me that Ruby would be able to cold start in 47 ms. $ time python -c pass

Re: Why can't I assign a class method to a variable?

2008-10-26 Thread Lie Ryan
On Wed, 22 Oct 2008 12:34:26 -0400, ed wrote: I'm trying to make a shortcut by doing this: t = Globals.ThisClass.ThisMethod Calling t results in an unbound method error. Is it possible to do what I want? I call this method in hundreds of locations and I'm trying to cut down on the

Re: How can I handle the char immediately after its input, without waiting an endline?

2008-10-26 Thread Lie Ryan
On Sun, 26 Oct 2008 09:23:41 +, Duncan Booth wrote: Lie Ryan [EMAIL PROTECTED] wrote: And as far as I know, it is impossible to implement a press any key feature with python in a simple way (as it should be). press any key is a misfeature at the best of times. Quite apart from the

Re: Why can't I assign a class method to a variable?

2008-10-26 Thread James Mills
On Thu, Oct 23, 2008 at 2:34 AM, ed [EMAIL PROTECTED] wrote: I'm trying to make a shortcut by doing this: t = Globals.ThisClass.ThisMethod Calling t results in an unbound method error. Is it possible to do what I want? I call this method in hundreds of locations and I'm trying to cut down

Re: Ordering python sets

2008-10-26 Thread Lie Ryan
On Sun, 26 Oct 2008 00:53:18 +, Steven D'Aprano wrote: [...] And how do you find an arbitrary object's creation point without searching the project's source code? How is it better using the current way? Asking the .implementation field isn't much harder than asking the type (), and is much

using paramiko problem? please help me

2008-10-26 Thread sa6113
I want to connect to a Windows machine in my network , using ssh, I use paramiko but I have problem in authentication, would you please help me? 1- I have installed freeSSHD in server machine? Is it necessery ? or may I have to install another program? 2- I have entered server's Ip insted of

Re: Ordering python sets

2008-10-26 Thread Lie Ryan
On Sat, 25 Oct 2008 21:50:36 -0400, Terry Reedy wrote: Lie Ryan wrote: On Sat, 25 Oct 2008 18:20:46 -0400, Terry Reedy wrote: Then why do you object to current mylist = linkedlist(data) and request the harder to write and implement mylist = list(data, implementation =

Type feedback tool?

2008-10-26 Thread Martin Vilcans
Hi list, I'm wondering if there's a tool that can analyze a Python program while it runs, and generate a database with the types of arguments and return values for each function. In a way it is like a profiler, that instead of measuring how often functions are called and how long time it takes,

Re: tkinter question

2008-10-26 Thread Chuckk Hubbard
Hello. How about this? I changed the if statements so the coordinates are always updated, but only changed if within the right limits, otherwise updated to the existing value. Now if you drag outside the limits of one dimension, it still moves in the other dimension. Not sure if that's what you

Re: Global dictionary or class variables

2008-10-26 Thread Arnaud Delobelle
On Oct 24, 8:44 pm, Mr.SpOOn [EMAIL PROTECTED] wrote: Hi, in an application I have to use some variables with fixed valuse. For example, I'm working with musical notes, so I have a global dictionary like this: natural_notes = {'C': 0, 'D': 2, 'E': 4 } This actually works fine. I was

Re: Improving interpreter startup speed

2008-10-26 Thread Pedro Borges
The scripts i need to run but be executed with no apparent delay specially when the text transforms are simple. On Oct 26, 2008, at 11:13 AM, James Mills wrote: On Sun, Oct 26, 2008 at 11:23 AM, BJörn Lindqvist [EMAIL PROTECTED] wrote: How are you getting those numbers? 330 μs is still

Pydev 1.3.23 Released

2008-10-26 Thread Fabio Zadrozny
Hi All, Pydev and Pydev Extensions 1.3.23 have been released Details on Pydev Extensions: http://www.fabioz.com/pydev Details on Pydev: http://pydev.sf.net Details on its development: http://pydev.blogspot.com Release Highlights in Pydev Extensions:

Proxy authentication in common libraries

2008-10-26 Thread Sahasranaman
Hi I am behind a proxy server that needs proxy authentication. There are a lot of libraries that come without proxy support. The function below, which is part of the python-twitter library does HTTP Authentication, and I can't figure out how to do this with a ProxyBasicAuthHandler object. I'm

[Python 2.6] print_function and unicode_literals cannot be used at the same time?

2008-10-26 Thread 周济是母老鼠
Any ideas? Code 1: from __future__ import print_function, unicode_literals import sys print(type('HELLO, WORLD!'), file=sys.stderr) Result 1: type 'str' Code 2: from __future__ import unicode_literals, print_function import sys print(type('HELLO, WORLD!'), file=sys.stderr) Result 2: File

Re: Improving interpreter startup speed

2008-10-26 Thread Paul Rubin
Pedro Borges [EMAIL PROTECTED] writes: The scripts i need to run but be executed with no apparent delay specially when the text transforms are simple. Basically you should keep the interpreter running and the script in memory in that case. -- http://mail.python.org/mailman/listinfo/python-list

Re: [Python 2.6] print_function and unicode_literals cannot be used at the same time?

2008-10-26 Thread Christian Heimes
?? wrote: Any ideas? Code 1: from __future__ import print_function, unicode_literals import sys print(type('HELLO, WORLD!'), file=sys.stderr) You have to do each future import in a separate line: from __future__ import unicode_literals from __future__ import print_function

Re: SendKeys-0.3.win32-py2.1.exe

2008-10-26 Thread Thorsten Kampe
* Jesse (Sat, 25 Oct 2008 14:33:52 -0700 (PDT)) cant seem to install this, using python 2.6, any known errors that wont let me select the python installation to use, just opens a blank dialog and wont let me continue..do i need to downgrade python?? Well, you could. But honestly, this is more

Error when creating class

2008-10-26 Thread flaviostz
Hi, I wrote this small program: class Simples: def minha_func (valor1, valor2): return valor1 - valor2 mf = Simples() x = mf.minha_func(2, 3) print x But when I try execute it, python interpreter gives me this error: Traceback (most recent call last): File /tmp/py91849hI,

Re: Error when creating class

2008-10-26 Thread Walter Cruz
You forgot the self in minha_func. -- []' - Walter waltercruz.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Error when creating class

2008-10-26 Thread Diez B. Roggisch
flaviostz schrieb: Hi, I wrote this small program: class Simples: def minha_func (valor1, valor2): return valor1 - valor2 mf = Simples() x = mf.minha_func(2, 3) print x But when I try execute it, python interpreter gives me this error: Traceback (most recent call last):

Exact match with regular expression

2008-10-26 Thread Mr . SpOOn
Hi, I'd like to use regular expressions to parse a string and accept only valid strings. What I mean is the possibility to check if the whole string matches the regex. So if I have: p = re.compile('a*b*') I can match this: 'aabbb' m = p.match('aabbb') m.group() 'aabbb' But I'd

XML-RPC

2008-10-26 Thread asit
what is XML-RPC System -- http://mail.python.org/mailman/listinfo/python-list

Re: Exact match with regular expression

2008-10-26 Thread Rob Williscroft
Mr.SpOOn wrote in news:mailman.3069.1225039892.3487.python- [EMAIL PROTECTED] in comp.lang.python: Hi, I'd like to use regular expressions to parse a string and accept only valid strings. What I mean is the possibility to check if the whole string matches the regex. So if I have: p =

Re: Exact match with regular expression

2008-10-26 Thread Lie Ryan
On Sun, 26 Oct 2008 17:51:29 +0100, Mr.SpOOn wrote: Hi, I'd like to use regular expressions to parse a string and accept only valid strings. What I mean is the possibility to check if the whole string matches the regex. So if I have: p = re.compile('a*b*') I can match this:

Re: XML-RPC

2008-10-26 Thread Stefan Behnel
asit wrote: what is XML-RPC System Doesn't Wikipedia tell you that? Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Improving interpreter startup speed

2008-10-26 Thread BJörn Lindqvist
2008/10/26 James Mills [EMAIL PROTECTED]: On Sun, Oct 26, 2008 at 11:23 AM, BJörn Lindqvist [EMAIL PROTECTED] wrote: How are you getting those numbers? 330 μs is still pretty fast, isn't it? :) Most disks have a seek time of 10-20 ms so it seem implausible to me that Ruby would be able to cold

Iowa Python User's Group Meeting Next Week!

2008-10-26 Thread Mike Driscoll
Hi, The next Iowa Python Users Group (AKA Pyowa) is nearly upon us. We will be meeting November 3rd, from 7-9 p.m. at the following location: Marshall County Sheriff's Office 2369 Jessup Ave Marshalltown, IA 50158 At this meeting, we will be having a Crash Course of sorts for all the new

Re: Improving interpreter startup speed

2008-10-26 Thread Benjamin Kaplan
On Sun, Oct 26, 2008 at 1:45 PM, BJörn Lindqvist [EMAIL PROTECTED] wrote: 2008/10/26 James Mills [EMAIL PROTECTED]: On Sun, Oct 26, 2008 at 11:23 AM, BJörn Lindqvist [EMAIL PROTECTED] wrote: How are you getting those numbers? 330 μs is still pretty fast, isn't it? :) Most disks have a

Tix/TCL Problem (I Think)

2008-10-26 Thread Steve Phillips
Hi All, Wondering if you can tell me what I am missing. I am trying to move some projects over to the Linux side and Tix is giving me a fit. Here's what I get when I try to do something in Ubuntu relating to Tix. (Python 2.5) import Tix tk = Tix.Tk() Traceback (most recent call last): File

Immutable object thread-safety

2008-10-26 Thread k3xji
Hi all, This will probably be a long question/short answer, sorry, but I have wandered net about the subject and really feel cannot find just enough information.I want to ask my question by giving an example to explicitly express my understanding which may be also wrong: So, let's have a string

Module python-magic on/for Windows - UPDATE: WORKING HowTo!!!

2008-10-26 Thread Larry Hale
Thank you, again, Michael, for all your help many months ago. I *FINALLY* got a HowTo done up; please see http://wiki.python.org/moin/HowTo/FileMagic I've also emailed Mr. Hupp to see if he'll re-post the SWIG version; he's working on a newer binding (forget... ctypes??) and once that one's

Module python-magic on/for Windows - UPDATE: WORKING HowTo!!!

2008-10-26 Thread Larry Hale
Thank you, again, Michael, for all your help many months ago. I *FINALLY* got a HowTo done up; please see http://wiki.python.org/moin/HowTo/FileMagic I've also emailed Mr. Hupp to see if he'll re-post the SWIG version; he's working on a newer binding (forget... ctypes??) and once that one's

Web crawler on python

2008-10-26 Thread sonich
I need simple web crawler, I found Ruya, but it's seems not currently maintained. Does anybody know good web crawler on python or with python interface? -- http://mail.python.org/mailman/listinfo/python-list

Immutable object thread-safety

2008-10-26 Thread k3xji
Hi all, This will probably be a long question/short answer, sorry, but I have wandered net about the subject and really feel cannot find just enough information.I want to ask my question by giving an example to explicitly express my understanding which may be also wrong: So, let's have a string

Re: Web crawler on python

2008-10-26 Thread Mr . SpOOn
On Sun, Oct 26, 2008 at 9:54 PM, sonich [EMAIL PROTECTED] wrote: I need simple web crawler, I found Ruya, but it's seems not currently maintained. Does anybody know good web crawler on python or with python interface? What about BeautifulSoup? http://www.crummy.com/software/BeautifulSoup/ --

Re: Module python-magic on/for Windows - UPDATE: WORKING HowTo!!!

2008-10-26 Thread Carl K
Larry Hale wrote: Thank you, again, Michael, for all your help many months ago. I *FINALLY* got a HowTo done up; please see http://wiki.python.org/moin/HowTo/FileMagic I've also emailed Mr. Hupp to see if he'll re-post the SWIG version; he's working on a newer binding (forget...

Re: Question about scope

2008-10-26 Thread Bruno Desthuilliers
Lawrence D'Oliveiro a écrit : In message [EMAIL PROTECTED], Steven D'Aprano wrote: Why is it a class attribute instead of an instance attribute? Singleton class. Possibly, yes (and I believe it is the case, but...). Or the OP doesnt have a good enough understanding of Python's object

capturing ESC, page up/down in Python

2008-10-26 Thread jordilin
Is there any way to capture the keyboard events ESC, page up (next page), page down (previous page) in Python?. I mean, how can I capture if user presses one of those keys in a terminal based application? I was thinking about pygame.key.get_pressed from the pygame module, but I don't feel really

Re: Improving interpreter startup speed

2008-10-26 Thread Terry Reedy
Benjamin Kaplan wrote: I disagree. The extra time Python takes to start makes it unsuitable for many uses. For example, if you write a simple text editor then Pythons longer startup time might be to much. You must be in a real big hurry if half a second matters that much to you.

Re: Immutable object thread-safety

2008-10-26 Thread Laszlo Nagy
Also, the other question is the operation st = 'ThreadBWasHere' is atomic? I think this is the same question. And I believe it is not atomic, because it is actually rebinding a name. Consider this: a,b = b,a This will rebind both a and b. In order to be correct, it MUST happen in two

Re: Web crawler on python

2008-10-26 Thread James Mills
On Mon, Oct 27, 2008 at 6:54 AM, sonich [EMAIL PROTECTED] wrote: I need simple web crawler, I found Ruya, but it's seems not currently maintained. Does anybody know good web crawler on python or with python interface? Simple, but it works. Extend it all you like.

Re: Immutable object thread-safety

2008-10-26 Thread Laszlo Nagy
This will rebind both a and b. In order to be correct, it MUST happen in two phases: first calculate the right side, then do the rebind to the names on the left side. rebind to the names - rebind the names found on the left side, to the objects calculated from the expressions on the right

Re: Triple-quoted strings hath not the Python-nature

2008-10-26 Thread Lawrence D'Oliveiro
In message [EMAIL PROTECTED], Steven D'Aprano wrote: I disagree. Triple-quoted strings are exactly the same as other strings: they capture *exactly* what you put in them ... But that conflicts with the use of whitespace for indentation rules. Other languages are freeform, and have strings that

Re: Triple-quoted strings hath not the Python-nature

2008-10-26 Thread Lawrence D'Oliveiro
In message [EMAIL PROTECTED], Robert Lehmann wrote: I would feel greatly offended if I had to indent all *raw* data. You mean raw strings? -- http://mail.python.org/mailman/listinfo/python-list

Re: Interface to Matlab

2008-10-26 Thread Lawrence D'Oliveiro
In message [EMAIL PROTECTED], Daniel wrote: On Oct 17, 2:26 pm, Lawrence D'Oliveiro [EMAIL PROTECTED] central.gen.new_zealand wrote: In message [EMAIL PROTECTED], Daniel wrote: Also, I think that Matlab's perferred language is Java. It has its own built-in language (good for some

Re: Type feedback tool?

2008-10-26 Thread Scott David Daniels
Martin Vilcans wrote: Hi list, I'm wondering if there's a tool that can analyze a Python program while it runs, and generate a database with the types of arguments and return values for each function. In a way it is like a profiler, that instead of measuring how often functions are called and

Re: Porting VB apps to Python for Window / Linux use

2008-10-26 Thread Lawrence D'Oliveiro
In message [EMAIL PROTECTED], Stef Mientki wrote: ... although I realize closed source is not completely possibly in Python, but that's no problem if the program is large/complex enough compared to it's market value ;-) Software has no market value. Business models that try to assign it one

IDLE stopped working

2008-10-26 Thread brianrpsgt1
Using OS X 10.5.5 Python 2.5.1 IDLE was working, then all of a sudden, the window size went off of the screen could not resize it. I closed IDLE and rebooted and now IDLE will not start. Below is the Traceback Traceback (most recent call last): File

Re: Urllib vs. FireFox

2008-10-26 Thread Tim Roberts
Lie Ryan [EMAIL PROTECTED] wrote: Cookies? Yes, please. I'll take two. Chocolate chip. With milk. -- Tim Roberts, [EMAIL PROTECTED] Providenza Boekelheide, Inc. -- http://mail.python.org/mailman/listinfo/python-list

Re: Improving interpreter startup speed

2008-10-26 Thread James Mills
On Sun, Oct 26, 2008 at 11:19 PM, Pedro Borges [EMAIL PROTECTED] wrote: The scripts i need to run but be executed with no apparent delay specially when the text transforms are simple. That makes no sense whatsoever! If you are performing data conversion with Python, interpreter startup times

IDLE stopped working

2008-10-26 Thread brianrpsgt1
OSX 10.5.5 Python 2.5.1 I started up IDLE today and the bottom of the window was off of the screen. I could not find a way to resize it. I closed all apps and rebooted. After rebooting, IDLE will not start. Below is the Traceback: Traceback (most recent call last): File

Best Unit Testing framework for Linux system administration scripting?

2008-10-26 Thread Bryan Berry
I manage a team of 5 linux sysadmins and I am trying to transition us from lengthy, mostly unreadable shell scripts to python scripting. After a few tutorials, I have been infected with the unit testing bug. Our scripts create custom versions of Fedora Core, build and deploy web software, and

Re: capturing ESC, page up/down in Python

2008-10-26 Thread Tim Roberts
jordilin [EMAIL PROTECTED] wrote: Is there any way to capture the keyboard events ESC, page up (next page), page down (previous page) in Python?. I mean, how can I capture if user presses one of those keys in a terminal based application? I was thinking about pygame.key.get_pressed from the

String manipulation using RE

2008-10-26 Thread aditya shukla
Hello folks, i have a string eg (((A:1,B:1):3,C:3):4,((E:1,F:1):2,D:2):4) now i have to convert this string to (((A:1,B:1):2,C:3):1,((E:1,F:1):1,D:2):2) So i used the logic eg. taking the substring 1):3 and converting it to 1):2(3-1=2) so on for all the similar substrings.But i am not able to

Re: 2.6, 3.0, and truly independent intepreters

2008-10-26 Thread Andy O'Meara
Grrr... I posted a ton of lengthy replies to you and other recent posts here using Google and none of them made it, argh. Poof. There's nothing that fires more up more than lost work, so I'll have to revert short and simple answers for the time being. Argh, damn. On Oct 25, 1:26 am, greg

v4l module

2008-10-26 Thread Carl K
I am looking for a v4l (either version 1 or 2) module. I tried to use ctypes with ghostscript and failed. I have a feeling trying to use it with kernel modules would be even harder, so not exactly what I want to do. I just tried http://antonym.org/libfg and it segfaulted. (bugs reported) I

Re: Immutable object thread-safety

2008-10-26 Thread Alcari The Mad
k3xji wrote: Hi all, This will probably be a long question/short answer, sorry, but I have wandered net about the subject and really feel cannot find just enough information.I want to ask my question by giving an example to explicitly express my understanding which may be also wrong: So,

Re: Porting VB apps to Python for Window / Linux use

2008-10-26 Thread Ben Finney
Lawrence D'Oliveiro [EMAIL PROTECTED] writes: Software has no market value. Business models that try to assign it one are doomed to fight an uphill battle against market forces. +1 QOTW. -- \ “Yesterday I told a chicken to cross the road. It said, ‘What | `\

Re: 2.6, 3.0, and truly independent intepreters

2008-10-26 Thread Andy O'Meara
On Oct 24, 9:52 pm, Martin v. Löwis [EMAIL PROTECTED] wrote: A c-level module, on the other hand, can sidestep/release the GIL at will, and go on it's merry way and process away. ...Unless part of the C module execution involves the need do CPU- bound work on another thread through a

Re: Improving interpreter startup speed

2008-10-26 Thread James Mills
On Mon, Oct 27, 2008 at 4:12 AM, Benjamin Kaplan [EMAIL PROTECTED] wrote: You must be in a real big hurry if half a second matters that much to you. Maybe if it took 5 seconds for the interpreter to start up, I could understand having a problem with the start up time. +1 This thread is stupid

Re: Immutable object thread-safety

2008-10-26 Thread Alcari The Mad
Laszlo Nagy wrote: Also, the other question is the operation st = 'ThreadBWasHere' is atomic? I think this is the same question. And I believe it is not atomic, because it is actually rebinding a name. Consider this: a,b = b,a This will rebind both a and b. In order to be correct, it

Re: Improving interpreter startup speed

2008-10-26 Thread James Mills
On Mon, Oct 27, 2008 at 3:45 AM, BJörn Lindqvist [EMAIL PROTECTED] wrote: Pedro was talking about cold startup time: $ sudo sh -c echo 3 /proc/sys/vm/drop_caches $ time python -c pass real0m0.627s user0m0.016s sys 0m0.008s $ sudo sh -c echo 3 /proc/sys/vm/drop_caches $ time

Re: 2.6, 3.0, and truly independent intepreters

2008-10-26 Thread Andy O'Meara
And in the case of hundreds of megs of data ... and I would be surprised at someone that would embed hundreds of megs of data into an object such that it had to be serialized... seems like the proper design is to point at the data, or a subset of it, in a big buffer.  Then data transfers

Re: 2.6, 3.0, and truly independent intepreters

2008-10-26 Thread James Mills
On Mon, Oct 27, 2008 at 12:03 PM, Andy O'Meara [EMAIL PROTECTED] wrote: I think we miscommunicated there--I'm actually agreeing with you. I was trying to make the same point you were: that intricate and/or large structures are meant to be passed around by a top-level pointer, not using and

Re: set/dict comp in Py2.6

2008-10-26 Thread Benjamin
On Oct 25, 3:13 am, [EMAIL PROTECTED] wrote: I'd like to know why Python 2.6 doesn't have the syntax to create sets/ dicts of Python 3.0, like: Because nobody bothered to backport it. {x*x for x in xrange(10)} {x:x*x for x in xrange(10)} Bye, bearophile --

Re: set/dict comp in Py2.6

2008-10-26 Thread Benjamin
On Oct 25, 3:13 am, [EMAIL PROTECTED] wrote: I'd like to know why Python 2.6 doesn't have the syntax to create sets/ dicts of Python 3.0, like: Because nobody bothered to backport it. {x*x for x in xrange(10)} {x:x*x for x in xrange(10)} Bye, bearophile --

Re: Module python-magic on/for Windows - UPDATE: WORKING HowTo!!!

2008-10-26 Thread Michael Torrie
Carl K wrote: I need to convert pdf to png, which imagemagic convert does, I think by using ghostscript. a little over a year ago I tried with some imagemagic (there are at least 2 i think) and neither seemed close to working (for pdf that is.) any idea if pdf conversion is working?

Re: Module python-magic on/for Windows - UPDATE: WORKING HowTo!!!

2008-10-26 Thread Carl K
Michael Torrie wrote: Carl K wrote: I need to convert pdf to png, which imagemagic convert does, I think by using ghostscript. a little over a year ago I tried with some imagemagic (there are at least 2 i think) and neither seemed close to working (for pdf that is.) any idea if pdf

Re: Triple-quoted strings hath not the Python-nature

2008-10-26 Thread Mel
Lawrence D'Oliveiro wrote: In message [EMAIL PROTECTED], Steven D'Aprano wrote: I disagree. Triple-quoted strings are exactly the same as other strings: they capture *exactly* what you put in them ... But that conflicts with the use of whitespace for indentation rules. Other languages

Re: capturing ESC, page up/down in Python

2008-10-26 Thread Terry Reedy
jordilin [EMAIL PROTECTED] wrote: Is there any way to capture the keyboard events ESC, page up (next page), page down (previous page) in Python?. I mean, how can I capture if user presses one of those keys in a terminal based application? I was thinking about pygame.key.get_pressed from the

Re: Improving interpreter startup speed

2008-10-26 Thread David Cournapeau
On Mon, Oct 27, 2008 at 10:52 AM, James Mills [EMAIL PROTECTED] wrote: On Mon, Oct 27, 2008 at 4:12 AM, Benjamin Kaplan +1 This thread is stupid and pointless. Even for a so-called cold startup 0.5s is fast enough! Not if the startup is the main cost for a command you need to repeat many

Re: Improving interpreter startup speed

2008-10-26 Thread James Mills
On Mon, Oct 27, 2008 at 3:15 PM, David Cournapeau [EMAIL PROTECTED] wrote: Not if the startup is the main cost for a command you need to repeat many times. Seriously if you have to spawn and kill python processes that many times for an initial cold startup and subsequent warm startups to be

Re: Improving interpreter startup speed

2008-10-26 Thread Terry Reedy
David Cournapeau wrote: On Mon, Oct 27, 2008 at 10:52 AM, James Mills [EMAIL PROTECTED] wrote: On Mon, Oct 27, 2008 at 4:12 AM, Benjamin Kaplan +1 This thread is stupid and pointless. Even for a so-called cold startup 0.5s is fast enough! Not if the startup is the main cost for a command you

[issue4207] Remove backwards compatibility in _heapq for performance

2008-10-26 Thread Kristján Valur Jónsson
New submission from Kristján Valur Jónsson [EMAIL PROTECTED]: Comparing _heapq with our own legacy C implementation, blue.heapq at CCP, I noticed that ours was somewhat faster. I discovered that a lot of effort is being spent to dynamically search for a __lt__ operator, to provide backwards

[issue4207] Remove backwards compatibility in _heapq for performance

2008-10-26 Thread Raymond Hettinger
Raymond Hettinger [EMAIL PROTECTED] added the comment: The compatability code was just added in Py2.6 and is needed for apps like Twisted that currently rely on __le__ being tested. In 3.0, the compatability code is removed and full speed is restored. Also, the timing suite exaggerates the

[issue4207] Remove backwards compatibility in _heapq for performance

2008-10-26 Thread Kristján Valur Jónsson
Kristján Valur Jónsson [EMAIL PROTECTED] added the comment: I am sorry for not doing my research about the age of the compatibility fix. However, modifying the test slightly to work with tuples of (random.random(), random.random()) shows a performance increase from: heapify 0.366187741738

[issue4204] Cannot build _multiprocessing, math, mmap and readline of Python 2.6 on FreeBSD 4.11 w/ gcc 2.95.4

2008-10-26 Thread Akira Kitada
Akira Kitada [EMAIL PROTECTED] added the comment: Attached patch fixes build problem of math and mmap. Apparently, FreeBSD 4 does not make some math functions available when _XOPEN_SOURCE is defined and unlike newer FreeBSD, it cannot be fixed with __BSD_VISIBLE macro. As for readline, it just

[issue4204] Cannot build _multiprocessing, math, mmap and readline of Python 2.6 on FreeBSD 4.11 w/ gcc 2.95.4

2008-10-26 Thread Christian Heimes
Christian Heimes [EMAIL PROTECTED] added the comment: The setup.py file in the root directory doesn't have a special case for freebsd4, just for Free BSD 5 to 8. Apparently FreeBSD doesn't support SEM_TIMEDWAIT at all. elif platform in ('freebsd5', 'freebsd6', 'freebsd7', 'freebsd8'):

[issue4204] Cannot build _multiprocessing, math, mmap and readline of Python 2.6 on FreeBSD 4.11 w/ gcc 2.95.4

2008-10-26 Thread Akira Kitada
Akira Kitada [EMAIL PROTECTED] added the comment: Thanks Christian, Now all modules are working. $ ./python Python 2.6 (r26:66714, Oct 14 2008, 15:18:41) [GCC 2.95.4 20020320 [FreeBSD]] on freebsd4 Type help, copyright, credits or license for more information. import multiprocessing import

[issue4204] Cannot build _multiprocessing, math, mmap and readline of Python 2.6 on FreeBSD 4.11 w/ gcc 2.95.4

2008-10-26 Thread Christian Heimes
Christian Heimes [EMAIL PROTECTED] added the comment: No, you still have to create a patch for the readline module. ;) ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue4204 ___

[issue4208] Make multiprocessing compatible with Python 2.4 and 2.5

2008-10-26 Thread Christian Heimes
New submission from Christian Heimes [EMAIL PROTECTED]: The patch contains all differences between our multiprocessing backport to 2.4 / 2.5 and the release26-maint branch. The patch should NOT be applied yet. I've created the patch to discuss the differences. Several changes could be avoided

[issue4200] atexit module not safe in Python 3.0 with multiple interpreters

2008-10-26 Thread Christian Heimes
Christian Heimes [EMAIL PROTECTED] added the comment: I'm adding Martin to the nosy list as well. He is the author of PEP 3121 and he might be able to give more insight in the problem. -- nosy: +loewis ___ Python tracker [EMAIL PROTECTED]

[issue4204] Cannot build _multiprocessing, math, mmap and readline of Python 2.6 on FreeBSD 4.11 w/ gcc 2.95.4

2008-10-26 Thread Akira Kitada
Akira Kitada [EMAIL PROTECTED] added the comment: Here's the one. I tested this patch on FreeBSD 4.11 and 6.3. Both worked. :) Added file: http://bugs.python.org/file11892/Modules_readline.c.diff ___ Python tracker [EMAIL PROTECTED]

[issue4208] Make multiprocessing compatible with Python 2.4 and 2.5

2008-10-26 Thread Jesse Noller
Jesse Noller [EMAIL PROTECTED] added the comment: Are you suggesting we apply this to the 2.6/2.7 branch? ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue4208 ___

[issue4208] Make multiprocessing compatible with Python 2.4 and 2.5

2008-10-26 Thread Christian Heimes
Christian Heimes [EMAIL PROTECTED] added the comment: Yes, I like to get as much code into 2.6/2.7 as feasible and viable. ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue4208 ___

[issue4209] from __future__ import unicode_literals, print_function doesn't work

2008-10-26 Thread Benjamin Peterson
New submission from Benjamin Peterson [EMAIL PROTECTED]: This is because parser.c's future_hack breaks out of the loop when it finds one feature. Patch with test is attached. -- components: Interpreter Core files: fix_multiple_features.patch keywords: patch messages: 75237 nosy:

[issue4210] os.remove can be used to remove directories on SunOS

2008-10-26 Thread Giampaolo Rodola'
New submission from Giampaolo Rodola' [EMAIL PROTECTED]: Done against a SunOS 5.10 equipped with Python 2.4.4. import os os.mkdir('foo') os.remove('foo') -- messages: 75238 nosy: giampaolo.rodola severity: normal status: open title: os.remove can be used to remove directories on

[issue4200] atexit module not safe in Python 3.0 with multiple interpreters

2008-10-26 Thread Martin v. Löwis
Martin v. Löwis [EMAIL PROTECTED] added the comment: It would certainly be possible to produce per-interpreter callback lists through the module state. You declare a per-interpreter structure, add its size into atexitmodule, and refer to it through PyModule_GetDef, passing the self argument of

[issue4210] os.remove can be used to remove directories on SunOS

2008-10-26 Thread Martin v. Löwis
Martin v. Löwis [EMAIL PROTECTED] added the comment: I cannot reproduce the behavior that your trace suggests; instead, I get os.remove(foo) Traceback (most recent call last): File stdin, line 1, in ? OSError: [Errno 1] Not owner: 'foo' Perhaps you were trying to do this as root? This is a

[issue4209] from __future__ import unicode_literals, print_function doesn't work

2008-10-26 Thread Benjamin Peterson
Changes by Benjamin Peterson [EMAIL PROTECTED]: -- nosy: +christian.heimes ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue4209 ___ ___ Python-bugs-list

[issue4200] atexit module not safe in Python 3.0 with multiple interpreters

2008-10-26 Thread Christian Heimes
Christian Heimes [EMAIL PROTECTED] added the comment: I'm trying to come up with a patch. It's a little bit trickier than I thought. The atexit module registers atexit_callfuncs() with _Py_PyAtExit(). The atexit_callfuncs() function is called by Python/pythonrun.c when the interpreter exits. The

[issue4210] os.remove can be used to remove directories on SunOS

2008-10-26 Thread Giampaolo Rodola'
Giampaolo Rodola' [EMAIL PROTECTED] added the comment: I didn't know about such unlink behavior and yes, I was root. Thanks for the precious infos. ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue4210 ___

[issue4200] atexit module not safe in Python 3.0 with multiple interpreters

2008-10-26 Thread Martin v. Löwis
Martin v. Löwis [EMAIL PROTECTED] added the comment: Christian Heimes wrote: However PyModule_GetDef requires self. (I actually meant PyModule_GetState). You can use PyState_FindModule to quickly lookup a module. ___ Python tracker [EMAIL PROTECTED]

  1   2   >