.

Python 2 or Python 3

<<

Thegmandrive

Newbie
Newbie

Posts: 43

Joined: Tue Feb 17, 2009 8:34 pm

Post Fri Jul 29, 2011 11:17 am

Python 2 or Python 3

I have started to learn Python 3. I am very new to python, but am familiar with VB script. So some of the Python 3 syntax is making sense to me.

However, I have been reading about Python 2, and it seems many people still use it.

So my first question is.

Should I learn Python 2 and then learn Python 3?

Or, am I ok sticking with Python 3 for now.

I want to learn Python, for Iphone programming and script writing.

Also, I heard that python is useful for PEN testing. I assume however, that most PEN testers use python 2. Since it's been around much longer.
<<

rattis

User avatar

Hero Member
Hero Member

Posts: 1172

Joined: Mon Jul 27, 2009 1:25 pm

Post Fri Jul 29, 2011 11:53 am

Re: Python 2 or Python 3

like perl 5, python 2 will be around for a while.  it'll take a while for everything to be converted over. Personally I'd go with Python 3. Only reason I mess with python 2 is because I have books on the subject.

There are scripts that will update 2 to 3. Learning 3, and then enough 2 to upgrade existing scripts might be a good choice to.
OSWP, Sec+
<<

Thegmandrive

Newbie
Newbie

Posts: 43

Joined: Tue Feb 17, 2009 8:34 pm

Post Fri Jul 29, 2011 12:18 pm

Re: Python 2 or Python 3

Thank you for your reply, I will stick with Python 3 then for now. I really like the syntax so far in python 3, It's very "logical"
<<

tturner

User avatar

Sr. Member
Sr. Member

Posts: 435

Joined: Thu Jun 26, 2008 4:50 pm

Post Fri Jul 29, 2011 12:23 pm

Re: Python 2 or Python 3

I disagree. Name me 1 significant security tool written in 3. I don't know of any but I'd be happy to be mistaken.
Certifications:
CISSP, CISA, GPEN, GWAPT, GAWN, GCIA, GCIH, GSEC, GSSP-JAVA, OPSE, CSWAE, CSTP, VCP

WIP: Vendor WAF stuff

http://sentinel24.com/blog @tonylturner http://bsidesorlando.org
<<

rattis

User avatar

Hero Member
Hero Member

Posts: 1172

Joined: Mon Jul 27, 2009 1:25 pm

Post Sat Jul 30, 2011 12:09 am

Re: Python 2 or Python 3

tturner, I don't see how that is relevant. People write in the code they know. I'd rather make my security tools in Shell script and Perl. :)

If you're running other people's code than yeah, go with the interpreter that works for that code. But if you're writing fresh might as well go with the one that's maintained, and the developers are trying to get people to switch too.

From thepyhton wiki
Short version: Python 2.x is the status quo, Python 3.x is the shiny new thing.

At the time of writing (July 4, 2010), the final 2.7 release is out, with a statement of extended support for this end-of-life release. The 2.x branch will see no new major releases after that. 3.x is under active and continued development, with 3.2 already available.


Not dissing you, have respect, but I can't agree with you on this.
OSWP, Sec+
<<

tturner

User avatar

Sr. Member
Sr. Member

Posts: 435

Joined: Thu Jun 26, 2008 4:50 pm

Post Sat Jul 30, 2011 2:16 am

Re: Python 2 or Python 3

It's a personal choice. For me, my desire to learn Python was not to write my own code as much as tweak the code in existing tools to suit my purpose and extend it's functionality and also to understand what is going on under the covers in the tools I'm using. So for that 2.x makes sense. By all means, use what works for you.
Certifications:
CISSP, CISA, GPEN, GWAPT, GAWN, GCIA, GCIH, GSEC, GSSP-JAVA, OPSE, CSWAE, CSTP, VCP

WIP: Vendor WAF stuff

http://sentinel24.com/blog @tonylturner http://bsidesorlando.org
<<

rattis

User avatar

Hero Member
Hero Member

Posts: 1172

Joined: Mon Jul 27, 2009 1:25 pm

Post Sat Jul 30, 2011 6:39 pm

Re: Python 2 or Python 3

tturner, all good. that's a better argument. Showing you're using existing code to learn and do more. :)

Wasn't trying to knock you man. Just didn't see where you were coming from.
OSWP, Sec+
<<

dynamik

Recruiters
Recruiters

Posts: 1119

Joined: Sun Nov 09, 2008 11:00 am

Location: Mile High City

Post Tue Aug 02, 2011 9:44 pm

Re: Python 2 or Python 3

Correct me if I'm wrong, but I believe the issue is that there are still many libraries that have not been updated to be compatible with v3. It's been awhile since I really looked at this, but it seems like this is still the consensus today. That seems like a valid reason to stay with v2 if you need additional functionality.
The day you stop learning is the day you start becoming obsolete.

Return to Programming

Who is online

Users browsing this forum: No registered users and 0 guests

.
Powered by phpBB® Forum Software © phpBB Group.
Designed by ST Software