[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

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

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 29
Thread images: 3

File: python.png (80KB, 1000x1000px) Image search: [Google]
python.png
80KB, 1000x1000px
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.
>>
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.
>>
>>56286174
You must know some crusty old shits, then. Everyone with any sense uses 3.
>>
>>56286199

Op here. Prod environments are rarely cutting edge. Change is expensive and risky.
>>
>>56285898
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.
>>
>>56286268
>cutting edge.
Python 3 is over 7 years old
>>
Non faggot here

My previous and current job uses python3
>>
>>56285898
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
>>
File: 1472290483.png (103KB, 906x643px) Image search: [Google]
1472290483.png
103KB, 906x643px
https://pythonclock.org/
>>
>>56286586
forks incoming.
>>
>>56285898
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.
>>
File: hair_stacy.jpg (682KB, 1280x1772px) Image search: [Google]
hair_stacy.jpg
682KB, 1280x1772px
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?
>>
>>56286476
^
you fags
>>
>>56286778
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.
>>
>>56286914

^^ 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.
>>
>>56286430
/thread
>>
>>56285898
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
>>
>>56286914
cant doing the opposite yield similar results?
>>
>>56288888

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.
>>
>>56286430
>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.
>>
>>56285898
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 bytes<->unicode, which is great because implicit things suck.

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

mmm nipplicious
>>
they are the same wtf dude
Thread posts: 29
Thread images: 3


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.