Re: Why has python3 been created as a seperate language where there is still python2.7 ?

2012-06-25 Thread Stefan Behnel
Devin Jeanpierre, 26.06.2012 08:15: > On Mon, Jun 25, 2012 at 11:35 PM, Steven D'Aprano >> Making print a statement in the first place was a mistake, but >> fortunately it was a simple enough mistake to rectify once the need for >> backward compatibility was relaxed. > > Hmmm, why is the function

Re: Why has python3 been created as a seperate language where there is still python2.7 ?

2012-06-25 Thread Stefan Behnel
Jeremiah Dodds, 26.06.2012 07:04: > rantingrickjohn...@gmail.com writes: > >> On Monday, June 25, 2012 5:10:47 AM UTC-5, Michiel Overtoom wrote: >>> It has not. Python2 and Python3 are very similar. It's not like if >>> you learn Python using version 2, you have to relearn the language >>> when yo

Re: Why has python3 been created as a seperate language where there is still python2.7 ?

2012-06-25 Thread Devin Jeanpierre
On Mon, Jun 25, 2012 at 11:35 PM, Steven D'Aprano wrote: > There's no real difference between typing print(...) and all the other > functions in Python. Do you lament having to type len(obj) instead of > "len obj" or list(zip(a, b, c)) instead of "list zip a b c"? Surely you mean "list $ zip a b

Re: Why has python3 been created as a seperate language where there is still python2.7 ?

2012-06-25 Thread Jeremiah Dodds
rantingrickjohn...@gmail.com writes: > On Monday, June 25, 2012 5:10:47 AM UTC-5, Michiel Overtoom wrote: >> It has not. Python2 and Python3 are very similar. It's not like if >> you learn Python using version 2, you have to relearn the language >> when you want to switch Python3. The syntax is t

Re: Why has python3 been created as a seperate language where there is still python2.7 ?

2012-06-25 Thread Terry Reedy
On 6/25/2012 11:35 PM, Steven D'Aprano wrote: (Rick, don't make me regret communicating with you again.) On Mon, 25 Jun 2012 19:28:01 -0700, rantingrickjohnson wrote: However, there is something to be said for "old habits die hard". I myself lament every time i must type->(, then blah, then->)

Re: Why has python3 been created as a seperate language where there is still python2.7 ?

2012-06-25 Thread Steven D'Aprano
(Rick, don't make me regret communicating with you again.) On Mon, 25 Jun 2012 19:28:01 -0700, rantingrickjohnson wrote: > However, there is something to be said for "old habits die hard". I > myself lament every time i must type->(, then blah, then->) AGAIN!. My > fingers are hardwired for the o

Re: Faster way to map numpy arrays

2012-06-25 Thread Saurabh Kabra
Thanks guys I implemented a numpy array with fancy indices and got rid of the list and the loops. The time to do the mapping improved ~10x. As a matter of fact, the number of elements in array A to be summed and mapped was different for each element in B (which was the reason I was using lists). B

Re: Why has python3 been created as a seperate language where there is still python2.7 ?

2012-06-25 Thread rantingrickjohnson
On Monday, June 25, 2012 5:10:47 AM UTC-5, Michiel Overtoom wrote: > It has not. Python2 and Python3 are very similar. It's not like if > you learn Python using version 2, you have to relearn the language > when you want to switch Python3. The syntax is the same, only > 'print' is a function inste

Re: tiffany 0.6 released

2012-06-25 Thread Steven D'Aprano
On Mon, 25 Jun 2012 23:36:59 +0200, Christian Tismer wrote: > I saw quite a lot of downloads of this package now, but not a single > reaction or any feedback. Feel fortunate that you are getting any downloads at all :) In my experience, if you are really lucky, perhaps one in a hundred people w

uninitialize PyEval_InitThreads()

2012-06-25 Thread Bob Rossi
Hi, I see that I can initialize python for multi thread support by calling PyEval_InitThreads(). I'm under the impression that when the GIL is turned on, python can slow down a measurable amount. Since I only need to use multiple threads for a portion of my program, after I call PyEval_InitThrea

JOB

2012-06-25 Thread Sonika Sardana
`TalentBurst.com`__ (San Francisco, CA, USA) === **Job Description**: Short description of position Looking for a strong PHP developer who is comfortable with some Linux administratio

Re: Pythonic cross-platform GUI desingers à la Interface Builder (Re: what gui designer is everyone using)

2012-06-25 Thread CM
> It would not be difficult to convince me to commit homicide for > a Delphi-like Python gui machine that runs on a Linux box. I > have played with many - Boa, WxDes, Glade, Tk, Dabo, QtDesigner, > Card, etc. Not sure whether you tried it enough on Linux, but Boa (which was intended to be kind of

Re: Perl __DATA__ construct.

2012-06-25 Thread Miki Tebeka
> Is there a way to do the same thing in Python? Not without some clever tricks. Either you store data at the beginning of the file or you have another file with the data. If you really need one file and data at the end, you can roll your own. Something like: def data(): with open(__

Re: Perl __DATA__ construct.

2012-06-25 Thread Benjamin Kaplan
On Mon, Jun 25, 2012 at 2:20 PM, Mladen Gogala wrote: > I have a script in Perl that I need to rewrite to Python. The script > contains __DATA__ at the end of the script, which enables Perl to access > all the data after that through a file descriptor, like this: > > usage() if ( !$stat or !define

Re: tiffany 0.6 released

2012-06-25 Thread Christian Tismer
Abour tiffany... On 6/25/12 3:46 AM, Christian Tismer wrote: Tiffany - Read/Write Multipage-Tiff with PIL without PIL Tiffany stands for any tiff. The tiny module solves a large set of problems, has no dependencies and just works wherever

Perl __DATA__ construct.

2012-06-25 Thread Mladen Gogala
I have a script in Perl that I need to rewrite to Python. The script contains __DATA__ at the end of the script, which enables Perl to access all the data after that through a file descriptor, like this: usage() if ( !$stat or !defined($home) or !defined($base) or !defined ($sid) ); while () {

Re: How can i call array_length to get the length of array object?

2012-06-25 Thread Terry Reedy
On 6/25/2012 8:54 AM, Mark Lawrence wrote: On 25/06/2012 02:17, Ben Finney wrote: Mark Lawrence writes: On 24/06/2012 09:15, gmspro wrote: Why __len__() where the original name if array_length? Why is method names like __NAME__ ? These are questions answered by getting a thorough groundin

Re: SSL handshake hanging, despite bugfix in stdlib

2012-06-25 Thread Terry Reedy
On 6/25/2012 8:34 AM, Michael Gundlach wrote: Hello again Terry (and mailing list), On Sun, Jun 24, 2012 at 9:34 AM, Michael Gundlach mailto:gundl...@gmail.com>> wrote: I've now changed to 2.7.3, and if I don't write back in the next few days, it means that that fixed the problem -- tha

Re: Getting lazy with decorators

2012-06-25 Thread Josh English
On Sunday, June 24, 2012 1:07:45 AM UTC-7, Peter Otten wrote: > > You cannot access a class instance because even the class itself doesn't > exist yet. You could get hold of the class namespace with sys._getframe(), > > def add_help(f): > exec """\ > def help_%s(self): > f = getattr(self

RE: vBulletin scraper -- feasible?

2012-06-25 Thread Nick Cash
You may want to look into http://www.crummy.com/software/BeautifulSoup/ It's made for parsing (potentially bad) HTML, and is quite easy to use. I'd say it's quite feasible. Thanks, Nick Cash NPC International -Original Message- From: python-list-bounces+nick.cash=npcinternational@pyt

Re: Executing Python Scripts on Mac using Python Launcher

2012-06-25 Thread Benjamin Kaplan
On Mon, Jun 25, 2012 at 11:19 AM, David Thomas wrote: > Hello, > This is my first post so go easy on me.  I am just beginning to program using > Python on Mac.  When I try to execute a file using Python Launcher my code > seems to cause an error in terminal, when I execute the exact same piece o

Re: Python and Facebook

2012-06-25 Thread CM
On Jun 24, 12:16 pm, Alec Taylor wrote: > This is the most active one, forked from the official facebook one > (when they used to maintain it > themselves):https://github.com/pythonforfacebook/facebook-sdk > > > > > > > > On Mon, Jun 25, 2012 at 1:35 AM, Chris Angelico wrote: > > On Mon, Jun 25,

vBulletin scraper -- feasible?

2012-06-25 Thread Andrew D'Angelo
Taking a look through vBulletin's HTML, I was wondering whether it would be overly difficult to parse it into nice, manipulatible data. I'd suppose my ultimate goal would be to dynamically parse a vBulletin and feed it into a locally hosted NNTP server. -- http://mail.python.org/mailman/listi

Executing Python Scripts on Mac using Python Launcher

2012-06-25 Thread David Thomas
Hello, This is my first post so go easy on me. I am just beginning to program using Python on Mac. When I try to execute a file using Python Launcher my code seems to cause an error in terminal, when I execute the exact same piece of code and run it in windows it seems to execute as exactly in

Re: How keep python socket alive for ever by setting Keep alive flag.

2012-06-25 Thread Dan Stromberg
http://www.unixguide.net/network/socketfaq/4.7.shtml It's better to add the ability to recreate a socket if it encounters trouble. SO_KEEPALIVE is there to help you detect if the other end of your connection has disappeared. Network programming has relatively few absolutes - it's best to build in

How keep python socket alive for ever by setting Keep alive flag.

2012-06-25 Thread hisan
Hi All, I want to open a socket connection and keep it alive for ever or until i explicitly close the socket connection. below is my code though i have set keep alive flag the socket gets closed after some time .please help me out here sb_sock = socket.socket(socket.AF_INET, socket

Re: exception problem

2012-06-25 Thread Chris Angelico
On Tue, Jun 26, 2012 at 1:14 AM, Charles Hixson wrote: > I read that that would happen, but "  print (sys.exc_info()[:2]) " didn't > even yield a blank line.  It must have executed, because the print statement > on the line before it executed, and there wasn't a loop or a jump (and also > executio

Re: exception problem

2012-06-25 Thread Charles Hixson
On 06/24/2012 11:23 PM, Andrew Berg wrote: On 6/25/2012 12:27 AM, Charles Hixson wrote: The documentation section covering the except statement could stand to be a *LOT* clearer. I read the sections on the except statement and exception handlers several times and couldn't figure out was th

Re: cPickle - sharing pickled objects between scripts and imports

2012-06-25 Thread Rotwang
On 24/06/2012 00:17, Steven D'Aprano wrote: On Sat, 23 Jun 2012 19:14:43 +0100, Rotwang wrote: The problem is that if the object was pickled by the module run as a script and then unpickled by the imported module, the unpickler looks in __main__ rather than mymodule for the object's class, and

Re: How can i call array_length to get the length of array object?

2012-06-25 Thread Antoon Pardon
On 06/24/12 10:48, Stefan Behnel wrote: > gmspro, 24.06.2012 10:01: > >> Why are some methods/functions named in this way in python? __len__ >> >> underscoreunderscoreNAMEunderscoreunderscore >> >> Is there any speciality of naming such methods? >> > Yes. Look up "special methods" in the do

Re: The Quran on Human Embryonic Development

2012-06-25 Thread Andrew D'Angelo
*Rimshot* wrote in message news:af4928a3-5613-48aa-96df-997b7a455...@googlegroups.com... > Well, I use wxFormBuilder for my embryonic GUIs, but I have no qualms (or > is that quorans) about changing the generated code to make it more > efficient. -- http://mail.python.org/mailman/listinfo/

Re: How can i call array_length to get the length of array object?

2012-06-25 Thread Mark Lawrence
On 25/06/2012 02:17, Ben Finney wrote: Mark Lawrence writes: On 24/06/2012 09:15, gmspro wrote: Why __len__() where the original name if array_length? Why is method names like __NAME__ ? These are questions answered by getting a thorough grounding in the fundamentals of Python. Please foll

Re: SSL handshake hanging, despite bugfix in stdlib

2012-06-25 Thread Michael Gundlach
Hello again Terry (and mailing list), On Sun, Jun 24, 2012 at 9:34 AM, Michael Gundlach wrote: > I've now changed to 2.7.3, and if I don't write back in the next few days, > it means that that fixed the problem -- thanks for your help! :) > The problem still exists in Python 2.7.3: File "/usr

Re: Py3.3 unicode literal and input()

2012-06-25 Thread Steven D'Aprano
On Mon, 25 Jun 2012 04:17:00 -0700, jmfauth wrote: > Mea culpa. I had not my head on my shoulders. Inputing if working fine, > it returns "text" correctly. > > However, and this is something different, I'm a little bit surprised, > input() does not handle escaped characters (\u, \U). No, it is n

Re: Py3.3 unicode literal and input()

2012-06-25 Thread Chris Angelico
On Mon, Jun 25, 2012 at 9:17 PM, jmfauth wrote: > Mea culpa. I had not my head on my shoulders. > Inputing if working fine, it returns "text" correctly. > > However, and this is something different, I'm a little > bit surprised, input() does not handle escaped characters > (\u, \U). > Workaround:

Re: Faster way to map numpy arrays

2012-06-25 Thread Oscar Benjamin
On 25 June 2012 08:24, Stefan Behnel wrote: > Saurabh Kabra, 25.06.2012 05:37: > > I have written a script to map a 2D numpy array(A) onto another array(B) > of > > different dimension. more than one element (of array A) are summed and > > mapped to each element of array B. To achieve this I cre

Re: Py3.3 unicode literal and input()

2012-06-25 Thread jmfauth
Mea culpa. I had not my head on my shoulders. Inputing if working fine, it returns "text" correctly. However, and this is something different, I'm a little bit surprised, input() does not handle escaped characters (\u, \U). Workaround: encode() and decode() as "raw-unicode-escape". jmf -- http:/

Re: Why has python3 been created as a seperate language where there is still python2.7 ?

2012-06-25 Thread Michiel Overtoom
On Jun 24, 2012, at 05:46, gmspro wrote: > Why has python3 been created as a seperate language where there is still > python2.7? It has not. Python2 and Python3 are very similar. It's not like if you learn Python using version 2, you have to relearn the language when you want to switch Python

Re: Why has python3 been created as a seperate language where there is still python2.7 ?

2012-06-25 Thread Andrew Berg
On 6/23/2012 10:46 PM, gmspro wrote: > What's wrong editing/customizing/changin python2.7 instead of making a > seperate language? py3k is not a separate language. In fact, it is possible to maintain a codebase that supports 2.2 (maybe even older), 3.3, and every version in between. > What's wrong

Re: Why has python3 been created as a seperate language where there is still python2.7 ?

2012-06-25 Thread Stefan Behnel
gmspro, 24.06.2012 05:46: > Why has python3 been created as a seperate language where there is still > python2.7 ? > > What's the benifit to make python3 over python2.7 ? I have read this though: > http://docs.python.org/release/3.0.1/whatsnew/3.0.html > > What's wrong editing/customizing/chang

Why has python3 been created as a seperate language where there is still python2.7 ?

2012-06-25 Thread gmspro
Hi, Why has python3 been created as a seperate language where there is still python2.7 ? What's the benifit to make python3 over python2.7 ? I have read this though: http://docs.python.org/release/3.0.1/whatsnew/3.0.html What's wrong editing/customizing/changin python2.7 instead of making a se

Python and Facebook

2012-06-25 Thread Jerry Rocteur
Hi, I've done a bit of searching on this but I can find nothing really up to date and a lot of conflicting information about using Python and Facebook. I'd like to automate some tasks in Facebook, for example I'd like to connect to a group I'm admin of and take a copy of all photos, a list of all

Re: exception problem

2012-06-25 Thread Chris Angelico
On Mon, Jun 25, 2012 at 5:49 PM, Steven D'Aprano wrote: > On Mon, 25 Jun 2012 09:51:15 +1000, Chris Angelico wrote: > >> Mind you, I think every programmer should spend some time debugging >> blind. > > You're a cruel, cruel man. > > I suppose next you're going to say that every programmer should

Re: exception problem

2012-06-25 Thread Steven D'Aprano
On Mon, 25 Jun 2012 09:51:15 +1000, Chris Angelico wrote: > Mind you, I think every programmer should spend some time debugging > blind. You're a cruel, cruel man. I suppose next you're going to say that every programmer should spend some time programming using Notepad as their only editor.

Re: exception problem

2012-06-25 Thread Steven D'Aprano
On Sun, 24 Jun 2012 16:16:25 -0700, Charles Hixson wrote: > But what I wanted was to catch any exception. Be careful of what you ask for, since you might get it. "Catch any exception" is almost certainly the wrong thing to do, almost always. The one good reason I've seen for a bare except is to

Re: exception problem

2012-06-25 Thread Steven D'Aprano
On Sun, 24 Jun 2012 18:45:45 -0400, Dave Angel wrote: > Bare exceptions are the bane of > programming; Using it is like trying to learn to drive while > blindfolded. +1 QOTW I really wish bare exceptions were removed from Python 3. There's no point to try...except any longer, and it's just an

Re: Faster way to map numpy arrays

2012-06-25 Thread Stefan Behnel
Saurabh Kabra, 25.06.2012 05:37: > I have written a script to map a 2D numpy array(A) onto another array(B) of > different dimension. more than one element (of array A) are summed and > mapped to each element of array B. To achieve this I create a list where I > store the index of array A to be ma