hi peeps...
I'm just learning to program with python at the moment.
and i was wondering if any of you guys have an idea for me for any program, doesn't matter what. just something i can tinker with for a while and is fairly easy mode would be awesome! :]
PS. I do know the absolute basics (like "while" statement and "print" and "input" and such alike.). just a hint would be great! :]
Python programming?
I'd suggest a Runaway Robot solver, it can be completed with python but can take a few minutes on the later levels and you'll probably have to change your approach to get there. If you do try this you can use urlopen from urllib (from urllib import urlopen), it's quite an interesting but simple challenge and I'm sure you'll be pleased when you manage to get to 513.
Wow thanks :]
I'm going to try that for a while
it goes like
right?
I'm going to try that for a while
it goes like
Code: Select all
import urllib
somestring = urllib.urlopen('http://www.website.com').read()
yup, don't forget to play with the sting formatting which can be good for the uri with something like
Code: Select all
from urllib import urlopen, urlencode
from re import match
uri = "http://www.hacker.org/runaway/index.php?name=%s&%s";
name = raw_input("Enter your username:\n");
password = raw_input("Enter your password or SPW:\n")
param2 = ""
if match("[0-9a-z]{32}",password): # The SPW is 32 lowercase hex digits
param2 = "spw=%s"%(password)
else:
param2 = "password=%s"%(urlencode(password))
uri = uri%(urlencode(name),param2)
response = urlopen(uri).read()