Re: code review

2012-07-02 Thread Steven D'Aprano
On Sun, 01 Jul 2012 21:50:29 -0400, Devin Jeanpierre wrote: > On Sun, Jul 1, 2012 at 9:28 PM, Steven D'Aprano > wrote: >> Technically, < in Python is left-associative: a < b < c first evaluates >> a, not b or c. But it is left-associative under the rules of comparison >> operator chaining, not ar

hello everyone! i'm a new member from China

2012-07-02 Thread levi nie
i love python very much.it's powerful,easy and useful. i got it from Openstack.And i'm a new guy on python. Can i ask some stupid questions in days? haha... -- http://mail.python.org/mailman/listinfo/python-list

Re: hello everyone! i'm a new member from China

2012-07-02 Thread Peter Otten
levi nie wrote: > i love python very much.it's powerful,easy and useful. > i got it from Openstack.And i'm a new guy on python. Welcome! > Can i ask some stupid questions in days? haha... Sure, but we cannot guarantee that the answer will be stupid, too ;) -- http://mail.python.org/mailman/li

Re: hello everyone! i'm a new member from China

2012-07-02 Thread Chris Angelico
On Mon, Jul 2, 2012 at 12:48 AM, levi nie wrote: > i love python very much.it's powerful,easy and useful. > i got it from Openstack.And i'm a new guy on python. > Can i ask some stupid questions in days? haha... Of course you can. Everyone else does! :) Just remember to give it a good subject lin

Re: code review

2012-07-02 Thread Steven D'Aprano
On Mon, 02 Jul 2012 12:04:29 +1000, Chris Angelico wrote: >> Chained comparisons in the Python sense may be rare in computer >> languages, but it is the standard in mathematics and hardly needs to be >> explained to anyone over the age of twelve. That is a terrible >> indictment on the state of pr

Re: code review

2012-07-02 Thread Chris Angelico
On Mon, Jul 2, 2012 at 6:11 PM, Steven D'Aprano wrote: > "c" < first_word < second_word == third_word < "x" > > I'm sure I don't have to explain what that means -- that standard chained > notation for comparisons is obvious and simple. > > In Python, you write it the normal way, as above. But some

Is Django v1.3 documentation the newest version?

2012-07-02 Thread levi nie
Is Django v1.3 documentation the newest version? i use the Django book 2.0. -- http://mail.python.org/mailman/listinfo/python-list

Re: Is Django v1.3 documentation the newest version?

2012-07-02 Thread Jonathan Harris
Hello It isn't Having been frustrated with out of date books, specifically the Apress published 'Definitive Guide To Django', I've downloaded the Kindle edition of Django 1.4 documentation It's a good tutorial J On Mon, Jul 2, 2012 at 11:00 AM, levi nie wrote: > Is Django v1.3 documentation t

Re: how to use tkinter in python3.2?

2012-07-02 Thread contro opinion
apt-get install tk-dev cd ./python3.2.3 ./cpnfigure make make install ok root@ocean:/home/tiger/Python-3.2.3# python3.2 Python 3.2.3 (default, Jul 2 2012, 21:23:34) [GCC 4.4.5] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import tkinter >>> haha,thin

ANN: eGenix PyRun - One file Python Runtime 1.0.0

2012-07-02 Thread eGenix Team: M.-A. Lemburg
ANNOUNCING eGenix PyRun - One file Python Runtime Version 1.0.0 An easy-to-use single file relocatable Python run-time - available for Windows, Mac OS X a

how to solve this tclerror?

2012-07-02 Thread contro opinion
i want to install a software, please see the manul page 2 http://www.openfiling.info/wp-content/upLoads/data/ArelleUsersManual.pdf when i input the command to install Arelle : tiger@ocean:~$ cd /home/tiger/Arelle tiger@ocean:~/Arelle$ python3.2 arelleGUI.pyw Traceback (most recent call

Re: how to solve this tclerror?

2012-07-02 Thread contro opinion
i solve it myself 1.download tile-0.8.4.0.tar.gz 2. ./configure 3. make 4 make install tiger@ocean:~$ cd /home/tiger/Arelle tiger@ocean:~/Arelle$ python3.2 arelleGUI.pyw i get what i want ,haha. 2012/7/2 contro opinion > i want to install a software, > > please see the manul pag

Re: code review

2012-07-02 Thread Thomas Jollans
On 07/02/2012 02:43 AM, Steven D'Aprano wrote: > On Sun, 01 Jul 2012 09:35:40 +0200, Thomas Jollans wrote: >> This is simply wrong. The comparisons are not acting as binary >> operators. > > Of course they are. Take this chained comparison: Technically, yes - two-input operations are happening. S

Re: code review

2012-07-02 Thread Thomas Jollans
On 07/02/2012 03:28 AM, Steven D'Aprano wrote: > We *really did have* somebody arguing that chained comparisons are Bad > because you can't stick parentheses around bits of it without changing > the semantics. That was an actual argument, not a straw-man. Ahem. It may have been sub-optimally phr

Re: hello everyone! i'm a new member from China

2012-07-02 Thread rdsteph
On Jul 2, 12:50 am, Peter Otten <__pete...@web.de> wrote: > levi nie wrote: > > i love python very much.it's powerful,easy and useful. > > i got it from Openstack.And i'm a new guy on python. > > Welcome! > > > Can i ask some stupid questions in days? haha... > > Sure, but we cannot guarantee that

Re: 2to6 ?

2012-07-02 Thread Thomas Heller
Am 27.06.2012 20:06, schrieb Terry Reedy: On 6/27/2012 10:36 AM, Thomas Heller wrote: Is there a tool, similar to 2to3, which converts python2 code to code using six.py, so that it runs unchanged with python2 *and* python 3? Others have expressed a similar wish, but I do not know that anyone h

Re: code review

2012-07-02 Thread Terry Reedy
On 7/2/2012 1:20 AM, Dennis Lee Bieber wrote: Obviously, someone coming over from VB or R or any other single language x who hasn't read the Python reference is going to be surprised as something or other. So what. The manuals, including the tutorial, are there for a reason. The main poin

WxSlider Mouse Wheel Resolution

2012-07-02 Thread Wanderer
Is there a way to set the mouse wheel resolution for the wxPython wx.Slider? I would like to use the graphic slider for coarse control and the mouse wheel for fine control. Right now the mouse wheel makes the slider jump ten counts and I would like it to be a single count. Thanks -- http://mail.p

Re: how to solve this tclerror?

2012-07-02 Thread Terry Reedy
On 7/2/2012 10:14 AM, contro opinion wrote: i solve it myself 1.download tile-0.8.4.0.tar.gz Or install the latest tcl/tk 8.5(.11), which includes tile/tkk and bug fixes, instead of the rather old 8.4.?. -- Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list

Re: code review

2012-07-02 Thread Rick Johnson
On Jul 2, 3:20 am, Chris Angelico wrote: > On Mon, Jul 2, 2012 at 6:11 PM, Steven D'Aprano > > wrote: > > "c" < first_word < second_word == third_word < "x" > > > I'm sure I don't have to explain what that means -- that standard chained > > notation for comparisons is obvious and simple. > > > In

Re: code review

2012-07-02 Thread Chris Angelico
On Tue, Jul 3, 2012 at 1:57 AM, Rick Johnson wrote: > Poor Chris. That's because you've been brainwashed into believing you > must spoon feed your interpreter to get your code working correctly. > Stop applying these naive assumptions to Python code. Python knows > when you reach the end of a stat

Re: code review

2012-07-02 Thread Rick Johnson
On Jun 30, 9:06 pm, Steven D'Aprano wrote: > On Sun, 01 Jul 2012 00:05:26 +0200, Thomas Jollans wrote: > > Yes. My sole point, really, is that "normally", one would expect these > > two expressions to be equivalent: > > > a < b < c > > (a < b) < c > > Good grief. Why would you expect that? > > You

Re: code review

2012-07-02 Thread Chris Angelico
On Tue, Jul 3, 2012 at 1:16 AM, Rick Johnson wrote: > py> 1 + 3 * 4 > should ALWAYS equal 16! > > With parenthesis only used for grouping: > py> a + (b*c) + d > > Which seems like the most consistent approach to me. Oh yes, absolutely consistent. Consistency. It's a CR 1/2 monster found on page 1

Re: when "normal" parallel computations in CPython will be implemented at last?

2012-07-02 Thread John Nagle
On 7/1/2012 10:51 AM, dmitrey wrote: hi all, are there any information about upcoming availability of parallel computations in CPython without modules like multiprocessing? I mean something like parallel "for" loops, or, at least, something without forking with copying huge amounts of RAM each t

Re: code review

2012-07-02 Thread Rick Johnson
On Jul 2, 11:42 am, Chris Angelico wrote: > Rick, do you realize that you have > to spoon-feed the interpreter with spaces/tabs when other interpreters > just KNOW to drop back an indentation level when you close a brace? Yes. And significant white space is my favorite attribute of Python source

Re: when "normal" parallel computations in CPython will be implemented at last?

2012-07-02 Thread Stefan Behnel
Dan Stromberg, 01.07.2012 21:28: > On Sun, Jul 1, 2012 at 11:58 AM, Thomas Jollans wrote: >> On 07/01/2012 08:44 PM, Dan Stromberg wrote: >>> IronPython, sadly, lacks a python standard library. >> >> Beg pardon? >> >> https://github.com/IronLanguages/main/tree/master/External.LCA_RESTRICTED/Languag

Re: code review

2012-07-02 Thread Thomas Jollans
On 07/02/2012 08:22 PM, Rick Johnson wrote: > Agreed. I wish we had one language. One which had syntactical > directives for scoping, blocks, assignments, etc, etc... > > BLOCK_INDENT_MARKER -> \t > BLOCK_DEDENT_MARKER -> \n > STATEMENT_TERMINATOR -> \n > ASSIGNMENT_OPERATOR -> := > CONDITIONAL_IF

Re: code review

2012-07-02 Thread Ian Kelly
On Sat, Jun 30, 2012 at 2:50 PM, Thomas Jollans wrote: > Which of the two comparisons is done first anyway? > "In the face of ambiguity, refuse the temptation to guess." I would consider that a pro, not a con, because the C-like way is much worse in this regard. Using operator chaining, is "1 <

Re: 2to6 ?

2012-07-02 Thread Terry Reedy
On 7/2/2012 11:02 AM, Thomas Heller wrote: Am 27.06.2012 20:06, schrieb Terry Reedy: On 6/27/2012 10:36 AM, Thomas Heller wrote: Is there a tool, similar to 2to3, which converts python2 code to code using six.py, so that it runs unchanged with python2 *and* python 3? Others have expressed a s

Re: code review

2012-07-02 Thread Rick Johnson
On Jul 2, 2:06 pm, Thomas Jollans wrote: > On 07/02/2012 08:22 PM, Rick Johnson wrote: > > > Agreed. I wish we had one language. One which had syntactical > > directives for scoping, blocks, assignments, etc, etc... > > > BLOCK_INDENT_MARKER -> \t > > BLOCK_DEDENT_MARKER -> \n > > STATEMENT_TERMIN

Re: WxSlider Mouse Wheel Resolution

2012-07-02 Thread Rick Johnson
On Jul 2, 10:45 am, Wanderer wrote: > Is there a way to set the mouse wheel resolution for the wxPython > wx.Slider? I would like to use the graphic slider for coarse control > and the mouse wheel for fine control. Right now the mouse wheel makes > the slider jump ten counts and I would like it to

Re: WxSlider Mouse Wheel Resolution

2012-07-02 Thread Rick Johnson
On Jul 2, 3:45 pm, Rick Johnson wrote: > [...] >   MouseWheel -> cb(MEDIUM) >   MouseWheel+ControlKey -> cb(FINE) >   MouseWheel+ShiftKey -> cb(COURSE) Of course some could even argue that three levels of control are not good enough; for which i wholeheartedly agree! A REAL pro would provide a c

Re: code review

2012-07-02 Thread Chris Angelico
On Tue, Jul 3, 2012 at 5:06 AM, Thomas Jollans wrote: > On 07/02/2012 08:22 PM, Rick Johnson wrote: >> Agreed. I wish we had one language. One which had syntactical >> directives for scoping, blocks, assignments, etc, etc... >> >> BLOCK_INDENT_MARKER -> \t >> BLOCK_DEDENT_MARKER -> \n >> STATEMENT

helping with unicode

2012-07-02 Thread self.python
it's a simple source view program. the codec of the target website is utf-8 so I read it and print the decoded -- #-*-coding:utf8-*- import urllib2 rf=urllib2.urlopen(r"http://gall.dcinside.com/list.php?id=programming";) print rf.read(

Re: code review

2012-07-02 Thread Steven D'Aprano
On Tue, 03 Jul 2012 02:55:48 +1000, Chris Angelico wrote: > On Tue, Jul 3, 2012 at 1:16 AM, Rick Johnson > wrote: >> py> 1 + 3 * 4 >> should ALWAYS equal 16! >> >> With parenthesis only used for grouping: py> a + (b*c) + d >> >> Which seems like the most consistent approach to me. > > Oh yes, ab

Re: ANN: eGenix PyRun - One file Python Runtime 1.0.0

2012-07-02 Thread Simon Cropper
On 02/07/12 23:52, eGenix Team: M.-A. Lemburg wrote: ANNOUNCING eGenix PyRun - One file Python Runtime Version 1.0.0 An easy-to-use single file relocatable Pytho

Re: helping with unicode

2012-07-02 Thread Andrew Berg
On 7/2/2012 7:49 PM, self.python wrote: > > Traceback (most recent call last): > File "C:wrong.py", line 8, in > print rf.read().decode('utf-8') > UnicodeEncodeError: 'cp949' codec can't encode character u'u1368' in position >

Re: helping with unicode

2012-07-02 Thread MRAB
On 03/07/2012 01:49, self.python wrote: it's a simple source view program. the codec of the target website is utf-8 so I read it and print the decoded -- #-*-coding:utf8-*- import urllib2 rf=urllib2.urlopen(r"http://gall.dcinside.com/

Re: code review

2012-07-02 Thread Chris Angelico
On Tue, Jul 3, 2012 at 10:57 AM, Steven D'Aprano wrote: > On Tue, 03 Jul 2012 02:55:48 +1000, Chris Angelico wrote: >> Oh yes, absolutely consistent. Consistency. It's a CR 1/2 monster found >> on page 153 of the 3.5th Edition Monster Manual. > > GvR is fond of quoting Ralph Waldo Emerson: > > "A

Re: helping with unicode

2012-07-02 Thread Terry Reedy
On 7/2/2012 8:49 PM, self.python wrote: it's a simple source view program. the codec of the target website is utf-8 so I read it and print the decoded which re-encodes before printing -- #-*-coding:utf8-*- import urllib2 rf=urllib2

Re: helping with unicode

2012-07-02 Thread Terry Reedy
On 7/2/2012 8:49 PM, self.python wrote: it's a simple source view program. the codec of the target website is utf-8 so I read it and print the decoded which re-encodes before printing -- #-*-coding:utf8-*- import urllib2 rf=urllib2

Re: code review

2012-07-02 Thread John O'Hagan
On Tue, 3 Jul 2012 11:22:55 +1000 Chris Angelico wrote: > On Tue, Jul 3, 2012 at 10:57 AM, Steven D'Aprano > wrote: > > > Perhaps the world would be better off if mathematicians threw out the > > existing precedence rules and replaced them with a strict left-to-right > > precedence. (Personally

New member from India

2012-07-02 Thread anuj kumar
Hello Everyone, Warm greetings to all of you... I have to learn Python.So i recently join the python mailing list .Can you please send me some sample programs from where i can start. Thanks, Anuj -- http://mail.python.org/mailman/listinfo/python-list

Tkinter and Chess problems

2012-07-02 Thread Lalitha Prasad K
Dear All Recently I have been playing with Tkinter. I wrote two scripts to solve well known chess problems: eight queens and knight's tour. Both are available here: https://github.com/LalithaPrasad/PythonScripts All are welcome to download and improve them if required. Hope to rewrite them using t

[ANN]: asyncoro: Framework for asynchronous, concurrent, distributed programming

2012-07-02 Thread Giridhar Pemmasani
Hi, I would like to announce asyncoro (http://asyncoro.sourceforge.net), a Python framework for developing concurrent, distributed programs with asynchronous completions and coroutines. asyncoro features include   * Asynchronous (non-blocking) sockets   * Efficient polling mechanisms epoll, kqueu

Re: New member from India

2012-07-02 Thread Chris Angelico
On Tue, Jul 3, 2012 at 1:36 PM, anuj kumar wrote: > Hello Everyone, > > Warm greetings to all of you... > > I have to learn Python.So i recently join the python mailing list .Can you > please send me some sample programs from where i can start. Welcome! Start here... http://docs.python.org/py3k/

Re: code review

2012-07-02 Thread Steven D'Aprano
On Tue, 03 Jul 2012 12:25:59 +1000, John O'Hagan wrote: > On Tue, 3 Jul 2012 11:22:55 +1000 > Chris Angelico wrote: > >> On Tue, Jul 3, 2012 at 10:57 AM, Steven D'Aprano >> wrote: >> >> > Perhaps the world would be better off if mathematicians threw out the >> > existing precedence rules and r

Dictless classes

2012-07-02 Thread Steven D'Aprano
You can create instances without a __dict__ by setting __slots__: py> class Dictless: ... __slots__ = ['a', 'b', 'c'] ... py> Dictless().__dict__ Traceback (most recent call last): File "", line 1, in AttributeError: 'Dictless' object has no attribute '__dict__' But the class itself stil

How can i do python form post request?

2012-07-02 Thread gmspro
form.html:     p.py: #!/usr/bin/python #what to write here... Both files are put in /var/www/ , now from http://localhost/form.html, if i click the submit button would i execute the p.py  and how can i get the value of textbox? Any answer will be highly appreciated. Thanks in advanced. --

Re: code review

2012-07-02 Thread rusi
On Jul 3, 7:25 am, John O'Hagan wrote: > > I agree to some extent, but as a counter-example, when I was a child there > a subject called "Weights and Measures" which is now redundant because of the > Metric system. I don't miss hogsheads and fathoms at all. > > Music is another field which could d

Re: code review

2012-07-02 Thread Ben Finney
rusi writes: > Similar for standardized languages: Python's indentation is nice -- > except when you have to embed it into say, html If you can't write a ‘pre’ element for pre-formatted text, you don't have HTML http://www.w3.org/TR/html401/struct/text.html#h-9.3.4>. -- \ “Pinky, are you

Re: Dictless classes

2012-07-02 Thread alex23
On Jul 3, 3:03 pm, Steven D'Aprano wrote: > I don't have a use-case for this. But I have some code which assumes that > every class will have a __dict__, and I wonder whether that is a safe > assumption. Remember the recent thread on using a different implementation for .__dict__? https://groups.