Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #85244
| Date | 2015-02-04 19:07 -0800 |
|---|---|
| Subject | Indentation issues with python |
| From | syed khalid <syedk@pacificloud.com> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.18482.1423105677.18130.python-list@python.org> (permalink) |
[Multipart message — attachments visible in raw view] - view raw
I downloaded this code and am attempting to run it. I keep getting
indentation error. there is a way to handle it with a editor which can
recognize the tab or space issue. I have tried different options such as 2
or 3 spaces or tab to no avail.
I have encased the error mesage with line 23 between "****************"
import sys
import azure
import socket
from azure.servicebus import (
_service_bus_error_handler
)
from azure.servicebus.servicebusservice import (
ServiceBusService,
ServiceBusSASAuthentication
)
from azure.http import (
HTTPRequest,
HTTPError
)
from azure.http.httpclient import _HTTPClient
class EventHubClient(object):
def sendMessage(self,body,partition):eventHubHost =
"pac-ns.servicebus.windows.net"
httpclient = _HTTPClient(service_instance=self)
********************************************************************
File "test1.py", line 23
def sendMessage(self,body,partition):
^
IndentationError: expected an indented block
***********************************************************************
sasKeyName = "SendPolicy"
sasKeyValue = "erENqf/5wdWCNEbCA9NsDIRqd5MRKdkii07+wezl/NU="
authentication = ServiceBusSASAuthentication(sasKeyName,sasKeyValue)
request = HTTPRequest()
request.method = "POST"
request.host = eventHubHost
request.protocol_override = "https"
request.path = "/myhub/publishers/" + partition +
"/messages?api-version=2014-05
"
request.body = body
request.headers.append(('Content-Type',
'application/atom+xml;type=entry;charset
=utf-8'))
authentication.sign_request(request, httpclient)
request.headers.append(('Content-Length', str(len(request.body)))
--
*Syed Khalid*
Back to comp.lang.python | Previous | Next — Next in thread | Find similar | Unroll thread
Indentation issues with python syed khalid <syedk@pacificloud.com> - 2015-02-04 19:07 -0800 Re: Indentation issues with python Denis McMahon <denismfmcmahon@gmail.com> - 2015-02-05 11:46 +0000
csiph-web