who can give me some practical tutorials on django 1.4 or 1.5?

2012-11-03 Thread Levi Nie
Who can give me some practical tutorials on django 1.4 or 1.5? Thank you. -- http://mail.python.org/mailman/listinfo/python-list

Re: Proper place for everything

2012-11-03 Thread Aahz
In article <509441cb$0$29967$c3e8da3$54964...@news.astraweb.com>, Steven D'Aprano wrote: >On Fri, 02 Nov 2012 04:20:20 -0700, Jason Benjamin wrote: >> >> Anybody know of the appropriate place to troll and flame about various >> Python related issues? I'm kind of mad about some Python stuff and I

Re: Haskell -> Python

2012-11-03 Thread Aahz
In article , wrote: > >def options( heaps ): > >if heaps == []: return [] > >head, tail = heaps[:1], heaps[1:] > ># Calculate all possible moves which is the sum of ># prepending all possible head "moves" to the tail ># and appending all possible tail "moves" to the

Re: is implemented with id ?

2012-11-03 Thread Aahz
In article <50959154$0$6880$e4fe5...@news2.news.xs4all.nl>, Hans Mulder wrote: >On 3/11/12 20:41:28, Aahz wrote: >> In article <50475822$0$6867$e4fe5...@news2.news.xs4all.nl>, >> Hans Mulder wrote: >>> On 5/09/12 15:19:47, Franck Ditter wrote: - I should have said that I work with Pyt

Re: is implemented with id ?

2012-11-03 Thread Aahz
In article <50959827$0$29967$c3e8da3$54964...@news.astraweb.com>, Steven D'Aprano wrote: > >Actually, for many applications, the space "savings" may actually be >*costs*, since interning forces Python to hold onto strings even after >they would normally be garbage collected. That's old news,

Re: is implemented with id ?

2012-11-03 Thread Aahz
In article , Chris Angelico wrote: >On Sun, Nov 4, 2012 at 2:10 PM, Steven D'Aprano > wrote: >> >> /* Shortcut for empty or interned objects */ >> if (v == u) { >> Py_DECREF(u); >> Py_DECREF(v); >> return 0; >> } >> result = unicode_compare(u, v); >> >> where v and u are pointers to t

Re: PYTHON - Using Mosaic Qt Developer Suite with Qt Designer

2012-11-03 Thread Vincent Vande Vyvre
Le 04/11/12 03:27, kapetanovic.zer...@gmail.com a écrit : > Hi, > > I'm using Qt Designer to create a GUI that reads data from a file and plots > in on a graph. I downloaded the Qt Developer and followed the directions in > the readme.txt to add the plugins. My issue is that when I open Qt Design

Re: is implemented with id ?

2012-11-03 Thread Chris Angelico
On Sun, Nov 4, 2012 at 2:10 PM, Steven D'Aprano wrote: > /* Shortcut for empty or interned objects */ > if (v == u) { > Py_DECREF(u); > Py_DECREF(v); > return 0; > } > result = unicode_compare(u, v); > > where v and u are pointers to the unicode object. There's a shortcut if they're t

Re: is implemented with id ?

2012-11-03 Thread Steven D'Aprano
On Sun, 04 Nov 2012 01:14:29 +, Oscar Benjamin wrote: > On 3 November 2012 22:50, Chris Angelico wrote: >> This one I haven't checked the source for, but ISTR discussions on this >> list about comparison of two unequal interned strings not being >> optimized, so they'll end up being compared

PYTHON - Using Mosaic Qt Developer Suite with Qt Designer

2012-11-03 Thread kapetanovic . zerina
Hi, I'm using Qt Designer to create a GUI that reads data from a file and plots in on a graph. I downloaded the Qt Developer and followed the directions in the readme.txt to add the plugins. My issue is that when I open Qt Designer the graphing widgets are not there to use. I was hoping to ge

Re: is implemented with id ?

2012-11-03 Thread Chris Angelico
On Sun, Nov 4, 2012 at 12:14 PM, Oscar Benjamin wrote: > On 3 November 2012 22:50, Chris Angelico wrote: >> This one I haven't checked the source for, but ISTR discussions on >> this list about comparison of two unequal interned strings not being >> optimized, so they'll end up being compared cha

Re: is implemented with id ?

2012-11-03 Thread Oscar Benjamin
On 3 November 2012 22:50, Chris Angelico wrote: > This one I haven't checked the source for, but ISTR discussions on > this list about comparison of two unequal interned strings not being > optimized, so they'll end up being compared char-for-char. Using 'is' > guarantees that the check stops with

Re: is implemented with id ?

2012-11-03 Thread Chris Angelico
On Sun, Nov 4, 2012 at 9:18 AM, Steven D'Aprano wrote: > On Sat, 03 Nov 2012 22:49:07 +0100, Hans Mulder wrote: > Actually, for many applications, the space "savings" may actually be > *costs*, since interning forces Python to hold onto strings even after > they would normally be garbage collected

Re: is implemented with id ?

2012-11-03 Thread Roy Smith
In article <50959154$0$6880$e4fe5...@news2.news.xs4all.nl>, Hans Mulder wrote: > That's a matter of perspective: in my book, the primary advantage of > working with interned strings is that I can use 'is' rather than '==' > to test for equality if I know my strings are interned. The space > sav

Fwd: Re: Negative array indicies and slice()

2012-11-03 Thread Andrew Robinson
Forwarded to python list: Original Message Subject:Re: Negative array indicies and slice() Date: Sat, 03 Nov 2012 15:32:04 -0700 From: Andrew Robinson Reply-To: andr...@r3dsolutions.com To: Ian Kelly <> On 11/01/2012 05:32 PM, Ian Kelly wrote: On Thu,

Re: is implemented with id ?

2012-11-03 Thread Steven D'Aprano
On Sat, 03 Nov 2012 22:49:07 +0100, Hans Mulder wrote: > On 3/11/12 20:41:28, Aahz wrote: >> [got some free time, catching up to threads two months old] >> >> In article <50475822$0$6867$e4fe5...@news2.news.xs4all.nl>, Hans Mulder >> wrote: >>> On 5/09/12 15:19:47, Franck Ditter wrote: >>>

Re: is implemented with id ?

2012-11-03 Thread Hans Mulder
On 3/11/12 20:41:28, Aahz wrote: > [got some free time, catching up to threads two months old] > > In article <50475822$0$6867$e4fe5...@news2.news.xs4all.nl>, > Hans Mulder wrote: >> On 5/09/12 15:19:47, Franck Ditter wrote: >>> >>> - I should have said that I work with Python 3. Does that matte

Re: is implemented with id ?

2012-11-03 Thread Aahz
[got some free time, catching up to threads two months old] In article <50475822$0$6867$e4fe5...@news2.news.xs4all.nl>, Hans Mulder wrote: >On 5/09/12 15:19:47, Franck Ditter wrote: >> >> - I should have said that I work with Python 3. Does that matter ? >> - May I reformulate the queston : "a i

Re: Haskell -> Python

2012-11-03 Thread Duncan Booth
Ian Kelly wrote: > On Fri, Nov 2, 2012 at 1:19 PM, wrote: >> Is there anything anyone could recommend to make it more "Pythonic" >> or more functional. It looks clumsy next to the Haskell. > > def options(heaps): > for i, heap in enumerate(heaps): > head = heaps[:i] > tai

RE: How to generate account number?

2012-11-03 Thread Andriy Kornatskyy
Tim, Good point. b32decode seems to be capable to understand such common mistakes (see map01 argument to b32decode), I haven't tried: http://docs.python.org/2/library/base64.html Thanks. Andriy > Date: Sat, 3 Nov 2012 10:34:26 -0500 > From: python.l..

Re: Obnoxious postings from Google Groups

2012-11-03 Thread Steven D'Aprano
On Sat, 03 Nov 2012 10:24:15 -0400, Dave Angel wrote: > For the DOS world, real programmers have written a "complete" *.com > program using only echo. Echo? Wimps. Real programmers write their code directly on the surface of the hard drive using only a magnetised needle. -- Steven -- http:/

RE: How to generate account number?

2012-11-03 Thread Andriy Kornatskyy
Roy, Per your advise: >>> from base64 import b32encode >>> human_format = lambda n: 'Z%s-%s' % (b32encode(chr((n >> 24) & 255) + >>> chr((n >> 16) & 255))[:4], b32encode(chr((n >> 8) & 255) + chr(n & >>> 255))[:4]) >>> human_format(5738521581) 'ZKYFA-4PWQ' >>> human_format(17888279480) 'ZFI4Q-

Re: Obnoxious postings from Google Groups

2012-11-03 Thread Chris Angelico
On Sun, Nov 4, 2012 at 1:24 AM, Dave Angel wrote: > For the DOS world, real programmers have written a "complete" *.com > program using only echo. Only as an exercise. It was satisfying to prove to myself that I could do it, but pretty useless. Normally I used DEBUG.EXE to build my code - it has

Re: How to generate account number?

2012-11-03 Thread Tim Chase
On 11/03/12 08:22, Roy Smith wrote: > Even better might be base-32 encoding the value. Strings of > digits have an information density of about 3.2 bits/char. > Base-32 is just about as readable, but gives you 5 bits/char, so > you end up with a few less characters (which you still want to > chunk

Re: How to generate account number?

2012-11-03 Thread Michael Torrie
On 11/02/2012 03:13 PM, Andriy Kornatskyy wrote: > > Requirements for `account number` generator: > > 1. Issue pseudo random consistent number (must be unique for dozen millions > of records) > 2. Easy check validity (without a need to make a database call) > > Interested? Read more here: > >

Re: Obnoxious postings from Google Groups

2012-11-03 Thread Dave Angel
On 11/03/2012 03:44 AM, Bob Martin wrote: > >> > Real programmers (can) write in assembler. Real programmers can (and have) write in hex/octal or binary. For my first project at a permanent job, I had to write code for a machine with no assembler. Near the end of the project, I wrote a text edi

What is Islam?

2012-11-03 Thread BV BV
What is Islam? In this episode Shaikh Yusuf Estes Explains the meaning of Islam in detail. http://youtube.googleapis.com/v/Gl-wuhzOkpo?rel=0 thank you -- http://mail.python.org/mailman/listinfo/python-list

Re: How to generate account number?

2012-11-03 Thread Roy Smith
In article , Andriy Kornatskyy wrote: > 'Z05738521581' > 'Z17888279480' > 'Z07395350007' > > Short, human readable and satisfy original requirements. > > Andriy If you really want human readable, it's better to chunk the data up into 3 or 4 digit groups. So, instead of Z05738521581, maybe

Re: Google spreadsheets - getting started

2012-11-03 Thread Mark Carter
OK, the story so far: import gdata import gdata.auth import gdata.gauth import gdata.docs.service import OpenSSL.crypto tokenfile = "privatekey.p12" #f = open(tokenfile, 'r') #blob = f.read() #f.close() #if blob: p12 = OpenSSL.crypto.load_pkcs12(file(tokenfile, 'rb').read(), 'notasecret') print

Re: Google spreadsheets - getting started

2012-11-03 Thread Mark Carter
OK, maybe the p12 file is useful after all (?) I've got the following code: import gdata tokenfile = "my-privatekey.p12" f = open(tokenfile, 'r') blob = f.read() f.close() token = gdata.gauth.token_from_blob(blob) When I run that I get: Traceback (most recent call last): File "/home/mcarter/wa

Google spreadsheets - getting started

2012-11-03 Thread Mark Carter
I want to mess around with my online Google spreadsheets from my Linux box programmatically. I am TOTALLY confused. I've got gdata installed, and it appears that the best way to access the spreadsheets is to authenticate with Oauth2. Here's the main thing: how do I get an Oauth2 key to use with

Re: How to improve the usability of nested packages

2012-11-03 Thread Michael Schwarz
Hi Stefan On 2012-W44-5, at 19:23, Stefan H. Holek wrote: > That said, there are ways to avoid import cycles. One is to very carefully > craft your modules so they do not have to import from each other. Another is > to not have imports at the module level, but move them into the functions > wh

install pyOpenSSL in python2.7

2012-11-03 Thread ????????
i have install pyOpenSSL-0.11 in python2.7 this way: download pyOpenSSL-0.11.tar.gz #tar -zvxf pyOpenSSL-0.11.tar.gz #cd pyOpenSSL-0.11 #python setup.py install >>> import OpenSSL Traceback (most recent call last): File "", line 1, in File "/usr/local/lib/python2.7/dist-packages/OpenS

Re: How to improve the usability of nested packages

2012-11-03 Thread Michael Schwarz
Hi Terry On 2012-W44-5, at 18:56, Terry Reedy wrote: >> or would you maybe structure the library entirely different? > > Based on my limited experience with subpackages* plus reports on this list > about problems, such as yours, I have concluded that subpackages are an > attractive nuisance th

RE: How to generate account number?

2012-11-03 Thread Andriy Kornatskyy
Steven, see below, please. > From: steve+comp.lang.pyt...@pearwood.info > Subject: Re: How to generate account number? > Date: Fri, 2 Nov 2012 22:39:31 + > To: python-list@python.org > > On Sat, 03 Nov 2012 00:13:19 +0300, Andriy Kornatskyy wrote: > >>

RE: How to generate account number?

2012-11-03 Thread Andriy Kornatskyy
>>> from hashlib import sha1 >>> sha1('GangGreene-20120203-1012').hexdigest() 'ef764a2fe44532008dc9a99c391c70cd85ec9d82' It is too long and not verifiable. >>> from uuid import uuid4 >>> uuid4() UUID('2c14484b-5a0c-4f4b-b7bc-8187548b4888') Pretty much the same what you suggest but simpler and

Re: enabling universal newline

2012-11-03 Thread Peter Kleiweg
Steven D'Aprano schreef op de 2e dag van de slachtmaand van het jaar 2012: > On Fri, 02 Nov 2012 23:22:53 +0100, Peter Kleiweg wrote: > > > In Python 3.1 and 3.2 > > > > At start-up, the value of sys.stdin.newlines is None, which means, > > universal newline should be enabled. But it isn't. > >

RE: How to generate account number?

2012-11-03 Thread Andriy Kornatskyy
Jose, absolutely, let me know should you have any issues. Andriy > Date: Fri, 2 Nov 2012 15:29:13 -0600 > Subject: Re: How to generate account number? > From: josen.figue...@unixmexico.org > To: andriy.kornats...@live.com > CC: python-list@python.org > > Hello An

Re: enabling universal newline

2012-11-03 Thread Peter Otten
Steven D'Aprano wrote: > On Fri, 02 Nov 2012 23:22:53 +0100, Peter Kleiweg wrote: > >> In Python 3.1 and 3.2 >> >> At start-up, the value of sys.stdin.newlines is None, which means, >> universal newline should be enabled. But it isn't. > > What makes you think it is not enabled? $ python3 -c '

Re: better way for ' '.join(args) + '\n'?

2012-11-03 Thread Ramchandra Apte
On Saturday, 27 October 2012 03:12:31 UTC+5:30, Tycho Andersen wrote: > On Fri, Oct 26, 2012 at 05:36:50PM -0400, Dave Angel wrote: > > > On 10/26/2012 05:26 PM, Tycho Andersen wrote: > > > > Assuming it's the length of the list that's the problem, not the > > > > length of the strings in the l

Re: Obnoxious postings from Google Groups

2012-11-03 Thread Bob Martin
in 684220 20121102 093654 Jamie Paul Griffin wrote: >/ ru...@yahoo.com wrote on Thu 1.Nov'12 at 15:08:26 -0700 / > >> On 11/01/2012 03:55 AM, Jamie Paul Griffin wrote: >> > Anybody serious about programming should be using a form of >> > UNIX/Linux if you ask me. It's inconceivable that these sys