urlopen errors in script
sleepy at cabbage.co.uk
Tue Aug 18 13:48:42 CEST 2009
On Tue, 18 Aug 2009 13:21:59 +0200, Peter Otten wrote:
> Sleepy Cabbage wrote:
>> I'm scripting a superkaramba theme using python and have intgrated
>> output from amarok. I have also would like to show the artist and song
>> title from a radio stream i've added to my playlist.
>> If I open a python console and add the following:
>> ">>>import urllib2"
>> ">>>from urllib2 import urlopen"
>> ">>>nowplaying = str.split(urlopen('http://www.hearteastmids.co.uk//
>> ">>>print test[:-3]"
>> this works and displays the artist and song title.
>> However, when I add this to my script I get the following errors:
> Please give a minimal version of your script that produces the error,
> not some arbitrary excerpt that you ran successfully on the command
> If I were to guess: you are doing something like
> import socket
> socket.socket = socket
> somewhere, thus confusing the socket class with the module of the same
This is the script up to where the error seems to fall:
"# -*- coding: iso-8859-1 -*-"
"from subprocess import Popen, PIPE, STDOUT, call"
"from urllib import urlopen"
"#this is called when your widget is initialized"
"clkPause = karamba.createClickArea(widget, 156, 470, 35, 35, "qdbus
org.kde.amarok /Player Pause")"
"nowplaying = urllib.urlopen('http://www.hearteastmids.co.uk//jsfiles/
Hope this can enlighten things
More information about the Python-list