Hi, I am trying python for the first time on osx and somehow I have problems loading some libraries (for example urllib). maybe my script is wrong, but I cannot test it, because pd crashes when I import urllib. marius.
import sys,urllib
print "Script initialized"
try: print "Script arguments: ",sys.argv except: print
def printpage(arg): import urllib f = urllib.urlopen(arg) # Read from the object, storing the page's contents in 's'. s = f.read() f.close() print (s)
Have you tried running it from the command line?
.hc
On Mar 2, 2007, at 7:30 PM, marius schebella wrote:
Hi, I am trying python for the first time on osx and somehow I have
problems loading some libraries (for example urllib). maybe my script is wrong, but I cannot test it, because pd crashes when I import urllib. marius.import sys,urllib
print "Script initialized"
try: print "Script arguments: ",sys.argv except: print
def printpage(arg): import urllib f = urllib.urlopen(arg) # Read from the object, storing the page's contents in 's'. s = f.read() f.close() print (s)
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/ listinfo/pd-list
As we enjoy great advantages from inventions of others, we should be
glad of an opportunity to serve others by any invention of ours; and
this we should do freely and generously. - Benjamin Franklin
Hey Marius,
no idea, it works for me, apart from the thing that you must convert
the incoming symbol arg to str before using it with urlopen
f = urllib.urlopen(str(arg))
greetings, Thomas
PS: just updated the binary on http://grrrr.org/ext/beta although it
think that nothin has changed....
Am 03.03.2007 um 01:30 schrieb marius schebella:
import sys,urllib
print "Script initialized"
try: print "Script arguments: ",sys.argv except: print
def printpage(arg): import urllib f = urllib.urlopen(arg) # Read from the object, storing the page's contents in 's'. s = f.read() f.close() print (s)
-- Thomas Grill http://grrrr.org