Cython 0.11.3 released.

2009-09-27 Thread Robert Bradshaw
We are happy to announce the release of Cython 0.11.3 (http:// cython.org), which is the accumulation of numerous bugfixes and other work since the beginning of the summer. Some new features include a cython freeze utility that allows one to compile several modules into a single executable (Mark

[ANNOUNCE] PyPoppler 0.12.1

2009-09-27 Thread Gian Mario Tagliaretti
I am pleased to announce version 0.12.1 of the Python bindings for Poppler. This is a quick follow up to add a couple of new objects that were missing from the defs, h2defs didn't pick them up automatically. It is available at:

Re: Plugins for a Python program

2009-09-27 Thread John Nagle
OldAl wrote: I am impressed with Bazaar's implementation of plugins: a Python plugin is simply copied to a ./bazaar/plugin/my-plugin directory and the plugin is recognized by Bazaar and can be run from CLI as: bzr my-plugin I would like to implement something similar in my Finite Element

Re: unexplainable python

2009-09-27 Thread John Nagle
dads wrote: Sorry forgot to mention I'm using python 2.6 This looks like a homework assignment. John Nagle -- http://mail.python.org/mailman/listinfo/python-list

Re: When is divmod(a,b)[0] == floor(a/b)-1 ?

2009-09-27 Thread Martin v. Löwis
In [21]: a = 10.0 In [22]: b = 10.0 / 3.0 In [24]: divmod(a, b)[0] Out[24]: 2.0 In [25]: math.floor(a / b) - 1.0 Out[25]: 2.0 Wow. To me this stuff is just black magic, with a bit of voodoo added for good measure... Maybe some day I'll understand it. I think this example is not

Business issues regarding adapting Python

2009-09-27 Thread Nash
Hello everyone, I'm a big time python fan and it has helped me write code fast and push it out quickly. We have a medium sized telecom product written 90% in Python and 10% in Java. The problem is, in the place where we work (Pakistan), we can't find Python developers. I asked HR to send me

Re: unexplainable python

2009-09-27 Thread Matt Joiner
Yes the needless use of classes further supports that theory. On Sun, Sep 27, 2009 at 4:31 PM, John Nagle na...@animats.com wrote: dads wrote: Sorry forgot to mention I'm using python 2.6   This looks like a homework assignment.                                John Nagle --

Re: Business issues regarding adapting Python

2009-09-27 Thread Roger Binns
Nash wrote: 3. If we do train people in Python for say a month; are we just creating a team of mediocre programmers? Someone who has worked with Python for over an year is much different than someone who has worked with Python for only a month. In my experience the best way to train new

Re: Business issues regarding adapting Python

2009-09-27 Thread Gregor Horvath
Hi, Am Sun, 27 Sep 2009 00:13:47 -0700 (PDT) schrieb Nash nasrul...@gmail.com: I'm a big time python fan and it has helped me write code fast and push it out quickly. We have a medium sized telecom product written 90% in Python and 10% in Java. The problem is, in the place where we work

Re: Got undefined symbol: _PyUnicodeUCS2_AsDefaultEncodedString on OpenSuSE 11.1

2009-09-27 Thread Mark Dickinson
On Sep 25, 10:13 pm, Alejandro Valdez alejandro.val...@gmail.com wrote: The compiler issued some warnings, two of them (related to Unicode) called my attention: In file included from Python/formatter_unicode.c:13: Python/../Objects/stringlib/formatter.h: In function

Re: Business issues regarding adapting Python

2009-09-27 Thread Krishnakant
On Sun, 2009-09-27 at 00:13 -0700, Nash wrote: Hello everyone, Salam Valicum. I am Krishnakant from Mumbai India and in our country case was exactly the same but now pritty different in just a matter of few years. I have answered your queries inline with your questions so read on. I'm a big

Unable to create scrollable editor window using curses

2009-09-27 Thread Andy Elvey
Hi all - I've been trying to create a simple text editor using the curses module. Doing the basic editor functionality is easy enough (thanks to the built-in textpad library), but I'm having real problems getting the text to scroll up when the bottom of the page is reached. When the user is

Detecting changes to a dict

2009-09-27 Thread Steven D'Aprano
I'm pretty sure the answer to this is No, but I thought I'd ask just in case... Is there a fast way to see that a dict has been modified? I don't care what the modifications are, I just want to know if it has been changed, where changed means a key has been added, or deleted, or a value has

Re: removing a post

2009-09-27 Thread Sjoerd Mullender
You need to put this request to postmas...@python.org. As mailing list administrator I have no access to the archives. On 2009-09-26 05:32, Mike L wrote: hello could you remove this old post, off topic and spam http://www.mail-archive.com/python-list@python.org/msg175722.html thank you

Re: Most active coroutine library project?

2009-09-27 Thread Piet van Oostrum
Grant Edwards inva...@invalid.invalid (GE) wrote: GE On 2009-09-25, Piet van Oostrum p...@cs.uu.nl wrote: exar...@twistedmatrix.com (e) wrote: e I specifically left out all yield statements in my version, since that's e exactly the point here. :) With real coroutines, they're not necessary -

unicode text file

2009-09-27 Thread Junaid
I want to do replacements in a utf-8 text file. example f=open(test.txt,r) #this file is uft-8 encoded raw = f.read() txt = raw.decode(utf-8) txt.replace{'English', ur'ഇംഗ്ലീഷ്') #replacing raw unicode string, but not working f.write(txt) f.close() f.flush() please, help me thanks --

Re: unexplainable python

2009-09-27 Thread dads
Thank you for the help, it's amazing what you can't spot. It seems the harder you look the less likely you're to find the issue. Fresh eyes make the world of difference. To Matt and John: No this certainly isn't homework, I'm 29 and in full time work. I decided to learn to program about a year

Re: unicode text file

2009-09-27 Thread Vlastimil Brom
2009/9/27 Junaid junu...@gmail.com: I want to do replacements in a utf-8 text file. example f=open(test.txt,r) #this file is uft-8 encoded raw = f.read() txt = raw.decode(utf-8) txt.replace{'English', ur'ഇംഗ്ലീഷ്') #replacing raw unicode string, but not working f.write(txt) f.close()

Re: Doubley imported module caused devastating bug

2009-09-27 Thread Francis Carr
I would like to propose that it be made impossible in the Python source to import two instances of the same module. A fully-automatic solution is more difficult than it might seem at first: http://www.python.org/dev/peps/pep-0328/ But there is a simple code-discipline solution: never ever use

pep370 python 2.6?

2009-09-27 Thread Neal Becker
Is pep370 (per-user site-packages) available on 2.6? -- http://mail.python.org/mailman/listinfo/python-list

user authorization (with one time login) in a Python desktop application ?

2009-09-27 Thread Stef Mientki
hello, I've a Python desktop application, running under Widows, that stores the data in a central SQLite database. Depending on the user login on the system, some of the data from the database is allowed and other data is forbidden. I can read the current logged in user. The authorization

Re: unicode text file

2009-09-27 Thread MRAB
Junaid wrote: I want to do replacements in a utf-8 text file. example f=open(test.txt,r) #this file is uft-8 encoded raw = f.read() txt = raw.decode(utf-8) txt.replace{'English', ur'ഇംഗ്ലീഷ്') #replacing raw unicode string, but not working txt = txt.replace{'English', ur'ഇംഗ്ലീഷ്')

Re: unicode text file

2009-09-27 Thread Mark Tolonen
Junaid junu...@gmail.com wrote in message news:0267bef9-9548-4c43-bcdf-b624350c8...@p23g2000vbl.googlegroups.com... I want to do replacements in a utf-8 text file. example f=open(test.txt,r) #this file is uft-8 encoded raw = f.read() txt = raw.decode(utf-8) You can use the codecs module to

Re: Business issues regarding adapting Python

2009-09-27 Thread Nash
On Sep 27, 4:13 pm, Martin P. Hellwig martin.hell...@dcuktec.org wrote: Nash wrote: cut can't get enough Python Developers I think normal market rules will apply to Pakistan too, if your desired trade has not the quantity you wish, the price per item should get higher. Net result should be

Re: Business issues regarding adapting Python

2009-09-27 Thread Simon Forman
On Sun, Sep 27, 2009 at 10:48 AM, Nash nasrul...@gmail.com wrote: On Sep 27, 4:13 pm, Martin P. Hellwig martin.hell...@dcuktec.org wrote: Nash wrote: cut can't get enough Python Developers I think normal market rules will apply to Pakistan too, if your desired trade has not the quantity you

Re: Business issues regarding adapting Python

2009-09-27 Thread Krishnakant
On Sun, 2009-09-27 at 10:57 -0400, Simon Forman wrote: On Sun, Sep 27, 2009 at 10:48 AM, Nash nasrul...@gmail.com wrote: On Sep 27, 4:13 pm, Martin P. Hellwig martin.hell...@dcuktec.org wrote: Nash wrote: cut can't get enough Python Developers I think normal market rules will apply to

Re: Business issues regarding adapting Python

2009-09-27 Thread Duncan Booth
Nash nasrul...@gmail.com wrote: If I rephrase the question: In an absense of steady Python Developers; can there be a viable strategy involving training? Or will it be much safer going with an already common developer pool. My experience has been that: a) Python developers come from the

Re: unexplainable python

2009-09-27 Thread D'Arcy J.M. Cain
On Sat, 26 Sep 2009 23:31:25 -0700 John Nagle na...@animats.com wrote: dads wrote: Sorry forgot to mention I'm using python 2.6 This looks like a homework assignment. So what? He supplied code and showed what he tried so far didn't he? I suppose he could have said that it was homework

Re: Detecting changes to a dict

2009-09-27 Thread Simon Forman
On Sun, Sep 27, 2009 at 5:36 AM, Steven D'Aprano st...@remove-this-cybersource.com.au wrote: I'm pretty sure the answer to this is No, but I thought I'd ask just in case... Is there a fast way to see that a dict has been modified? I don't care what the modifications are, I just want to know

Re: user authorization (with one time login) in a Python desktop application ?

2009-09-27 Thread Steven D'Aprano
On Sun, 27 Sep 2009 16:11:52 +0200, Stef Mientki wrote: hello, I've a Python desktop application, running under Widows, that stores the data in a central SQLite database. Depending on the user login on the system, some of the data from the database is allowed and other data is forbidden.

Re: What does the list_folders() method of mailbox.Maildir actually ?do (if anything)?

2009-09-27 Thread tinnews
Tim Roberts t...@probo.com wrote: tinn...@isbd.co.uk wrote: My maildir hierarchy is created by mutt which is a *very* standards compliant MUA, surely standard python libraries should work with standard maildirs not some wierd extension thereof. The Maildir specification does not allow for

Re: Detecting changes to a dict

2009-09-27 Thread geremy condra
On Sun, Sep 27, 2009 at 5:36 AM, Steven D'Aprano st...@remove-this-cybersource.com.au wrote: I'm pretty sure the answer to this is No, but I thought I'd ask just in case... Is there a fast way to see that a dict has been modified? I don't care what the modifications are, I just want to know

Re: user authorization (with one time login) in a Python desktop application ?

2009-09-27 Thread geremy condra
On Sun, Sep 27, 2009 at 11:42 AM, Steven D'Aprano st...@remove-this-cybersource.com.au wrote: On Sun, 27 Sep 2009 16:11:52 +0200, Stef Mientki wrote: hello, I've a Python desktop application, running under Widows, that stores the data in a central SQLite database. Depending on the

Re: pep370 python 2.6?

2009-09-27 Thread Christian Heimes
Neal Becker wrote: Is pep370 (per-user site-packages) available on 2.6? Yes -- http://mail.python.org/mailman/listinfo/python-list

Re: Business issues regarding adapting Python

2009-09-27 Thread Martin P. Hellwig
Nash wrote: cut my own short tempered answer :-) If I rephrase the question: In an absense of steady Python Developers; can there be a viable strategy involving training? Or will it be much safer going with an already common developer pool. Please note that my goal is not to promote python but

Re: user authorization (with one time login) in a Python desktop application ?

2009-09-27 Thread Tim Golden
Steven D'Aprano wrote: On Sun, 27 Sep 2009 16:11:52 +0200, Stef Mientki wrote: I've a Python desktop application, running under Widows, that stores the data in a central SQLite database. Depending on the user login on the system, some of the data from the database is allowed and other data is

Re: Is there a method (similar to str() method in R) that can print the data structure in python?

2009-09-27 Thread Peng Yu
On Sat, Sep 26, 2009 at 2:05 PM, Robert Kern robert.k...@gmail.com wrote: On 2009-09-26 09:32 AM, Peng Yu wrote: Hi, I am looking for a method in python that is similar to the function str() in R, if you are familiar with R, If you have no idea of R, what I want is to print the class

Re: user authorization (with one time login) in a Python desktop application ?

2009-09-27 Thread Tim Golden
Tim Golden wrote: Steven D'Aprano wrote: [... snip further stuff from Stephen whose name I can't even copy from three lines above :) Sorry, Steven. TJG -- http://mail.python.org/mailman/listinfo/python-list

Re: user authorization (with one time login) in a Python desktop application ?

2009-09-27 Thread Martin P. Hellwig
Stef Mientki wrote: cut explanation What you want is pretty hard as long as the data source is not centrally protected with a password. That is you have a database on a server you only access, there is a central db but access to it is restricted to the admin, everybody else has a unique login

ANN: PyQt v4.6 Released

2009-09-27 Thread Phil Thompson
PyQt v4.6 has been released and is available from http://www.riverbankcomputing.com/software/pyqt/. PyQt is a comprehensive set of bindings for the Qt application and UI framework from Nokia. It supports the same platforms as Qt (Windows, Linux and MacOS/X). PyQt supports Python v3 and Python

ANN: SIP v4.9 Released (Python Bindings Generator)

2009-09-27 Thread Phil Thompson
SIP v4.9 has been released and can be downloaded from http://www.riverbankcomputing.com/software/sip/. SIP is a tool for generating Python modules that wrap C or C++ libraries. It is similar to SWIG. It is used to generate PyQt and PyKDE. The SIP license is similar to the Python License and is

Re: Is there a method (similar to str() method in R) that can print the data structure in python?

2009-09-27 Thread Simon Forman
On Sun, Sep 27, 2009 at 12:14 PM, Peng Yu pengyu...@gmail.com wrote: On Sat, Sep 26, 2009 at 2:05 PM, Robert Kern robert.k...@gmail.com wrote: On 2009-09-26 09:32 AM, Peng Yu wrote: Hi, I am looking for a method in python that is similar to the function str() in R, if you are familiar with

Re: unexplainable python

2009-09-27 Thread Terry Reedy
dads wrote: Thank you for the help, it's amazing what you can't spot. It seems the harder you look the less likely you're to find the issue. Fresh eyes make the world of difference. To Matt and John: No this certainly isn't homework, I'm 29 and in full time work. I decided to learn to program

Re: user authorization (with one time login) in a Python desktop application ?

2009-09-27 Thread Stef Mientki
Tim Golden wrote: Steven D'Aprano wrote: On Sun, 27 Sep 2009 16:11:52 +0200, Stef Mientki wrote: I've a Python desktop application, running under Widows, that stores the data in a central SQLite database. Depending on the user login on the system, some of the data from the database is

Multidimensional arrays/lists

2009-09-27 Thread Someone Something
I'm trying to write a little tic-tac-toe program I need a array/list such that I can represent the tic tac toe board with an x axis and y axis and i can access each square to find out whether there is an X or an O. I have absolutely no idea how to do this in python and I really, really, don't want

Re: Multidimensional arrays/lists

2009-09-27 Thread Gary Herron
Someone Something wrote: I'm trying to write a little tic-tac-toe program I need a array/list such that I can represent the tic tac toe board with an x axis and y axis and i can access each square to find out whether there is an X or an O. I have absolutely no idea how to do this in python and

Re: Multidimensional arrays/lists

2009-09-27 Thread Rhodri James
On Sun, 27 Sep 2009 17:40:57 +0100, Someone Something fordhai...@gmail.com wrote: I'm trying to write a little tic-tac-toe program I need a array/list such that I can represent the tic tac toe board with an x axis and y axis and i can access each square to find out whether there is an X or

Catch script hangs

2009-09-27 Thread Bakes
Due to an ftp server issue, my python script sometimes hangs whilst downloading, unable to receive any more data. Is there any way that I could have python check, maybe through a thread or something, whether it has hanged (or just, if it's still active after 10 seconds, stop it?). I have looked at

Re: Catch script hangs

2009-09-27 Thread exarkun
On 10:40 pm, ba...@ymail.com wrote: Due to an ftp server issue, my python script sometimes hangs whilst downloading, unable to receive any more data. Is there any way that I could have python check, maybe through a thread or something, whether it has hanged (or just, if it's still active after

Re: itools 0.60.2 released

2009-09-27 Thread David Calman
you mean MobileMe? go back to comp.sys.mac.misc -- From: J. David Ibáñez jda...@itaapy.com Sent: Wednesday, June 03, 2009 1:49 AM Newsgroups: comp.lang.python.announce To: python-annou...@python.org Subject: itools 0.60.2 released itools 0.60.2

Re: Is there a method (similar to str() method in R) that can print the data structure in python?

2009-09-27 Thread Peng Yu
On Sun, Sep 27, 2009 at 1:20 PM, Simon Forman sajmik...@gmail.com wrote: On Sun, Sep 27, 2009 at 12:14 PM, Peng Yu pengyu...@gmail.com wrote: On Sat, Sep 26, 2009 at 2:05 PM, Robert Kern robert.k...@gmail.com wrote: On 2009-09-26 09:32 AM, Peng Yu wrote: Hi, I am looking for a method in

Re: Is there a method (similar to str() method in R) that can print the data structure in python?

2009-09-27 Thread Zero Piraeus
: 2009/9/27 Peng Yu pengyu...@gmail.com: But I want an even simpler solution. I don't want the user to define __pretty__. Is there a tool that can automatically print the content of an object without defining such a member function like __pretty__. Not tested (much): from pprint import

Re: How to run python script in emacs

2009-09-27 Thread devilkin
On 9月27日, 下午12时43分, Nobody nob...@nowhere.com wrote: On Sat, 26 Sep 2009 08:54:49 -0700, devilkin wrote: I'm just starting learning python, and coding in emacs. I usually split emacs window into two, coding in one, and run script in the other, which is not very convenient. anyone can help

Re: Catch script hangs

2009-09-27 Thread Sean DiZazzo
On Sep 27, 3:40 pm, Bakes ba...@ymail.com wrote: Due to an ftp server issue, my python script sometimes hangs whilst downloading, unable to receive any more data. Is there any way that I could have python check, maybe through a thread or something, whether it has hanged (or just, if it's still

Re: Is there a method (similar to str() method in R) that can print the data structure in python?

2009-09-27 Thread John Nagle
Zero Piraeus wrote: : 2009/9/27 Peng Yu pengyu...@gmail.com: But I want an even simpler solution. I don't want the user to define __pretty__. Is there a tool that can automatically print the content of an object without defining such a member function like __pretty__. Not tested (much):

Re: is this whiff/wsgi claim true?

2009-09-27 Thread Дамјан Георгиевски
Hi folks. I just modified the WHIFF concepts index page http://aaron.oirt.rutgers.edu/myapp/docs/W1000.concepts To include the following paragraph with a startling and arrogant claim in the final sentence :) mod_wsgi (the apache module) can be configured to automatically run any

Bash shell to Python shell?

2009-09-27 Thread edwithad
I am sure you have not read a question this basic in some time, but I am curious. Using Linux I open a terminal window and type: python. Does Bash Shell go away and to become a Python Shell, or is it still a Bash Shell with Python running inside? Thanks in advance. --

Python shared lib

2009-09-27 Thread namekuseijin
So, I was trying to get the yafaray raytracer to work with the 3D package Blender, but it asks for python2.6 and all I got is a 2.5. Actually, quite a lot of other related Blender packages are also migrating to 2.6, so a compilation was inevitable. Then I go: ./configure --prefix=~/ make

Re: Bash shell to Python shell?

2009-09-27 Thread Chris Rebert
On Sun, Sep 27, 2009 at 8:13 PM, edwithad edwit...@hotmail.com wrote: I am sure you have not read a question this basic in some time, but I am curious. Using Linux I open a terminal window and type: python. Does Bash Shell go away and to become a Python Shell, or is it still a Bash Shell with

Re: Bash shell to Python shell?

2009-09-27 Thread Ned Deily
In article 2009092721134550073-edwit...@hotmailcom, edwithad edwit...@hotmail.com wrote: I am sure you have not read a question this basic in some time, but I am curious. Using Linux I open a terminal window and type: python. Does Bash Shell go away and to become a Python Shell, or is it

UnboundLocalError - (code is short simple)

2009-09-27 Thread pylearner
Python version = 2.6.1 IDLE Computer = Win-XP, SP2 (current with all windows updates) --- Greetings: I have written code for two things: 1) simulate a coin toss, and 2) assign the toss result to a winner. Code for the simulated coin

UnboundLocalError - code is short simple

2009-09-27 Thread pylearner
System Specs: Python version = 2.6.1 IDLE Computer = Win-XP, SP2 (current with all windows updates) Greetings: I have written code for two things: 1) simulate a coin toss, and 2) assign the toss result to

Re: Bash shell to Python shell?

2009-09-27 Thread Grant Edwards
On 2009-09-28, Chris Rebert c...@rebertia.com wrote: On Sun, Sep 27, 2009 at 8:13 PM, edwithad edwit...@hotmail.com wrote: I am sure you have not read a question this basic in some time, but I am curious. Using Linux I open a terminal window and type: python. Does Bash Shell go away and to

Re: UnboundLocalError - (code is short simple)

2009-09-27 Thread Chris Kaynor
Lets look at what is happening on a few of the lines here: First: from coin_toss import coin_toss imports the module coin_toss and sets the local variable coin_toss to the value of coin_toss in the module coin_toss. Second: coin_toss = coin_toss() calls the function bound to the name

Re: UnboundLocalError - (code is short simple)

2009-09-27 Thread Chris Rebert
On Sun, Sep 27, 2009 at 8:53 PM, pylearner for_pyt...@yahoo.com wrote: snip --- Traceback (most recent call last):  File pyshell#2, line 1, in module    toss_winner()  File C:/Python26/toss_winner.py, line 7, in toss_winner    

Re: Detecting changes to a dict

2009-09-27 Thread CTO
On Sep 27, 5:36 am, Steven D'Aprano st...@remove-this- cybersource.com.au wrote: I'm pretty sure the answer to this is No, but I thought I'd ask just in case... Is there a fast way to see that a dict has been modified? I don't care what the modifications are, I just want to know if it has

Re: Multidimensional arrays/lists

2009-09-27 Thread Simon Forman
On Sun, Sep 27, 2009 at 12:40 PM, Someone Something fordhai...@gmail.com wrote: I'm trying to write a little tic-tac-toe program I need a array/list such that I can represent the tic tac toe board with an x axis and y axis and i can access each square to find out whether there is an X or an O.

Re: Detecting changes to a dict

2009-09-27 Thread Steven D'Aprano
On Sun, 27 Sep 2009 21:42:10 -0700, CTO wrote: Is there a fast way to see that a dict has been modified? ... d = {a: b, c: d} d2 = d.copy() assert d == d2 d[e] = f assert d == d2 Is this what you're looking for? In general, no. I was hoping for an O(1) check. Yours test is only O(1)

Re: Most active coroutine library project?

2009-09-27 Thread greg
Dave Angel wrote: Actually even 64k looked pretty good, compared to the 1.5k of RAM and 2k of PROM for one of my projects, a navigation system for shipboard use. Until you wanted to do hi-res colour graphics, at which point the video memory took up an inconveniently large part of the address

Re: Why the file mode of .pyc files has x?

2009-09-27 Thread greg
Peng Yu wrote: -rw--- 1 pengy lilab 29 2009-09-26 10:10:45 main.py -rwx-- 1 pengy lilab 106 2009-09-26 10:19:17 test.py -rwx-- 1 pengy lilab 339 2009-09-26 10:20:39 test.pyc Doesn't happen for me with 2.5 on Darwin. What python/OS are you using? -- Greg --

Re: Why the file mode of .pyc files has x?

2009-09-27 Thread greg
Also, what kind of file system are the files on? Unixes often report the x bit as always being on when the file system doesn't have x bits (e.g. for FAT-based file systems). -- Greg -- http://mail.python.org/mailman/listinfo/python-list