Port Scanner Code

May 4, 2008 at 1:47 am (Uncategorized)

And here it is

#!/python24
import socket
host = raw_input(”What is the IP? “)
port0 = raw_input(”What is the starting port? “)
port1 = raw_input(”What is the finishing port? “)
output = raw_input(”What shall the log output file be called? “)
port = port0
print “Scanning ports…”
z = open(output + “.log”, “a”)
z.write(”Scan result: “)
z.close()
while int(port) <= int(port1):
try:
s = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
s.connect((host, int(port)))
z = open(output + “.log”, “a”)
z.write(str(port) + ” is open. \n”)
z.close()
s.close()
print port
port = int(port) + 1
except socket.error:
z = open(output + “.log”, “a”)
z.write(”Port: ” + str(port) + ” is closed. “)
z.close()
s.close()
print port
port = int(port) + 1

Permalink 1 Comment

Hello World in VPython

April 23, 2008 at 8:05 pm (Uncategorized)

Since my video wasn’t very clear, here is the code for “Hello World in VPython”

from visual.text import *

# At present, VPython supports only numbers and uppercase characters. Other characters will be displayed as *

scene.title = “Hello World” #from the scene module it used the title function
# Here goes the hello world text
text(pos=(0,2,0), string=’PYTHON’, color=color.green, depth=0.3, justify=’center’)
text(pos=(0,4,0), string=’WELCOME TO THE WORLD OF’, color=color.orange, depth=0.3, justify=’center’)

# Pos means Position in xyz format

Hold right click to spin it, and hold both left and right click to zoom in and out.

Permalink Leave a Comment

Forums

April 20, 2008 at 1:46 am (Uncategorized)

My new forums are up, You can visit them at spythons.freeforums.org

~Mr. Python

Permalink Leave a Comment

New Site

April 19, 2008 at 8:27 pm (Uncategorized)

This is my new website that is maintained and hosted by WordPress, I will be publishing an article every week. Check back often!

~Mr. Python

Permalink 1 Comment