How can I create a shapefile using Python in ArcGIS 10?
I have lat & long.
From this I need Python code which will create a shapefile in ArcGIS Desktop 10.
For creating points:
It will return a message like this:
You can create a shapefile in Python using the Create Feature Class tool. There is an example at the bottom of the page.
To populate the shapefile with your lat & long data, you'll need to use an Insert Cursor.
Perhaps you can load your lat & long data as a list into Python, then iterate through the array populating the rows of your new shapefile with the insert cursor.
EDIT, response to comment
A python list of coordinates can be constructed like this:
Then to iterate through coordinates in the list (and print them, for example), do this:
If I'm interpreting your second question correctly, to add a layer to an mxd file, see this post on GIS.SE.
Another option would be to just use the existing arcpy geoprocessing tools, see code below.