New books: Learning Python, Python Pocket Reference 4th Eds

2009-09-26 Thread lutz
I'm happy to announce new, 4th editions of the O'Reilly books Learning Python and Python Pocket Reference. These new editions have been thoroughly updated and expanded to cover both Python 3.1 and 2.6, and fully present features that appear in each Python line. Whether you're using Python 2.X,

[ANN] python-daemon 1.5.1

2009-09-26 Thread Ben Finney
Howdy all, I'm pleased to announce the release of version 1.5.1 of ‘python-daemon’. What is python-daemon = The ‘python-daemon’ library is the reference implementation of PEP 3143 URL:http://www.python.org/dev/peps/pep-3143/, “Standard daemon process library”. The source

ANN: agenda2pdf v1.0

2009-09-26 Thread Iñigo Serna
Hi, I'm proud to present you agenda2pdf. This is a simple script which generates a book agenda file in PDF format, ready to be printed or loaded on an ebook reader. You can choose among different sections. Each section have pdf links to other parts of the agenda. I've created it for using with

Python-URL! - weekly Python news and links (Sep 26)

2009-09-26 Thread Gabriel Genellina
QOTW: Forget ethical. We can do his homework for him, we can perhaps pass exams for him, maybe graduate for him, and then with our luck, he'll get a job in our office and we get to do his work for him. - Mel http://groups.google.com/group/comp.lang.python/msg/8f7c1fa393c23476

Distribute 0.6.2 released

2009-09-26 Thread Tarek Ziadé
Hello On behalf of the Distribute team, I am very proud to announce the release of Distribute 0.6.2. http://pypi.python.org/pypi/distribute/0.6.2 This release is the first release that is compatible with Python 3, kudos to Martin von Löwis, Lennart Regebro and Alex Grönholm and the ones I am

Jython 2.5.1 Final is out!

2009-09-26 Thread Frank Wierzbicki
On behalf of the Jython development team, I'm pleased to announce that Jython 2.5.1 final is available for download: https://sourceforge.net/projects/jython/files/jython/2.5.1/jython_installer-2.5.1.jar/download - See the http://wiki.python.org/jython/InstallationInstructions for installation

[ANNOUNCE] PyPoppler 0.12.0

2009-09-26 Thread Gian Mario Tagliaretti
I am pleased to announce version 0.12.0 of the Python bindings for Poppler. It is available at: http://launchpad.net/poppler-python/trunk/development/+download/pypoppler-0.12.0.tar.gz md5: 78e9655067b8da2c8ad2565b2620e2f9 PyPoppler 0.12.0 (Sep 26 2009) ==

LAST CHANCE: PyCon 2010: Call for Proposals

2009-09-26 Thread Aahz
Just four more days to propose a presentation! Call for proposals -- PyCon 2010 -- http://us.pycon.org/2010/ === Due date: October 1st, 2009 Want to showcase your skills as a Python Hacker? Want to have hundreds of people see your talk

Re: super() and multiple inheritance failure

2009-09-26 Thread Gabriel Genellina
En Sat, 26 Sep 2009 01:48:08 -0300, Steven D'Aprano st...@remove-this-cybersource.com.au escribió: I'm aiming for some sort of polymorphic inheritance: in a method, if the argument meets some condition, inherit from PClass, if it meets another condition inherit from NClass, and so on. Is

Re: super() and multiple inheritance failure

2009-09-26 Thread Chris Rebert
On Fri, Sep 25, 2009 at 9:30 PM, Steven D'Aprano st...@remove-this-cybersource.com.au wrote: On Fri, 25 Sep 2009 20:15:54 -0700, Chris Rebert wrote: Inside MyClass().method(n), I dispatch to either NClass.method() or PClass.method() depending on the value of the argument n. The correct class

Re: super() and multiple inheritance failure

2009-09-26 Thread Michele Simionato
On Sep 26, 8:02 am, Gabriel Genellina gagsl-...@yahoo.com.ar wrote: If you decide at every invocation which method to call, it's a dispatcher;   you may use a dictionary to map each alternative to the function to be   invoked. If it only depends on the type of the argument, there is a hidden  

Re: How python source code in large projects are organized?

2009-09-26 Thread Christopher Arndt
On 20 Sep., 22:10, exar...@twistedmatrix.com wrote: On 07:10 pm, pengyu...@gmail.com wrote: On Sun, Sep 20, 2009 at 11:31 AM, Daniel Fetchinson fetchin...@googlemail.com wrote: I am wondering what is the best way of organizing python source code in a large projects. There are package code,

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

2009-09-26 Thread Peng Yu
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 information of an object and the values of its members. Overloading '__expr__' and '__repr__' then using 'print' can sort of

Re: How to control I/O buffering besides -u?

2009-09-26 Thread Dave Angel
kj wrote: Is there any way to specify unbuffered I/O from *within* the code (rather than via the command-line -u flag)? TIA! kynn When creating a file object, specify a buffer size of zero. I don't know how to change the buffering of a file object that's already been created, as stdin,

Re: Signing extensions

2009-09-26 Thread Roger Binns
Neil Hodgson wrote: Code signing certificates that will be be valid for Windows Authenticode cost $129 per year through CodeProject That isn't an amount I am prepared to pay either :-) (I don't even use Windows except as a glorified boot loader for Rise of Nations and to build Python

Re: nested structure with internal references

2009-09-26 Thread Hendrik van Rooyen
On Friday, 25 September 2009 19:11:06 Torsten Mohr wrote: I'd like to use a nested structure in memory that consists of dict()s and list()s, list entries can be dict()s, other list()s, dict entries can be list()s or other dict()s. The lists and dicts can also contain int, float, string, ...

Re: raise errors

2009-09-26 Thread Gabriel Genellina
En Mon, 21 Sep 2009 06:17:20 -0300, daved170 daved...@gmail.com escribió: I need help with exceptions raising. My goal is to print at the outer functions all the errors including the most inner one. The default exception report contains a lot of information, you don't have to do anything

Re: Format string with single quotes in it

2009-09-26 Thread Bahadir
On Sep 26, 6:33 am, Gabriel Genellina gagsl-...@yahoo.com.ar wrote: So, look in your file for lines ending in % -- Gabriel Genellina Hello All, I fixed it with your help. Sometimes you need that extra insight from comp.lang.python. Thank you so much, Bahadir --

Why the file mode of .pyc files has x?

2009-09-26 Thread Peng Yu
Hi, It is strange that the file mode of .pyc files are changed to executable (x mode) after the corresponding .py files have been run. I have the follow python, which is compiled from source code by me. $ python --version Python 2.6.2 Should .pyc files have the x mode? Regards, Peng --

How to control I/O buffering besides -u?

2009-09-26 Thread kj
Is there any way to specify unbuffered I/O from *within* the code (rather than via the command-line -u flag)? TIA! kynn -- http://mail.python.org/mailman/listinfo/python-list

Re: is this whiff/wsgi claim true?

2009-09-26 Thread exarkun
On 25 Sep, 02:26 pm, aaron.watt...@gmail.com wrote: 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 :) Developers build WHIFF

Re: Twisted: 1 thread in the reactor pattern

2009-09-26 Thread exarkun
On 25 Sep, 05:25 am, jacopo.pe...@gmail.com wrote: On Sep 24, 7:54�pm, exar...@twistedmatrix.com wrote: On 07:10 am, jacopo.pe...@gmail.com wrote: On Sep 23, 5:57�pm, exar...@twistedmatrix.com wrote: [snip] [snip] If you have a function that takes 5 minutes to run, then you're blocking the

multiprocessing + console + windows = challenge?

2009-09-26 Thread Valery
Hi all. So, the doc is pitiless: Note Functionality within this package requires that the __main__ method be importable by the children. This is covered in Programming guidelines however it is worth pointing out here. This means that some examples, such as the multiprocessing.Pool examples

Python-URL! - weekly Python news and links (Sep 26)

2009-09-26 Thread Gabriel Genellina
QOTW: Forget ethical. We can do his homework for him, we can perhaps pass exams for him, maybe graduate for him, and then with our luck, he'll get a job in our office and we get to do his work for him. - Mel http://groups.google.com/group/comp.lang.python/msg/8f7c1fa393c23476

Re: [Tutor] Help required

2009-09-26 Thread Lie Ryan
waqas ahmad wrote: Now i want to search all those pages, where i have *NOT* written #acl InternationalGroup:read *But* i have written only CatInternational in the page text. You can split the two queries into two regexes: import re acl = re.compile(r'#acl InternationalGroup:read') cat =

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

2009-09-26 Thread tinnews
Jeff McNeil j...@jmcneil.net wrote: The Maildir++ spec states that folders need to begin with a period. The list_folders method enforces that:     def list_folders(self):         Return a list of folder names.         result = []         for entry in os.listdir(self._path):  

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

2009-09-26 Thread Peng Yu
On Sat, Sep 26, 2009 at 8:10 AM, Steven D'Aprano st...@remove-this-cybersource.com.au wrote: On Sat, 26 Sep 2009 06:57:52 -0500, Peng Yu wrote: Hi, It is strange that the file mode of .pyc files are changed to executable (x mode) after the corresponding .py files have been run. Are you

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

2009-09-26 Thread tinnews
Jeff McNeil j...@jmcneil.net 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. -- Chris Green The doc says that Folders of the style

Re: Most active coroutine library project?

2009-09-26 Thread Dave Angel
Dennis Lee Bieber wrote: On Fri, 25 Sep 2009 14:22:51 + (UTC), Grant Edwards inva...@invalid.invalid declaimed the following in gmane.comp.python.general: EXX accomplised much of the context switch operation. I don't remember how much RAM was available, but it wasn't much...

Re: flow control and nested loops

2009-09-26 Thread Raymond Hettinger
On Sep 25, 12:01 pm, kj no.em...@please.post wrote: In Perl, one can label loops for finer flow control.  For example: X: for my $x (@X) {   Y: for my $y (@Y) {     for my $z (@Z) {       next X if test1($x, $y, $z);       next Y if test2($x, $y, $z);       frobnicate($x, $y, $z);     }  

RE: [Tutor] Help required

2009-09-26 Thread waqas ahmad
Hi, First of all thanks a lot for your reply. search.findall is not working. here is my complete small program. def getAcl(request, pg): pged = PageEditor(request, pg) pagetext = pged.get_raw_body() search=re.compile(^#acl InternationalGroup.*\n, re.M).search(pagetext) if

How to run python script in emacs

2009-09-26 Thread devilkin
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 me with it? is there any tricks like emacs short cut? also please recommand some emacs plug-ins for python

Re: Comparison of parsers in python?

2009-09-26 Thread andrew cooke
On Sep 21, 10:59 am, Nobody nob...@nowhere.com wrote: I have a similar question. What I want: a tokeniser generator which can take a lex-style grammar (not necessarily lex syntax, but a set of token specifications defined by REs, BNF, or whatever), generate a DFA, then run the DFA on

Re: Most active coroutine library project?

2009-09-26 Thread Grant Edwards
On 2009-09-26, Dennis Lee Bieber wlfr...@ix.netcom.com wrote: On Fri, 25 Sep 2009 14:22:51 + (UTC), Grant Edwards inva...@invalid.invalid declaimed the following in gmane.comp.python.general: EXX accomplised much of the context switch operation. I don't remember how much RAM was

Re: importing with .m instead of .py

2009-09-26 Thread wisccal
Wanderer wrote: Is there a way to get python to import files that don't end in .py? How about using imp.load_source? y...@x:/tmp$ cat out.m print(this is my module) # comment y=[1,2,3,4,5,6,7,8,9]; # comment y...@x:/tmp$ cat load_my_module.py import imp

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

2009-09-26 Thread Steven D'Aprano
On Sat, 26 Sep 2009 06:57:52 -0500, Peng Yu wrote: Hi, It is strange that the file mode of .pyc files are changed to executable (x mode) after the corresponding .py files have been run. Are you sure? They don't on my system. [st...@sylar test]$ ls -l total 8 -rw-rw-r-- 1 steve steve 6

[ANN] python-daemon 1.5.1

2009-09-26 Thread Ben Finney
Howdy all, I'm pleased to announce the release of version 1.5.1 of ‘python-daemon’. What is python-daemon = The ‘python-daemon’ library is the reference implementation of PEP 3143 URL:http://www.python.org/dev/peps/pep-3143/, “Standard daemon process library”. The source

Re: How to control I/O buffering besides -u?

2009-09-26 Thread Matt Joiner
You can try flushing, or reopening with no buffering sys.stdout.flush() sys.stdout = os.fdopen(sys.stdout.fileno(), 'w', 0) On Sun, Sep 27, 2009 at 2:20 AM, Dave Angel da...@ieee.org wrote: kj wrote: Is there any way to specify unbuffered I/O from *within* the code (rather than via the

Re: Most active coroutine library project?

2009-09-26 Thread Grant Edwards
On 2009-09-26, Dave Angel da...@ieee.org 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. I've worked on projects as recently as the past year that had only a couple hundred bytes of RAM, and

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

2009-09-26 Thread Robert Kern
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 information of an object and the values of its members. Overloading '__expr__' and

Re: Anyone with Experience Using WinTV Capture Cards?

2009-09-26 Thread Tim Roberts
W. eWatson wolftra...@invalid.com wrote: W. eWatson wrote: A friend is looking for some help with how to use Python to access a WinTV (Go Plus) capture card, and how to display an image from it. Is there some facility that might help him, or does anyone have experience with such use that

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

2009-09-26 Thread Tim Roberts
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 subfolders. That was added in

Re: flow control and nested loops

2009-09-26 Thread Bearophile
Raymond Hettinger: Another approach for exiting multiple levels of loops is wrap the inner calls in a function and return from them when needed:    def f(x):        for y in y:            for z in Z:                if test1(x,y,z):                    return                

Plugins for a Python program

2009-09-26 Thread OldAl
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 Method program, so

Re: can i use the browser to show the result of python

2009-09-26 Thread Hacken
On Sep 25, 6:27 pm, Dave Angel da...@ieee.org wrote: Hacken wrote: I have write some python script i want to use browser(IE or FF) to call it, an show the returns! how to? You don't say much about your environment, nor the nature of your script. So my response will be very generic.

Re: can i use the browser to show the result of python

2009-09-26 Thread Steven D'Aprano
On Sat, 26 Sep 2009 19:05:37 -0700, Hacken wrote: i just want write my programes in python, and i use Browser to show my GUI, can i do that?and how to? thanks,waitting.. In Python 2.6, you can use the webbrowser module. -- Steven --

unexplainable python

2009-09-26 Thread dads
When creating a script that converts digits to words I've come across some unexplainable python. The script works fine until I use a 5 digit number and get a 'IndexError: string index out of range'. After looking into it and adding some print calls, it looks like a variable changes for no reason.

Re: unexplainable python

2009-09-26 Thread dads
Sorry forgot to mention I'm using python 2.6 -- http://mail.python.org/mailman/listinfo/python-list

Re: unexplainable python

2009-09-26 Thread Chris Rebert
On Sat, Sep 26, 2009 at 7:37 PM, dads wayne.dads.b...@gmail.com wrote: When creating a script that converts digits to words I've come across some unexplainable python. The script works fine until I use a 5 digit number and get a 'IndexError: string index out of range'. Please provide the full

Re: How to run python script in emacs

2009-09-26 Thread Join hack
you can use emacs command shell for that 2009/9/26 devilkin devilsp...@gmail.com 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 me with it? is there any

Re: unexplainable python

2009-09-26 Thread Banibrata Dutta
Without reading or trying to understand the program well enough, at the very outset, looks like it's a program to convert a set of numeric digits into it's equivalent whole number representation, in textual form, and that while author of this piece of code has taken care of english numeric nuances

Re: unexplainable python

2009-09-26 Thread tec
dads 写道: ... enter number: 34567 _5digit function used 34 before sent to _2digit 34 slice when at _2digit function 34 before sent to plus_ten function 7 slice when at _2digit function This is the point. _2digit() only gets 1 digit(7) and needs accessing the second byte in: var =

Re: unexplainable python

2009-09-26 Thread Mel
dads wrote: When creating a script that converts digits to words I've come across some unexplainable python. The script works fine until I use a 5 digit number and get a 'IndexError: string index out of range'. After looking into it and adding some print calls, it looks like a variable

Re: can i use the browser to show the result of python

2009-09-26 Thread Dave Angel
Hacken wrote: On Sep 25, 6:27 pm, Dave Angel da...@ieee.org wrote: Hacken wrote: I have write some python script i want to use browser(IE or FF) to call it, an show the returns! how to? You don't say much about your environment, nor the nature of your script. So

Re: How to run python script in emacs

2009-09-26 Thread Nobody
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 me with it? is there any tricks like emacs short cut?

Re: unexplainable python

2009-09-26 Thread Dave Angel
dads wrote: When creating a script that converts digits to words I've come across some unexplainable python. The script works fine until I use a 5 digit number and get a 'IndexError: string index out of range'. After looking into it and adding some print calls, it looks like a variable changes

Re: Anyone with Experience Using WinTV Capture Cards?

2009-09-26 Thread W. eWatson
Tim Roberts wrote: W. eWatson wolftra...@invalid.com wrote: W. eWatson wrote: A friend is looking for some help with how to use Python to access a WinTV (Go Plus) capture card, and how to display an image from it. Is there some facility that might help him, or does anyone have experience

[issue6957] Extension modules fail to build on OS X 10.6 using python.org 2.x/3.x

2009-09-26 Thread Ned Deily
Ned Deily n...@acm.org added the comment: Explicitly defining CC during the installer build does seem to fix the extension build problem, at least for well-behaved extensions. I successfully tested building simplejson (using both easy_install and direct setup.py installs) and MySQLdb, both