f



Python 2.x and 3.x usage survey

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
0
Dan
12/30/2013 9:56:30 PM
comp.lang.python 77058 articles. 6 followers. Post Follow

16 Replies
11109 Views

Similar Articles

[PageSpeed] 8

On Mon, 30 Dec 2013 13:56:30 -0800, Dan Stromberg <drsalists@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
0
Steve
1/1/2014 10:41:44 AM
On Wed, Jan 1, 2014 at 9:41 PM, Steve Hayes <hayesstw@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
0
Chris
1/1/2014 10:52:56 AM
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

0
Steven
1/1/2014 11:37:45 AM
On Wed, 01 Jan 2014 22:37:45 +1100, Steven D'Aprano
<steve+comp.lang.python@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. 



-- 
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
0
Steve
1/1/2014 12:38:59 PM
On Wed, Jan 1, 2014 at 11:38 PM, Steve Hayes <hayesstw@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
0
Chris
1/1/2014 12:39:57 PM
On 01/01/2014 12:38, Steve Hayes wrote:
> On Wed, 01 Jan 2014 22:37:45 +1100, Steven D'Aprano
> <steve+comp.lang.python@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.
>

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

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

Mark Lawrence

0
Mark
1/1/2014 12:44:42 PM
On 1 January 2014 23:38, Steve Hayes <hayesstw@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.
0
David
1/1/2014 2:07:54 PM
On Wed, 01 Jan 2014 14:38:59 +0200, Steve Hayes 
<hayesstw@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

0
Dave
1/1/2014 2:32:37 PM
On Wed, 01 Jan 2014 12:41:44 +0200, Steve Hayes <hayesstw@telkomsa.net>
declaimed the following:

>
>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. 

	Off hand I suspect you didn't follow the same process on Linux as you
did on Windows.

	But as you didn't cut&paste the exact code and invocation/error message
we have to guess.

-=-=-=-=-
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\Users\Wulfraed\Documents>print("hello lunar")
Unable to initialize device PRN

C:\Users\Wulfraed\Documents>print "hello moon"
Unable to initialize device PRN

C:\Users\Wulfraed\Documents>python
ActivePython 2.7.2.5 (ActiveState Software Inc.) based on
Python 2.7.2 (default, Jun 24 2011, 12:22:14) [MSC v.1500 64 bit (AMD64)]
on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> print("hello lunar")
hello lunar
>>> print "hello moon"
hello moon
>>> ^Z

C:\Users\Wulfraed\Documents>


-=-=-=-=-
-- 
	Wulfraed                 Dennis Lee Bieber         AF6VN
    wlfraed@ix.netcom.com    HTTP://wlfraed.home.netcom.com/

0
Dennis
1/1/2014 5:54:56 PM
On Thu, 2 Jan 2014 01:07:54 +1100, David <bouncingcats@gmail.com> wrote:

>On 1 January 2014 23:38, Steve Hayes <hayesstw@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.

Thank you. Back to the book!


-- 
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
0
Steve
1/1/2014 5:55:23 PM
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 th=
e ability to post to newsgroups for about a week.  It seems to have been re=
stored, so I will try again.

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

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

I also miss psyco.  I had a lot of Py2 code which made very little use of d=
ynamic 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 character=
s.  When we forget, there can be bugs.  I'm sure that I'll get used to it e=
ventually.
0
John
1/10/2014 5:36:36 PM
On 1/10/14 12:36 PM, John Ladasky wrote:
> 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.
>

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

0
Ned
1/10/2014 5:48:43 PM
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~
0
Ethan
1/10/2014 6:02:26 PM
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.  :^(
0
John
1/10/2014 7:43:31 PM
On 1/10/14 2:43 PM, John Ladasky wrote:
> 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.  :^(
>

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

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

0
Ned
1/10/2014 7:50:02 PM
On 2014-01-10 19:43, John Ladasky wrote:
> 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.  :^(
>
It's available here:

https://wiki.python.org/moin/2.x-vs-3.x-survey?action=AttachFile&do=view&target=2013-2014+Python+2.x-3.x+survey.pdf

0
MRAB
1/10/2014 7:53:30 PM
Reply:

Similar Artilces:

x^2-x-x^3 -> -(x^3-x^2+x) #2
The CAS "simplifies" x^2-x-x^3 to -(x^3-x^2+x) (flag -114 clear). Is there a way to set it to simplify this to -x^3+x^2-x ? John Pressman wrote: > The CAS "simplifies" x^2-x-x^3 to -(x^3-x^2+x) (flag -114 clear). Is > there a way to set it to simplify this to -x^3+x^2-x ? FDISTRIB Regards, -- Beto Reply: Erase between the dot (inclusive) and the @. Responder: Borra la frase obvia y el punto previo. ...

doctests working both in Python 2.X and Python 3.X
I do not want to write two documentations for a module working both in Python 2.X and Python 3.X. To avoid that, I would need the ability to interpret doctests according to the used Python version. I mean something like that: """ Documentation of the module <mymodule> ----------------------------------------------------------------- If you are using Python 2.X you can check that >>> <2.X code> # doctest: <some directive for 2.X> <2.X output> whereas if you are using Python 2.X you can check that >>> <3.X ...

x^2-x-x^3 -> -(x^3-x^2+x)
The CAS "simplifies" x^2-x-x^3 to -(x^3-x^2+x) (114 clear). Is there a way to set it to simplify this to -x^3+x^2-x ? In article <2cdd7b99.0312120050.4f899916@posting.google.com>, voldermort@hotmail.com (John Pressman) wrote: > The CAS "simplifies" x^2-x-x^3 to -(x^3-x^2+x) (114 clear). Is there a > way to set it to simplify this to -x^3+x^2-x ? On the hp49/HP49+ use FDISTRIB. ...

how to "(1-3*x^2)/(1-3*x+x^2+2*x^3) => 1/(1-2*x) + x/(1-x-x^2)"?
hi normal(1/(1-2*x) + x/ (1-x-x^2),expanded); 1/(1-2*x) + x/(1-x-x^2) => (1-3*x^2)/(1-3*x+x^2+2*x^3) how to do the reverse? dillogimp@gmail.com writes: > normal(1/(1-2*x) + x/ (1-x-x^2),expanded); > 1/(1-2*x) + x/(1-x-x^2) => (1-3*x^2)/(1-3*x+x^2+2*x^3) > how to do the reverse? convert(%,parfrac,x); -- Joe Riel ...

Python 2.x vs 3.x survey
The results of the survey are at: https://wiki.python.org/moin/2.x-vs-3.x-survey ...

The Nikola project is deprecating Python 2.7 (+2.x/3.x user survey results)
The Nikola developers decided to deprecate Python 2.7 support. Starting with v7.7.2, Nikola will display a warning if Python 2.7 is used (but it will still be fully supported). In early 2016, Nikola v8.0.0 will come out, and that release will not support Python 2.7 officially. The decision was made on the basis of a user survey, with 138 participants. The vast majority of them claimed that they either use Python 3 already, or can switch really easily. The main reason for the switch was the fact that supporting both requires a lot of extra effort, especially because Python 2.7=E2=80=...

Python 2.x and 3.x use survey, 2014 edition
--001a11c1331ec5000e0509df9604 Content-Type: text/plain; charset=UTF-8 Hi all, Last year a survey was conducted on python 2 and 3 usage. Here is the 2014 edition, slightly updated (from 9 to 11 questions). It should not take you more than 1 minute to fill. I would be pleased if you took that time. Here's the url: http://goo.gl/forms/tDTcm8UzB3 I'll publish the results around the end of the year. Last year results: https://wiki.python.org/moin/2.x-vs-3.x-survey Thank you Bruno --001a11c1331ec5000e0509df9604 Content-Type: text/html; charset=UTF-8 Content-Transfer-...

Python 2.x vs 3.x survey
Last year in late December, I did a brief, 9 question survey of 2.x vs 3.x usage. I like the think the results were interesting, but I don't have the spare cash to do it again this year. I probably shouldn't have done it last year. ^_^ Is anyone interested in taking over the survey? It's on SurveyMonkey. It was mentioned last year, that it might be interesting to see how things change, year to year. It was also reported that some people felt that late December wasn't necessarily the best time of year to do the survey, as a lot of people were on vacation. T...

Results of the python 2.x and 3.x use survey, 2014 edition
Hi! Finally, here are the results: http://blog.frite-camembert.net/python-survey-2014.html Here is the auto-generated Google Forms recap: https://docs.google.com/forms/d/1DqxkNi4GvyTCu54usSdE1DjW29zw1tc52iMeH3z4heg/viewanalytics (more elegant than my matplotlib graphs - I'd have no future as a designer). Overall people started writing more python 3: +15 points in "I ever wrote python 3 code", +10 points in "I write more python 3 than 2". Transition is still ongoing and I hope a tipping point will be soon be attained. Users definitely seem to want to switch ...

x^(3/2)+x^(5/2) = (x+x^2)*x^(1/2)
Is there a simple way to get Maple to convert x^(3/2) + x^(5/2) to (x+x^2)*x^(1/2). I am willing to assume(x>0). Maple does recognize these as being equal: > p:=x^(3/2)+x^(5/2): > q:=(x+x^2)*sqrt(x): > simplify(p-q); 0 Here's a clumsy way to do it: > p:=x^(3/2)+x^(5/2): > assume(t>0): > subs(x=t^2,p); > simplify(%,{t^2=x}); > collect(%,t); Is there something simpler? (This has undoubtedly come up before, but I cannot find it anywhere.) --Edwin If you do not insist upon your incomplete factoriz...

how to convert union(2*x+y=3,3*x+2*y=5) to {2*x+y=3,3*x+2*y=5}
Thanks! In article <1140494713.980133.168190@f14g2000cwb.googlegroups.com>, loric <dr.huiliu@gmail.com> wrote: >Thanks! It isn't clear exactly what your question is, but: > `union`({2*x+y=3},{3*x+2*y=5}); {2 x + y = 3, 3 x + 2 y = 5} > Union := proc() { seq( `if`(s::'set',op(s),s), s=args ) } end proc: > Union(2*x+y=3,3*x+2*y=5); {2 x + y = 3, 3 x + 2 y = 5} > Union(2*x+y=3,{3*x+2*y=5}); {2 x + y = 3, 3 x + 2 y = 5} ...

HoldForm[1*2*3] should give 1 x 2 x 3 not 2 x 3
HoldForm[] is loosing the 1* when it apparently should not: In[1]:= HoldForm[1*2*3] Out[1]= 2 x 3 In[2]:= HoldForm[1*1*1] Out[2]= 1 x 1 x 1 In[3]:= HoldForm[3*2*1] Out[3]= 3 x 2 In[4]:= HoldForm[2*2*2] Out[4]= 2 x 2 x 2 In[5]:= HoldForm[2*1*3] Out[5]= 2 x 3 In[6]:= HoldForm[1*2] Out[6]= 1 x 2 In[7]:= HoldForm[1*2*1] Out[7]= 1 x 2 x 1 Q.E.D. Indeed, the same happens with Hold and HoldComplete. I'd say this is a bug. Cheers -- Sjoerd On Feb 25, 11:07 am, "Q.E.D." <a...@netzero.net> wrote: > HoldForm[] is loosing the 1* when it...

python 2.x and python 3 relative imports and
Hi, let say I have a legacy code with the following structure: pkg1/__init__.py pkg1/pkg2/__init__.py pkg1/pkg2/bar.py pkg1/pkg2/pkg3/__init__.py pkg1/pkg2/pkg3/foo.py In pkg1/pkg2/bar.py I have: # pkg1/pkg2/bar.py import pkg3.foo class Bar(pkg3.foo): pass in pkg1/pkg2/pkg3/foo.py: # pkg1/pkg2/pkg3/foo.py class Foo: pass Now I want to adapt bar.py such that it works in Python 3, but without modi= fying the definition of Bar class (I wan't restrict modification to import = directives). My first thought was that I to just modify the import directiv= ...

Supporting Python 2.x and 3.x on a PC
I support multiple projects, some of which will remain on Python 2.x and some of which want to use Python 3.1.2. While I have installed both on my Windows PC, only the last installed version can be used. I do not have admin rights on the machine, so altering registry settings is not an option. Any guidance on how I can select between the versions? Thanks This is a multi-part message in MIME format. --------------060604080504080804050209 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Am 12.11.2010 20:05, schrieb Doug Stell: > I su...

Coexistence of Python 2.x and 3.x on same OS
Has there been any official software that allows both the Python 2.x and 3.x releases to coexist on the same OS so that the end-user can easily switch between them when invoking Python scripts after each has been installed to their own directories/folders ? I know of some unoffical solutions, but they require lots of tweaks. Given the vagaries of the different OSs on which Python can run I am hoping for some offical solution which will work on any of the most popular OSs ( Windows, Linux, Mac ). The situation is so confusing on Windows, where the file associations, registry...

suppose I have an equation x^2+x+y^2+3*y=5*y^2+3*y+3*x*y+5 and I want to find the set of (x,y) that satisfy the equation.
Question How can i do that? I've been trying, solve, explot and subs. I can get the graph, but i cannot get the (x,y) pairs that I want. When I use function solve to solve the equation in term of x or y and then substitute the numeric value for one of them to find the other, I got the problem about complex numer. This might be because that numeric value that I substitute is not the number that satisfy the equation, so the program give me the result in complex number. Background. I need to use the pairs to find the optimal value of my objective function. I tried to use the fminco...

Python 2.X vs. 3.X
Hi! I've been using Python for a long while (certainly since it was 1.X), and I've taught some aspects of it in my lectures. I'm now thinking of preparing a new lecture where some of the theoretical concepts will be illustrated by implementations of e.g. automata and DPLL provers, preferably in Python. I'm so far only familiar with Python 2.X. Is Python 3 sucessful enough to make a switch worthwhile now? Or will students still face an infrastructure with mostly Python 2.X deployed in, say, 2 years time, when they graduate? Bye, Stephan -- -----------...

3.x and 2.x on same machine (is this info at Python.org??)
Hello, Currently i am using 2.6 on Windows and need to start writing code in 3.0. I cannot leave 2.x yet because 3rd party modules are still not converted. So i want to install 3.0 without disturbing my current Python2.x. What i'm afraid of is that some SYSVARIABLE will get changed to Python3.0 and when i double click a Python script it will try and run Python 3.x instead of 2.x. I only want to run 3.0 scripts from the command line... > python3.x myscript.py So how do i do this? Is my fear unfounded? Thanks On Thu, Nov 12, 2009 at 2:52 PM, rantingrick <rantingrick@gmail.com> w...

Bind C++ program for use with both Python 2.x and 3.x
Hello, I am looking at the possibility of making a program in C++. The catch is it will require the ability to work with binding for use with scripting in both Python 2.x and 3.x for various tool plugins. Is there any way to bind a C++ app to work with both Python 2.x and 3.x using the Python C API? Note if I could I'd just do Python 3, however I need Python 2 support to allow for the use of this application as a plugin in apps that use Python 2 as well. Am 11.12.2010 23:41, schrieb Peter C.: > Hello, I am looking at the possibility of making a program in C++. The > catch i...

lockfile 0.6 supports Python 2.x and 3.x
I've just released lockfile 0.6. This version supports Python 2.4, 2.5, 2.6 and 3.0. It also expands the unit tests a bit. What is lockfile? The lockfile module exports a FileLock class which provides a simple API for locking files. Unlike the Windows msvcrt.locking function, the Unix fcntl.flock, fcntl.lockf and the deprecated posixfile module, the API is identical across both Unix (including Linux and Mac) and Windows platforms. The lock mechanism relies on the atomic nature of the link (on Unix) and mkdir (On Windows) system calls. Where can ...

3*x''+(10^-3)*x'+123*x=2*cos(3*t); x=x(t);initial conditions x(0)=0 and x'(0)=0
Hi everybody, I need to solve the Cauchy problem written in the title box ( I paste it here again ): 3*x''+(10^-3)*x'+123*x=2*cos(3*t); x=x(t);initial conditions x(0)=0 and x'(0)=0. I tried with Runge-Kutta method and it seems to work as the solution x(t) is the same that I can get solving the equation by myself. I need to know if it would be better another method (eventually multistep one) and why it would be better (please don't just tell me 'cause it's faster or so...I need to know the why too). As last thing I need to estimate the error committed with Runge...

Slove 0 = a(1) + a(2)*x + a(3)*x^2 + a(4)*x^3 +...?
Hi all, My problem is very easy. But I don't know quite MatLab to know if there is a function to solve that: 0 = a(1) + a(2)*x + a(3)*x^2 + a(4)*x^3 +...? "a" is vector known. Thank you for your help Fabien. Look at the "roots" function. "Fabien Blarel" <eezfb@gwmail.nottingham.ac.uk> wrote in message news:eec6364.-1@WebX.raydaftYaTP... > Hi all, > > > My problem is very easy. But I don't know quite MatLab to know if > there is a function to solve that: > > > 0 = a(1) + a(2)*x + a(3)*x^2 + a(4)*x^3...

Help with changes in traceback stack from Python 2.7 to Python 3.x
--Boundary_(ID_zsizNzSjxaSbvchkOcVtew) Content-type: text/plain; charset=utf-8; format=flowed Content-transfer-encoding: quoted-printable I wrote the following code that works in Python 2.7 that takes the variabl= es passed to the function into a dictionary. The following call: strA =3D 'a' intA =3D 1 dctA =3D makeDict(strA, intA) produces the following dictionary: {'strA':'a', 'intA':1} To access the names passed into the function, I had to find the informatio= n by parsing through the stack. The code that used to w...

Will MySQLdb, the Python shim, be supported for Python 2.6 or 3.x?
MySQLdb, the Python shim for MySQL, still supports Python only to Python 2.5. See "http://sourceforge.net/projects/mysql-python". Are there any plans to support Python 2.6 or 3.x? John Nagle John Nagle wrote: > =A0 =A0 =A0MySQLdb, the Python shim for MySQL, still supports Python only= to > Python 2.5. =A0See "http://sourceforge.net/projects/mysql-python". =A0Are= there > any plans to support Python 2.6 or 3.x? Are you running windows? If so, check the forums of the group above, some nice chap has posted a 2.6 version. Alia Khouri wrote: > John ...

Web resources about - Python 2.x and 3.x usage survey - comp.lang.python

Python - Wikipedia, the free encyclopedia
Text is available under the Creative Commons Attribution-ShareAlike License ;additional terms may apply. By using this site, you agree to the ...

Two 4.5m pythons found at abandoned site at Cairns
An abandoned building at Cairns had &quot;all the right ingredients&quot; to be home sweet home for two rather large pythons Cairns Snake Removals ...

Five cats eaten by pythons in one month in Cairns
Ever heard the saying curiosity killed the cat? Well in North Queensland, curiosity, and pythons, killed five cats in one month.

106 Burmese pythons captured in Florida hunt, including 15-footer
AL.com 106 Burmese pythons captured in Florida hunt, including 15-footer AL.com DAVIE, Fla. (AP) — The 106 Burmese pythons captured over a ...

Ars Cardboard classics—the stupid fun Monty Python Fluxx
... embarrassment. But it was absolutely true that I wanted those two extra cards. And that, ladies and gentleman is the joy of Monty Python- themed ...

Successful Snake Hunt Shines Light On Florida’s Python Problem
After a monthlong snake hunt, the 106 Burmese pythons captured in Florida may not put a dent in the invasive species' growing numbers, but wildlife ...

On the hunt to get rid of Florida's invasive pythons - Videos - CBS News
The hunt is on in the Florida Everglades for Burmese pythons, an out-of-control snake species. They’re not venomous, but they are big, strong ...

Don’t be afraid of Python; charm it instead
Python lives up to its name as one of the most flexible and far-reaching languages in web development. Like all coding languages, it can seem ...

Save hundreds on the Python Programming Bootcamp
Save hundreds on the Python Programming Bootcamp

Watch Kevin Hart Have a Total Meltdown When Confronted With a Python on 'Today' Australia
Watch Kevin Hart Have a Total Meltdown When Confronted With a Python on 'Today' Australia

Resources last updated: 3/2/2016 12:14:11 AM