POST
|
Hello Jon Morris ! Thanks for replying! As suggested by you I made the following amendments to the code: from arcpy import * from smtplib import SMTP and it worked! Thanks again! Shreya
... View more
04-18-2016
05:39 AM
|
0
|
0
|
363
|
POST
|
Hello, I am facing a strange issue since last 2 days. I am trying a publish a GP service containing a simple code to send an email to the provided userid using smtplib. The tool is running successfully and the email is being sent. After the tool is published, when I am opening the folder C:\arcgisserver\directories\arcgissystem\arcgisinput\<folder name>\<service_name>.GPServer\extracted strangely I am finding a tilingservice.xml file. And when I am opening the folder: C:\arcgisserver\directories\arcgissystem\arcgisinput\<folder name>\<service_name>.GPServer\extracted\v101\<toolbox_name> I found that smtplib.py has been copied ! I tried publishing the service from a ArcMap in a different server to mine this issue is not getting reproduced. But when I am publishing my from ArcMap in my laptop to any other server the same issue is getting reproduced. I have tried deleting the Python27 folder and repairing it but this does not help. Any help or leads is really appreciated. Thanks in advance, Shreya
... View more
04-17-2016
10:07 PM
|
0
|
2
|
2279
|
POST
|
I have JSON data which I am formatting into two tables and printing on PDF using reportlab. It works fine when the '&' character is not in the data else it gives The following error: 'ascii' codec can't decode byte 0xa0 in position 0: ordinal not in range(128) The weird thing is, the code works perfectly fine while debugging the tool. The error only pops up while running the code here: DOC.build(ELEMENTSOFDOC, onFirstPage=on_first_page, onLaterPages=on_later_pages, canvasmaker=NumberedCanvas) I have referred to the related questions posted. I have also tried the solution provided here and also normalizing the data. Nothing is working. It throws the same ascii error. Here's the JSON input: {u'Neighborhood Information': [u'Dominant Tapestry Segment:63', u'Labor Force Participation Rate:5,873', u'Total Population:17,045', u'Total Households:2,044', u'Average Household Size:3', u'Average Household Income:$58,312', u'Median Household Income:$26,260', u'Per Capita Income:$18,204', u'Total Housing Units:2,687', u'Owner Occupied HUs:400', u'Renter Occupied HUs:1,644', u'Vacant Housing Units:578', u'Median Home Value:$402,778', u'Average Home Value:$428,563'], u'Property Information': [u'Name:Rossborough Drive & Paint Branch Parkway', u'Address:Rossborough Drive & Paint Branch Parkway', u'City:College Park', u'State:MD', u'Zipcode:20742', u'Type:Commercial', u'Area (sqft):100000']} Here's how I am building my attribute table dictionary: TEMPDICT = {key : ATTRIBUTEDATA.find(key)} TABLEKEYSINDEX.update(TEMPDICT) SORTEDTABLESINDEX = sorted((value, key) for (key, value) in TABLEKEYSINDEX.items()) Here's how I am formatting the table: table_key = (Paragraph(unicode((table_data[k][i].split(":"))[0], errors='ignore'), styles_table['TblBody']))
if k == sorted_table_headers[0]:
if len((table_data[k][i].split(":"))[1]) != 0:
value = (Paragraph(unicode((table_data[k][i].split(":"))[1], errors='ignore'), styles_table['TblBody']))
else:
if len((table_data[k][i].split(":"))[1]) !=0:
value = (Paragraph(unicode((table_data[k][i].split(":"))[1], errors='ignore'), styles_table_right['TblBo dy'])) I have the following versions installed on my machine: matplotlib (1.3.0)
numpy (1.7.1)
PIL (1.1.7)
Pillow (2.5.2)
pip (1.5.6)
pyparsing (1.5.7)
reportlab (3.1.8)
setuptools (5.5.1)
ArcMap 10.2.1 Any help pointing me to the right direction would really be appreciated.
... View more
11-11-2014
12:54 AM
|
0
|
1
|
3728
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|