unexpected indent in python script udp receiver [solved]

Hi guys,

I need our help. In my python script I receive udp broadcasts. I get an error unexpected indent. What is my mistake ? On top of the script the value.put works fine.

import select, socket, sys 
sys.path.insert(0, '/usr/lib/python2.7/bridge/') 
from bridgeclient import BridgeClient as bridgeclient
value = bridgeclient()

port = 65000  # where do you expect to get a msg?
bufferSize = 1024 # whatever you need

#url = "arduino/d"
#value.put('d',url)

s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.bind(('<broadcast>', port))
s.setblocking(0)

var = 10
while var >0:
    result = select.select([s],[],[])
    msg = result[0][0].recv(bufferSize) 
    print msg
    if msg.find('d') != -1:
    	list = msg.split(';',1)
    	url = list[0] + "/arduino/d"
		value.put('d',url)	    	
    	print url
 	var = var - 1

root@Arduino:~# python udp_receiver_copy.py
File "udp_receiver_copy.py", line 24
value.put('d',url)
^
IndentationError: unexpected indent

Thanks
Andreas

Python is like that: it is extremely picky on indentation of your code; line #24 clearly shows the extra indentation; perhaps it's a combination of tabs and spaces? You won't see it in your edItor but Python does :wink:

kind regards,

Jos

Hi Jos,

it works, I deleted this line and wrote this line new

Thanks for your help
Andreas