Python 2.7 or Python 3. Which one should I learn?

Python 2.7 or Python 3. Which one should I learn?
Python 2.7 is no longer in development and students are encouraged to learn 3.
However, if you're working on old hardware and old versions of Linux like I usually am at work, it may not be possible to implement Python 3 scripts which isn't even in the main CentOS/RHEL 7 repo.

Other urls found in this thread:

pythonclock.org/
twitter.com/SFWRedditVideos

Python3 you retard

Python3 you faggot

you're talking about this like learning one will make the other unintelligible to you. the only way for that to be the case would be if you become such an incompetent script kiddie that doing anything substantive (with anything, let alone hardware) will be a pipe dream.

"tell them you'll learn python 3 when all of the software on their computer runs with python 3, that'll keep them busy for a couple of decades."

Everyone I know working real world still runs 2.7... I think generally speaking everyone has both, but devs on 2.7.

You must know some crusty old shits, then. Everyone with any sense uses 3.

Op here. Prod environments are rarely cutting edge. Change is expensive and risky.

I can't remember the last time I touched a system that didn't have python3 available.
5 years ago 2.7 was still used for a bunch of stuff. By now it's really only legacy shit.

>cutting edge.
Python 3 is over 7 years old

Non faggot here

My previous and current job uses python3

2.7
It will be a lot easier to learn as there are so many more stack overflow pages with 2.7 problems than 3

pythonclock.org/

forks incoming.

There are a few core differences with 2 and 3. You're practically learning the same language so it's not that big of a deal. Start with Python 3 to learn the language the "correct" way. And if you ever need python 2 just look up the things that are different.

I'm in a similar situation. At work I have to work with Python 2 and editors for Python 2 (Canopy), but some scripts I need to integrate are written for Python 3.
How to make sure I doing accidentally import mistakes like division stuff.
E.g. afaik, new scripts written in 3 assume 5/7 will result in a float, while Python 2 will return zero.

If I run stuff in a Python 2 editor, does it suffice if I add
>form __future__ import division
in all files?
Or is there a better solution?

And what else do I have to look out for?

^
you fags

the people that are resisting python 3 are increasingly becoming a pure community of people who are simply too lazy to upgrade.

that doesn't make for a good fork or a good dev community in general.

^^ this. or just start with python 2, the differences aren't major, it's the same syntax with things done slightly differently.

still alot of people use python 2.

/thread

python 2.7
everyone telling otherwise has never written a useful program ever. they only prefer 3 over 2 because it's the latest version.

your addons will break

cant doing the opposite yield similar results?

kek.

I know of at least a couple fortune 500 companies (former employers) who still have RHEL 5 and Solaris 8 and 9 servers in prod. It happens. Companies loathe spending money on IT and IT people.

>shit ton of python 2 code.
>they want me to change just because Guido is fucking faggot and can't maintain a programming language
Yeah fuck that.

3, don't be a retard

Literally 3 things you need to know are different:
- in python3 you can only write >>> print('text'), where in python2 you can write >>> print 'text as well.

- in python2 divisions of integers will always return an integer, where in py3 it'll always return a float

- python2 does implicit encoding/decoding, in python3 you have to encode/decode into/from bytesunicode, which is great because implicit things suck.

This: They're not two different languages ffs, learn whichever you want.

mmm nipplicious

they are the same wtf dude