arcpy.CopyFeatures_management syntax?

3090
12
08-22-2016 07:17 AM
VincentLaunstorfer
Occasional Contributor III

Hi,

In a python script, I use arcpy.CopyFeatures_management function but it certain situation, some parameters may have a white space such as:

C:\ESRI\City Points_point.shp

Then, when running the script, arcpy.CopyFeatures_management interprets C:\ESRI\City Points_point.shp as 2 parameters because of the white space.

Executing: CopyFeatures 'C:\ESRI\City Points_point.shp' C:\ESRI\City_Points_point.shp # 0 0 0Start Time: Mon Aug 22 16:01:33 2016Failed to execute. Parameters are not valid.

How would it be possible to arrange the syntax and have 'C:\ESRI\City Points_point.shp' interpreted as just one parameter?

Thanks

Tags (2)
0 Kudos
12 Replies
VincentLaunstorfer
Occasional Contributor III

Dan,

You're right. Attached here is the complete toolbox. The python script should be imported into it.

For parameters, the dialog box should speak itself...

Thanks

0 Kudos
DanPatterson_Retired
MVP Emeritus

sadly... on an iPad until tonight

0 Kudos
VincentLaunstorfer
Occasional Contributor III

Just for a follow-up, I decided to replace white spaces with underscore _ using a little software called Siren to rename files... It does the job for the time being and avoid crashing Python scripts!

Though, I'd like to understand where the problem was! Either the dialog box not passing arguments (filenames) properly because of white spaces or anything else...

0 Kudos