Jump to content

IPB


- - - - -

Python 2.7.1....


41 replies to this topic

#1 Ironman

    Ninja Trainee

  • Members
  • 6,729 posts

Posted 08 May 2011 - 05:16 AM

The 2.7.1 is the newest and probably last stable build of python in th 2.x series. 3.x has a stable build. But from What I read lots of people are still using the 2.x.  I've loaded 2.7.1 on my computer with Idle. I've been reading "Learning Python" and been doing the examples as I go.
Can someone post some simple python scripts that I can dissect to help me learn this stuff? Any help would be appreciated.
Posted Image

#2 Gavin

  • Members
  • 5,840 posts

Posted 08 May 2011 - 05:17 AM

I'm also working on learning python but it's going slow.

Quote

Complainismo strikes again

#3 d3nn

    Diodora demartiniorum

  • Members
  • 5,615 posts
  • iPod touch:iPod touch 4G
  • iPod:iPod nano

Posted 08 May 2011 - 05:26 AM

I started learning python, I just haven't really had time to get past my first 3 hello world programs :(
Posted Image

#4 Gavin

  • Members
  • 5,840 posts

Posted 08 May 2011 - 05:28 AM

D3nn said:

I started learning python, I just haven't really had time to get past my first 3 hello world programs :(

Exactly! And when I did they started talking about terms they never explained and I got real confused

Quote

Complainismo strikes again

#5 Leffy

  • Donators
  • 6,339 posts

Posted 08 May 2011 - 06:02 AM

http://www.swaroopch.com/notes/Python

Amazing book/tutorial

#6 Ironman

    Ninja Trainee

  • Members
  • 6,729 posts

Posted 08 May 2011 - 06:11 AM

D3nn said:

I started learning python, I just haven't really had time to get past my first 3 hello world programs :(

Did my first hello world this morning. I got the app learning python. But it's for 3.0. I've only ran into a couple of differences so far. I know if I see a few simple scripts it will help.
Posted Image

#7 d3nn

    Diodora demartiniorum

  • Members
  • 5,615 posts
  • iPod touch:iPod touch 4G
  • iPod:iPod nano

Posted 08 May 2011 - 06:16 AM

Yeah, I think I just need to start myself on a big project but take it slow. That's how I got started on ti-basic and it worked pretty well
Posted Image

#8 Ironman

    Ninja Trainee

  • Members
  • 6,729 posts

Posted 08 May 2011 - 06:26 AM

Leffy said:


Well. After your post it looks like I may need to clean my computer and load up the 3.x version. What version do most hack tools that use python have?? Anyone know?? I suspect it's 2.x.
Posted Image

#9 A12danrulz

    Metasploit Master

  • Members
  • 3,518 posts
  • iPod touch:iPod touch 4G

Posted 08 May 2011 - 06:27 AM

For iPod it's 2.5 I think.

Quote

Stupid questions get stupid answers.

#10 Gavin

  • Members
  • 5,840 posts

Posted 08 May 2011 - 06:28 AM

The latest for iPhone is 2.5.

Quote

Complainismo strikes again

#11 Ironman

    Ninja Trainee

  • Members
  • 6,729 posts

Posted 08 May 2011 - 06:41 AM

Okay!! Sticking with 2.7.1 then. 
Posted Image

#12 $tiLL $kiLLeD

  • Members
  • 286 posts

Posted 08 May 2011 - 12:38 PM

I have the same version but I've been goin slow bckuz I have so much school. I'm reading learning python also, I'm hanging in there so far, I really want to be a programmer in the video game industry

#13 PaulBird

  • Members
  • 536 posts

Posted 08 May 2011 - 03:20 PM

just google python examples

#14 ghoulmaster

  • Members
  • 320 posts

Posted 08 May 2011 - 07:06 PM

For the main differences in all your 2.x scripts put this code in

print(x):
    print x
range(x):
    xrange(x)

and thats the main looking differences, there are other differences but i doubt you will run into them unless you use map() and filter() which in this case in 3.x they return an iterator and in 2.x they return a list. Other then that theres new string formatting with the .format method. really those are the only differences that bothered me

#15 Gavin

  • Members
  • 5,840 posts

Posted 08 May 2011 - 07:27 PM

Yeah and you can run most 3.0 scripts in 2.0

Quote

Complainismo strikes again

#16 PaulBird

  • Members
  • 536 posts

Posted 08 May 2011 - 09:55 PM

yup

#17 Leffy

  • Donators
  • 6,339 posts

Posted 09 May 2011 - 12:26 AM

I was board so i ran this on loop for a little
count1 = 1
count2 = 2
while count1 < count2:
    count1 = count1 * 2
    count2 = count2 * 2
    print(count1)


#18 PaulBird

  • Members
  • 536 posts

Posted 09 May 2011 - 01:15 AM

lol

#19 Trcx528

    iPhone Pwner

  • Members
  • 3,135 posts
  • iPod touch:iPod touch 4G
  • Mac:MacBook Pro

Posted 09 May 2011 - 01:21 AM

No trying to pick apart your code, but couldn't you have wrote it to read
count = 1
while 1 == 1
   count = count * 2
   print (count)


I don't know any python so correct me if i'm wrong any where. Anytime I write code I try to do so using as few instructions as possible (hopefully thus making it more efficient)

#20 ZombieLion

  • Members
  • 1,275 posts

Posted 09 May 2011 - 02:03 AM

You need a colon after the while 1==1: But otherwise that would work.
The first time you see this, copy it into your sig on any forum and stick a fork in your eye. Social experiment.