Image
 
linkedin_logo.png rss_logo.jpg
twitter_logo.png youtube_logo.jpg
Latest Additions
 
EH-Net Login
Welcome Guest.






Lost Password?
No account yet? Register
Who's Online
We have 57 guests and 3 members online
 
Advertisement

You are here: Home arrow Ethical Hacking Discussions and Related Certificationsarrow Programmingarrow Python 2 or Python 3
EH-Net
May 22, 2013, 04:23:17 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Go back to The Ethical Hacker Network Online Magazine Home Page
 
   Home   Help Calendar Login Register  
Pages: [1]   Go Down
  Print  
Author Topic: Python 2 or Python 3  (Read 10586 times)
0 Members and 1 Guest are viewing this topic.
Thegmandrive
Newbie
*
Offline Offline

Posts: 43


View Profile
« on: July 29, 2011, 11:17:56 AM »

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.
 
Logged
chrisj
Hero Member
*****
Offline Offline

Posts: 1163


View Profile WWW
« Reply #1 on: July 29, 2011, 11:53:37 AM »

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

OSWP, Sec+
Thegmandrive
Newbie
*
Offline Offline

Posts: 43


View Profile
« Reply #2 on: July 29, 2011, 12:18:30 PM »

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"
Logged
tturner
Sr. Member
****
Offline Offline

Posts: 432


View Profile WWW
« Reply #3 on: July 29, 2011, 12:23:29 PM »

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

Certifications:
CISSP, CISA, GPEN, GWAPT, GAWN, GCIA, GCIH, GSEC, OPSE, CSWAE, CSTP, VCP

WIP: OSWP, GSSP-JAVA, GXPN

Udacity on hold, again. I suck.

http://sentinel24.com/blog  @tonylturner http://bsidesorlando.org
chrisj
Hero Member
*****
Offline Offline

Posts: 1163


View Profile WWW
« Reply #4 on: July 30, 2011, 12:09:54 AM »

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

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 the pyhton wiki
Quote
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.
Logged

OSWP, Sec+
tturner
Sr. Member
****
Offline Offline

Posts: 432


View Profile WWW
« Reply #5 on: July 30, 2011, 02:16:41 AM »

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

Certifications:
CISSP, CISA, GPEN, GWAPT, GAWN, GCIA, GCIH, GSEC, OPSE, CSWAE, CSTP, VCP

WIP: OSWP, GSSP-JAVA, GXPN

Udacity on hold, again. I suck.

http://sentinel24.com/blog  @tonylturner http://bsidesorlando.org
chrisj
Hero Member
*****
Offline Offline

Posts: 1163


View Profile WWW
« Reply #6 on: July 30, 2011, 06:39:55 PM »

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

Wasn't trying to knock you man. Just didn't see where you were coming from.
Logged

OSWP, Sec+
ajohnson
Recruiters
Hero Member
*
Offline Offline

Posts: 1057


aka dynamik


View Profile WWW
« Reply #7 on: August 02, 2011, 09:44:41 PM »

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

WIP: GCFA | www.infosiege.net | @infosiege

The day you stop learning is the day you start becoming obsolete.
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines
Joomla Bridge by JoomlaHacks.com
Valid XHTML 1.0! Valid CSS!
Page created in 0.061 seconds with 23 queries.
 
Exclusive Deal

sansfire13_245x90_cw90.jpg
SANSFIRE 2013
June 15 - 22

5% Off w/ Code: EHN_5

SANS Deals 4 EH-Netters
5% OFF Any SANS Course in Any Format!
Coupon Code: EHN_5 Including SANS Rocky Mountain 2013 & SANS Boston 2013
Polls
Compared to this year, 2013 will be:
 
Recent Forum Topics
EH-Net News Feeds
Latest Additions
 
         
Advertisement

© 2013 The Ethical Hacker Network
Joomla! is Free Software released under the GNU/GPL License.