Skip to content

Instantly share code, notes, and snippets.

@jackperry
jackperry / Urllib2 Usage
Created February 11, 2011 10:16
Found from Google. Saving here.
import urllib2, base64
request = urllib2.Request('url')
base64string = base64.encodestring('%s:%s' % ('user', 'password'))[:-1]
request.add_header("Authorization", "Basic %s" % base64string)
htmlFile = urllib2.urlopen(request)
htmlData = htmlFile.read()
print htmlData
htmlFile.close()
f = open('idnum2itemdisplaynametable.txt', 'r')
g = open('output.txt', 'w')
for line in f:
x = line.replace('#',',"',1)
y = x.replace('#','","","");',1)
if y[1].isdigit():
z = "REPLACE INTO `item_meta` VALUES (" + y
g.write(z)
else:
// Title : Healer [Hyde]
// Author : Jack Perry
// A Project Renova Script
prontera,150,184,5 script Hyde#t00::healer 81,{
mes "[Hyde]";
mes "Hello, "+strcharinfo(0)+"!";
mes "I'm a Dog. With healing powers.";
mes "I can heal you. For 5,000 Zeny.";