POST
|
Any Help would be appreciated.. Does any one have any idea why every time I try to save any changes made I can't? It simply says "Error#3001"
... View more
11-21-2012
02:52 PM
|
0
|
1
|
2024
|
POST
|
I am trying to go from a table (csv file) to a feature class. I have a field called "Dates". When I put the table in and check its field type it says it is of type "Date" (which is what I need) and every record is filled out. However, when I create a feature class: arcpy.MakeXYEventLayer_management(in_table,x_coord,y_coord,out_table,spatialRef) ' My output is a feature class.. but with "NULL" dates. I tried to do this by right clicking the table and telling it to display XY data. But The same problem happens. All the dates dissapear.. the dates are in the following form : 08/08/2012 any reason why this could happen?
... View more
08-07-2012
03:17 PM
|
0
|
1
|
282
|
POST
|
[/HR] Every time I try to set the workspace on my script. I get the following error: 'exceptions.AttributeError'>: 'str' object has no attribute 'workspace' I have tried running it on the IDE and I get the same error : import arcpy
from arcpy import env
arcpy.env.workspace = "C:/Documents and Settings" I had previously used it but for some reason now it seems like it is treating the env as a string. Any ideas as to how to fix this?
... View more
07-30-2012
09:08 AM
|
0
|
4
|
976
|
POST
|
Does the following script not work for you? It works fine for me, and if I remove the decode, I get the same error as you.
import codecs
import sys
aninput = sys.argv[1].decode(sys.getfilesystemencoding())
textfile = codecs.open("testfile","w","utf-8")
textfile.write(aninput)
textfile.close()
Got it to work! 🙂 THANXS the reason it would'nt work was because I was adding the following line: "arcpy.AddMessage(str(aninput))"
... View more
07-26-2012
09:43 AM
|
0
|
0
|
308
|
POST
|
Hi Alan, I continue to get the following error: <type 'exceptions.UnicodeEncodeError'>: 'ascii' codec can't encode character u'\xe9' in position 0: ordinal not in range(128) Failed to execute (Script).
... View more
07-26-2012
08:36 AM
|
0
|
0
|
308
|
POST
|
I am currently creating a textfile in which I would like to write the users input. it needs to be able to deal with characters that contain accents i.e."é". The file needs to be coded on utf-8 I have managed to copy into the text file using utf-8 coding by by using codecs. However, I am having a hard time figuring out how to do this given a users input?.. so far i have something like this: import codecs import sys aninput = sys.argv[1] textfile = codecs.open("testfile","wt","utf-8") textfile.write(u"é") # this works textfile.write(aninput) # this fails assuming that aninput = "é" textfile.close() any ideas?
... View more
07-25-2012
05:19 PM
|
0
|
5
|
545
|
POST
|
Do you check if the file already exists before calling the delete function check like below import os if os.exists(Full path of the text file"): os.delete(Full path of the text file) I do have a file that checks if the file already exists ..and it comes out false
... View more
07-25-2012
04:24 PM
|
0
|
0
|
386
|
POST
|
[/HR] I don't have a line in my script that says "arcpy.overWriteOutputs = 1" I am creating the text file so there is no previous file with that name. Every time I run it, at the end of the script I delete the file. But I only get the error when I open open ArcMap/ArcCatalog for the first time.
... View more
07-23-2012
10:58 AM
|
0
|
0
|
386
|
POST
|
[PHP][/PHP] I have a toolbox where I have created a python script. I am trying to create a text file called draft where I am writting in some information. Every time I run my script I get the followign error: <type 'exceptions.IOError'>: [Errno 13] Permission denied: 'draft' Failed to execute (Script). However, when I go to properties and and "re-set" the source, the script it works again, eventhough the previous source was the correct source. The script will then run fine until I close ArcMap and open it again. I get the same error and once I "re-set" the source it works again. Any ideas?
... View more
07-20-2012
03:20 PM
|
0
|
5
|
1931
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|