|
POST
|
I much not have things setup properly....very confused.
... View more
11-04-2016
09:41 AM
|
0
|
29
|
1791
|
|
POST
|
trying to run script...I get >>> ================================ RESTART ================================ >>> Traceback (most recent call last): File "C:\Users\tjv35563\Desktop\PythonSync\pytz.py", line 10, in <module> import pytz, sys, os, os.path File "C:\Users\tjv35563\Desktop\PythonSync\pytz.py", line 36, in <module> version=pytz.VERSION, AttributeError: 'module' object has no attribute 'VERSION' Trying to install pytz and error out on the line version=pytz.VERSION setup ( name='pytz', version=pytz.VERSION, zip_safe=True,
... View more
11-04-2016
09:29 AM
|
0
|
30
|
1791
|
|
POST
|
So I can run the script as is and it will find all the Survey123 projects in AGO?
... View more
11-04-2016
09:00 AM
|
0
|
1
|
2879
|
|
POST
|
Question: Where and how do I specify the exact folder in AGO that the feature class resides? I see the get Token getToken(username, password=None, portal_URL = 'https://www.arcgis.com' but dont see where I am grabbing the specific workspace (folder) in AGO that was created by Survey123
... View more
11-04-2016
08:40 AM
|
0
|
36
|
2880
|
|
POST
|
OK thanks...gonna give that a try. I assume that I have to create a scheduled Task every few hours to run the script?
... View more
11-03-2016
08:48 AM
|
0
|
0
|
2879
|
|
POST
|
First off thanks fro the response...Much Appreciated. So if I get you right....Synchronize the data portion of you response. I would have a second copy of the Survey123 FS on my EGDB and simply sync the two. When Survey123 updates the copy on my EGDB would update as well. Is that what you are getting at? EDIT: I haven't checked but does this sync Attachments as well....I have a bunch of images attached to each record in Survey123 FC
... View more
11-03-2016
07:41 AM
|
0
|
39
|
2880
|
|
POST
|
I created a collection in Survey 123 but when it publishes it stores the table and attachements in ArcGIS Online. This is not much of an issues other than the fact that I need to Join this table to data that is on my local SDE environment. I cant seem to figure that part out. Can I create a Relationship Class to a table created from Survey 123 that resides in ArcGIS online to a local Feature Class in my local servers SDE. Can I move the location of the table and Attachments created by Survey123 to my local SDE Server? Is there some sort of setting that forces the creation of tables etc to my server not ArcGIS Online? Set a workspace to my server instead of ArcGIS online???? Can I create a Relationship class in ArcGIS online that relates the table created in Survey123 (located in AGO) to a feature class on my local server?
... View more
11-02-2016
01:39 PM
|
2
|
52
|
13766
|
|
POST
|
your example shows how I am exactly doing it.....thanks
... View more
10-11-2016
05:59 AM
|
0
|
0
|
3377
|
|
POST
|
I did it in another area...all set def file_len(fname):
with open("C:/Users/NewFiles/" + fname) as f:
for i, l in enumerate(f):
pass
return i + 1
for file in os.listdir(dir_src):
#Get the number of records being processed calling function file_len below
testfile = str(file)
teststr = file_len(file)
# Count how many Files are being processed.
FileCounter = FileCounter + 1
# Count the Records being processed each time
TotalRecords = TotalRecords + teststr
# Remove the number of files from the total Records. This is because the program is counting the Header in the txt file.
# if there are 7 files then we need to subtract 7 headers or the number in FileCounter variable.
TotalRecords1 = TotalRecords - FileCounter
... View more
10-07-2016
01:46 PM
|
1
|
1
|
3377
|
|
POST
|
I have a script that is looping through many txt files and adding them to a feature class. I want to tally the total number of records added. I am trying to use a RecordCounter Variable to count the records....It DOES work to some degree...it count the first txt file that is being processed but if I process 7 files it only gives me the number from the first txt file. Any thoughts? # .... SNIP
else: # SEEING THERE ARE NO DUPS PROCEED WITH PROCESSING
print "They are no dups so processing is continuing"
#Read through each line of the csv, but skip the first row because it is the header
#The count variable skips of the first row
count = 0
RecordCounter = 0
for ln in open (textFile, 'r').readlines():
if count > 0:
#Each line in the csv is a string, so turn it into a list so you can reference each column
lineSplit = ln.split(",")
#Use index positions to get the right column from the csv
#Make sure the data is the correct type (i.e. X and Y need to be numbers, not strings)
CollarSeri = long(lineSplit[0])
Year = str(lineSplit[1])
Julianday = str(lineSplit[2])
#Insert the values from csv into feature class
#The order of the fields here, matches the order of the fields in line 4
cursor.insertRow ([CollarSeri, Year, Julianday, Hour, Minute, Activity, Temperature, Latitude, Longitude, HDOP, NumSats, FixTime, Date, _2D_3D, BearID, getTime3, getDateTime, FileName, shapeVal])
RecordCounter = RecordCounter + 1
count += 1
del cursor
print RecordCounter
# .... SNIP
... View more
10-07-2016
12:55 PM
|
0
|
7
|
3925
|
|
POST
|
I logged in with an Admin account and same error....hmmmm Our computers are pretty locked down as its a govt computer...McAfee is all over this machine...I tried to change the settings but no go they are disabled. "We are unable to send your email" caused by McAfee | Symantec Connect ugggggg
... View more
10-06-2016
07:13 PM
|
0
|
1
|
3800
|
|
POST
|
Thanks for the reply I tried that and was presented this in the Python 2.7.8 Shell Code: import smtplib
def prompt(prompt):
return raw_input(prompt).strip()
fromaddr = prompt("From: ")
toaddrs = prompt("To: ").split()
print "Enter message, end with ^D (Unix) or ^Z (Windows):"
# Add the From: and To: headers at the start!
msg = ("From: %s\r\nTo: %s\r\n\r\n"
% (fromaddr, ", ".join(toaddrs)))
while 1:
try:
line = raw_input()
except EOFError:
break
if not line:
break
msg = msg + line
print "Message length is " + repr(len(msg))
server = smtplib.SMTP('localhost')
server.set_debuglevel(1)
server.sendmail(fromaddr, toaddrs, msg)
server.quit() Result in the Python 2.7.8 Shell From: [email protected] To: [email protected] Enter message, end with ^D (Unix) or ^Z (Windows): Testing ^z Message length is 94 Traceback (most recent call last): File "C:/Users/tjv36463/Desktop/BearCollar/Python Files/ImportBearDataFiles_TestForExcel.py", line 83, in <module> server = smtplib.SMTP('localhost') File "C:\Python27\ArcGISx6410.3\lib\smtplib.py", line 251, in __init__ (code, msg) = self.connect(host, port) File "C:\Python27\ArcGISx6410.3\lib\smtplib.py", line 311, in connect self.sock = self._get_socket(host, port, self.timeout) File "C:\Python27\ArcGISx6410.3\lib\smtplib.py", line 286, in _get_socket return socket.create_connection((host, port), timeout) File "C:\Python27\ArcGISx6410.3\lib\socket.py", line 571, in create_connection raise err error: [Errno 10013] An attempt was made to access a socket in a way forbidden by its access permissions >>>
... View more
10-06-2016
06:13 PM
|
0
|
4
|
3800
|
|
POST
|
I am trying to send an email via python after my script runs...I am referencing this web page How to send email in Python via SMTPLIB I put in my Gmail user and password, not the one below...and run it...that's all I changed. I get this error...wondering if anyone has done this before or have any other examples on how to do this. Traceback (most recent call last): File "C:/Users/tjv36463/Desktop/BearCollar/Python Files/ImportBearDataFiles_TestForExcel.py", line 62, in <module> smtpserver = smtplib.SMTP("smtp.gmail.com",587) File "C:\Python27\ArcGISx6410.3\lib\smtplib.py", line 251, in __init__ (code, msg) = self.connect(host, port) File "C:\Python27\ArcGISx6410.3\lib\smtplib.py", line 311, in connect self.sock = self._get_socket(host, port, self.timeout) File "C:\Python27\ArcGISx6410.3\lib\smtplib.py", line 286, in _get_socket return socket.create_connection((host, port), timeout) File "C:\Python27\ArcGISx6410.3\lib\socket.py", line 571, in create_connection raise err error: [Errno 10013] An attempt was made to access a socket in a way forbidden by its access permissions import smtplib
to = '[email protected]'
gmail_user = '[email protected]'
gmail_pwd = 'yourpassword'
smtpserver = smtplib.SMTP("smtp.gmail.com",587)
smtpserver.ehlo()
smtpserver.starttls()
smtpserver.ehlo
smtpserver.login(gmail_user, gmail_pwd)
header = 'To:' + to + '\n' + 'From: ' + gmail_user + '\n' + 'Subject:testing \n'
print header
msg = header + '\n this is test msg from mkyong.com \n\n'
smtpserver.sendmail(gmail_user, to, msg)
print 'done!'
smtpserver.close()
... View more
10-06-2016
05:25 PM
|
0
|
6
|
5343
|
|
POST
|
Thanks Christian....very helpful...much appreciated.
... View more
10-06-2016
10:52 AM
|
0
|
0
|
2207
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 09-20-2018 11:09 AM | |
| 1 | 09-10-2018 06:26 AM | |
| 1 | 09-15-2022 11:02 AM | |
| 1 | 05-21-2021 07:35 AM | |
| 1 | 08-09-2022 12:39 PM |
| Online Status |
Offline
|
| Date Last Visited |
09-19-2022
09:23 PM
|