Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Python 2.x and 3.x usage survey

213 views
Skip to first unread message

Dan Stromberg

unread,
Dec 30, 2013, 9:56:30 PM12/30/13
to Python List
I keep hearing naysayers, nay saying about Python 3.x.

Here's a 9 question, multiple choice survey I put together about
Python 2.x use vs Python 3.x use.

I'd be very pleased if you could take 5 or 10 minutes to fill it out.

Here's the URL:
https://www.surveymonkey.com/s/N5N5PG2

Andrew Berg

unread,
Dec 30, 2013, 10:14:53 PM12/30/13
to pytho...@python.org
It was closer to 5 or 10 seconds. :)

--
CPython 3.3.3 | Windows NT 6.2.9200 / FreeBSD 10.0

Chris Angelico

unread,
Dec 30, 2013, 11:43:09 PM12/30/13
to Python List
On Tue, Dec 31, 2013 at 8:56 AM, Dan Stromberg <drsa...@gmail.com> wrote:
> I keep hearing naysayers, nay saying about Python 3.x.
>
> Here's a 9 question, multiple choice survey I put together about
> Python 2.x use vs Python 3.x use.
>
> I'd be very pleased if you could take 5 or 10 minutes to fill it out.
>
> Here's the URL:
> https://www.surveymonkey.com/s/N5N5PG2

Will be interested to see the stats at the end of that survey! Though
of course posting to this list does give some inherent bias. But I
suspect the stats will show a large proportion of people are
comfortable on Py3.

ChrisA
Message has been deleted

Cameron Simpson

unread,
Dec 31, 2013, 2:59:03 AM12/31/13
to pytho...@python.org
On 30Dec2013 19:16, Dennis Lee Bieber <wlf...@ix.netcom.com> wrote:
> On Mon, 30 Dec 2013 16:14:53 -0600, Andrew Berg <robots...@gmail.com>
> declaimed the following:
>
> >On 2013.12.30 15:56, Dan Stromberg wrote:
> >> I keep hearing naysayers, nay saying about Python 3.x.
> >>
> >> Here's a 9 question, multiple choice survey I put together about
> >> Python 2.x use vs Python 3.x use.
> >>
> >> I'd be very pleased if you could take 5 or 10 minutes to fill it out.
> >>
> >> Here's the URL:
> >> https://www.surveymonkey.com/s/N5N5PG2
> >>
> >It was closer to 5 or 10 seconds. :)
>
> If that much...
>
> Too many questions require a positive response to a previous question
> (for example, if one has not written Python 3.x, one is also unlikely to
> have used any of the porting tools).

How complex do you want it to be? One can post filter the results
for relevance I suppose.

My only gripe is the "do you write more code for 2.x or 3.x" question;
I do in fact write more python 2 (I suppose), but since I'm striving
to make my codebase portable between 2 and 3 the question is a poor
fit. There is at least the "do you write code to run on both?" later.

Cheers,
--
Cameron Simpson <c...@zip.com.au>

SPSS. Big honkin' stats package. Comes with a good manual.
- Dan Hillman <dca...@cus.cam.ac.uk>

Mark Lawrence

unread,
Dec 31, 2013, 8:54:02 AM12/31/13
to pytho...@python.org
On 30/12/2013 21:56, Dan Stromberg wrote:
> I keep hearing naysayers, nay saying about Python 3.x.
>
> Here's a 9 question, multiple choice survey I put together about
> Python 2.x use vs Python 3.x use.
>
> I'd be very pleased if you could take 5 or 10 minutes to fill it out.
>
> Here's the URL:
> https://www.surveymonkey.com/s/N5N5PG2
>

People using 1.x will be miffed as their baby has been missed out :)

--
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence

Steven D'Aprano

unread,
Dec 31, 2013, 10:08:01 AM12/31/13
to
Mark Lawrence wrote:

> On 30/12/2013 21:56, Dan Stromberg wrote:
>> I keep hearing naysayers, nay saying about Python 3.x.
>>
>> Here's a 9 question, multiple choice survey I put together about
>> Python 2.x use vs Python 3.x use.
>>
>> I'd be very pleased if you could take 5 or 10 minutes to fill it out.
>>
>> Here's the URL:
>> https://www.surveymonkey.com/s/N5N5PG2
>>
>
> People using 1.x will be miffed as their baby has been missed out :)

You laugh, but there was at least one attendee at the last PyCon who was
still using 1.5 professionally. Software never quite dies so long as there
is hardware capable of running it.


--
Steven

Roy Smith

unread,
Dec 31, 2013, 3:18:47 PM12/31/13
to
In article <52c29782$0$29979$c3e8da3$5496...@news.astraweb.com>,
Oh, that's absurd. He should have at least upgraded to 1.6.

Steve Hayes

unread,
Jan 1, 2014, 10:41:44 AM1/1/14
to
On Mon, 30 Dec 2013 13:56:30 -0800, Dan Stromberg <drsa...@gmail.com> wrote:

>I keep hearing naysayers, nay saying about Python 3.x.
>
>Here's a 9 question, multiple choice survey I put together about
>Python 2.x use vs Python 3.x use.
>
>I'd be very pleased if you could take 5 or 10 minutes to fill it out.

I had a look at it, but I've got about as far as "Hello World" in both.

I borrowed a book called "Learning Python" by Lutz and Asher, which is geared
for 2.2/2.3.

But the version I have in Windows is 3.2, and it seems that even "Hello World"
presents and insurmountable problem.

Eventually I discovered that one of the differences bytween 2.x and 3.x is
that the former has "print" and the latter has "print()" but weven using that
it tells me it cant find the PRN device or something.

I've got 2.x on Linux, so I booted into that and it seemed to work there, but
it seems that the differences between the versions are not trivial.

So perhaps I should just try to install 2.x in Windows, and learn that.


--
Steve Hayes from Tshwane, South Africa
Web: http://www.khanya.org.za/stevesig.htm
Blog: http://khanya.wordpress.com
E-mail - see web page, or parse: shayes at dunelm full stop org full stop uk

Chris Angelico

unread,
Jan 1, 2014, 10:52:56 AM1/1/14
to pytho...@python.org
On Wed, Jan 1, 2014 at 9:41 PM, Steve Hayes <haye...@telkomsa.net> wrote:
> I borrowed a book called "Learning Python" by Lutz and Asher, which is geared
> for 2.2/2.3.

That's really REALLY old. Even Red Hat isn't still supporting 2.2. You
can quite easily get started on 3.2 on Windows - though I would
recommend grabbing 3.3 and using that - just start with this tutorial:

http://docs.python.org/3/tutorial/

I don't know exactly what will be different in 2.2, but there's no
point learning a version that old. If nothing else, you'll miss out on
a lot of neat features.

ChrisA

Steven D'Aprano

unread,
Jan 1, 2014, 11:37:45 AM1/1/14
to
Steve Hayes wrote:

> I borrowed a book called "Learning Python" by Lutz and Asher, which is
> geared for 2.2/2.3.
>
> But the version I have in Windows is 3.2, and it seems that even "Hello
> World" presents and insurmountable problem.

It certainly is not *insurmountable*. Not unless you consider typing
brackets ( ) to be an inhumanly difficult task, in which case you might as
well give up on being a programmer and take up something easier like brain
surgery.

# Python 2 version
print "Hello World!"

# Python 3 version
print("Hello World!")



> Eventually I discovered that one of the differences bytween 2.x and 3.x is
> that the former has "print" and the latter has "print()" but weven using
> that it tells me it cant find the PRN device or something.

Possibly you're trying to run print("Hello World") at the DOS command prompt
rather than using Python. I'm not sure exactly what you're doing, but I do
know that you shouldn't get any errors about the PRN device from Python.
That sounds like it is a Windows error.


> I've got 2.x on Linux, so I booted into that and it seemed to work there,
> but it seems that the differences between the versions are not trivial.

For the most part, they are trivial. With only a few exceptions, everything
in Python 2 can be easily, even mechanically, translated to Python 3.

Python 3 includes a lot of new features that a Python 2.3 book won't even
mention. But if course, since the book doesn't mention them, you won't need
to deal with them. It also includes a few changes from statements to
functions, like print and exec (but as a beginner, you shouldn't be using
exec). A few modules have been renamed. In my personal opinion, the most
annoying change from Python 2 to 3 is renaming modules, because I can never
remember the new name.

None of these are *difficult* changes. As a beginner, of course, you cannot
be expected to automatically know how to deal with a problem like this one:

py> from StringIO import StringIO
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named 'StringIO'


But let me give you a secret known only to a few: to solve this problem is
not hard. Just google for "StringIO renamed Python 3". which will take you
to the "What's New in Python 3" document, which reveals that the StringIO
module is renamed to io.StringIO, and so you should use this instead:

from io import StringIO


https://duckduckgo.com/?q=StringIO%20renamed%20Python%203


If googling fails, feel free to ask here!


--
Steven

Steve Hayes

unread,
Jan 1, 2014, 12:38:59 PM1/1/14
to
On Wed, 01 Jan 2014 22:37:45 +1100, Steven D'Aprano
<steve+comp....@pearwood.info> wrote:

>Steve Hayes wrote:
>
>> I borrowed a book called "Learning Python" by Lutz and Asher, which is
>> geared for 2.2/2.3.
>>
>> But the version I have in Windows is 3.2, and it seems that even "Hello
>> World" presents and insurmountable problem.
>
>It certainly is not *insurmountable*. Not unless you consider typing
>brackets ( ) to be an inhumanly difficult task, in which case you might as
>well give up on being a programmer and take up something easier like brain
>surgery.
>
># Python 2 version
>print "Hello World!"
>
># Python 3 version
>print("Hello World!")

I was thinking or of this:

>>> python g:\work\module1.py
File "<stdin>", line 1
python g:\work\module1.py
^

Which gave a different error the previous time I did it.

But, hey, it worked from the DOS prompt

C:\Python32>python g:\work\module1.py
Hello Module World

But hey, don't mind me.

The biggest problem I have is that when something doesn't work, I don't know
if I have done something stupid, or if it's just an incompatibility of the
different versions.

Chris Angelico

unread,
Jan 1, 2014, 12:39:57 PM1/1/14
to pytho...@python.org
On Wed, Jan 1, 2014 at 11:38 PM, Steve Hayes <haye...@telkomsa.net> wrote:
> I was thinking or of this:
>
>>>> python g:\work\module1.py
> File "<stdin>", line 1
> python g:\work\module1.py
> ^
>
> Which gave a different error the previous time I did it.
>
> But, hey, it worked from the DOS prompt
>
> C:\Python32>python g:\work\module1.py
> Hello Module World

That's how you invoke a script. Python isn't fundamentally a shell
scripting language (like bash, REXX, batch, etc), so there's a
distinct difference between Python commands (which go into .py files
or are executed at the ">>>" prompt) and shell commands (including
"python", which invokes the Python interpreter).

> The biggest problem I have is that when something doesn't work, I don't know
> if I have done something stupid, or if it's just an incompatibility of the
> different versions.

Easiest way to eliminate the confusion is to match your tutorial and
your interpreter. That's why I recommend going with the python.org
tutorial; you can drop down the little box in the top left and choose
the exact version of Python that you're running. It WILL match.

ChrisA

Mark Lawrence

unread,
Jan 1, 2014, 12:44:42 PM1/1/14
to pytho...@python.org
Almost inevitably if you search for the last line of the error that you
get you'll find more than enough hits to point you in the right
direction. Failing that ask here as we don't bite. There's also the
tutor mailing list https://mail.python.org/mailman/listinfo/tutor

David

unread,
Jan 1, 2014, 2:07:54 PM1/1/14
to pytho...@python.org
On 1 January 2014 23:38, Steve Hayes <haye...@telkomsa.net> wrote:
>
> I was thinking or of this:
>
>>>> python g:\work\module1.py
> File "<stdin>", line 1
> python g:\work\module1.py
> ^
>
> Which gave a different error the previous time I did it.
>
> But, hey, it worked from the DOS prompt
>
> C:\Python32>python g:\work\module1.py
> Hello Module World

Your windows command shell prompt looks like this: "C:\Python32>"
It indicates that windows shell is waiting for you to type something.
It expects the first word you type to be an executable command. If you
do this:
C:\Python32>python g:\work\module1.py
it tells the shell to run the python interpreter and feed it all the
python statments contained in the file g:\work\module1.py

If you do this:
C:\Python32>python
it tells the shell to run the python interpreter interactively, and
wait for you to directly type python statements. When the python
intepreter is ready for you to type a python statement, it gives you a
">>>" prompt. It expects you to type a valid python language
statement.

The reason this gave an error:
>>> python g:\work\module1.py

is because you are using the python interpreter as shown by ">>>", but
you typed a windows shell command, not a python statement.

Dave Angel

unread,
Jan 1, 2014, 2:32:37 PM1/1/14
to pytho...@python.org
On Wed, 01 Jan 2014 14:38:59 +0200, Steve Hayes
<haye...@telkomsa.net> wrote:
> >>> python g:\work\module1.py
> File "<stdin>", line 1
> python g:\work\module1.py
> ^


> Which gave a different error the previous time I did it.


> But, hey, it worked from the DOS prompt


> C:\Python32>python g:\work\module1.py
> Hello Module World

You need to understand that you are using two VERY different
languages, one at the DOS prompt, the other at the python prompt
and in .py files. You cannot use shell syntax at the python prompt,
any more than you can do the reverse.

--
DaveA

Steve Hayes

unread,
Jan 1, 2014, 5:55:23 PM1/1/14
to
Thank you. Back to the book!
Message has been deleted

Grant Edwards

unread,
Jan 2, 2014, 4:55:01 PM1/2/14
to
ITYM: ... so long as there is hardware capable of running an emulator
that is capable of running it.

--
Grant Edwards grant.b.edwards Yow! I don't understand
at the HUMOUR of the THREE
gmail.com STOOGES!!

emile

unread,
Jan 3, 2014, 5:33:48 PM1/3/14
to pytho...@python.org
On 01/02/2014 08:55 AM, Grant Edwards wrote:
> On 2013-12-31, Steven D'Aprano <steve+comp....@pearwood.info> wrote:

>> You laugh, but there was at least one attendee at the last PyCon who was
>> still using 1.5 professionally. Software never quite dies so long as there
>> is hardware capable of running it.
>
> ITYM: ... so long as there is hardware capable of running an emulator
> that is capable of running it.
>

...or as long as there's business value in keeping it running. As I
recall it took the banking industry decades to move things forward. I
still maintain software for customers that I originally wrote 35 years
ago. Rule one is don't fix it if it ain't broke, so yes, I've got
python projects deployed that run under everything from 1.5.2 on.

Fortunately, they all work without issue so maintenance isn't a problem.

Emile


John Ladasky

unread,
Jan 10, 2014, 5:36:36 PM1/10/14
to
I responded to the survey about a week ago. Dan, I hope you will share the results with us soon. I also tried to reply to this thread, but I lost the ability to post to newsgroups for about a week. It seems to have been restored, so I will try again.

My transition from Py2 to Py3 is implicitly documented in several posts here on comp.lang.python. I switched over to Py3 about a year ago, and I'm not looking back. I couldn't move to Py3 until numpy and matplotlib were ported. But once that was done, the advantages outweighed the costs, and I switched.

Changing over has not been painless. I'm doing without wxPython for now, my favorite GUI. I know that Phoenix is coming to take wxPython's place. Meanwhile, I'm willing to be sold on any other Linux- and Py3-compatible GUI -- besides TKinter, that is.

I also miss psyco. I had a lot of Py2 code which made very little use of dynamic typing. Psyco accelerated it nicely. I believe that that a lot of my Py3 code would also benefit from JIT compilation.

Finally, I have encountered some small mental hurdles concerning Unicode. I am teaching a Silicon Valley test engineer Python on the side. His task is to implement an automated device testing suite over a telnet connection. We have to remember to convert between the remote device's expectation of strings of bytes, and Python's expectation of strings of Unicode characters. When we forget, there can be bugs. I'm sure that I'll get used to it eventually.

Ned Batchelder

unread,
Jan 10, 2014, 5:48:43 PM1/10/14
to pytho...@python.org
On Python-Dev, Dan Stromberg posted this link with the results:

http://stromberg.dnsalias.org/~strombrg/python-2.x-vs-3.x-survey/


--
Ned Batchelder, http://nedbatchelder.com

Ethan Furman

unread,
Jan 10, 2014, 6:02:26 PM1/10/14
to pytho...@python.org
On 01/10/2014 09:36 AM, John Ladasky wrote:
>
> We have to remember to convert between the remote device's
> expectation of strings of bytes, and Python's expectation of
> strings of Unicode characters. When we forget, there can be
> bugs. I'm sure that I'll get used to it eventually.

A useful data point for why you don't just use bytes on the Python side would be valuable for the discussions currently
taking place on PyDev.

--
~Ethan~

John Ladasky

unread,
Jan 10, 2014, 7:43:31 PM1/10/14
to
On Friday, January 10, 2014 9:48:43 AM UTC-8, Ned Batchelder wrote:

> On Python-Dev, Dan Stromberg posted this link with the results:
>
> http://stromberg.dnsalias.org/~strombrg/python-2.x-vs-3.x-survey/

That link gave me a 404. :^(

MRAB

unread,
Jan 10, 2014, 7:53:30 PM1/10/14
to pytho...@python.org, pytho...@python.org

Ned Batchelder

unread,
Jan 10, 2014, 7:50:02 PM1/10/14
to pytho...@python.org
Sorry, it worked when I read it when first posted. They've been put on
the Python wiki: https://wiki.python.org/moin/2.x-vs-3.x-survey
0 new messages