[Tutor] EXECUTING PYTHON AND SQL STAMENTS
Norman Khine
norman at khine.net
Mon Oct 4 16:32:12 CEST 2010
On Mon, Oct 4, 2010 at 4:04 PM, Susana Iraiis Delgado Rodriguez
<susana.delgado_s at utzmg.edu.mx> wrote:
> I'm developing a module to execute an external command. The module executes
> the command, but in order to make my code useful I have to enter some sql
> staments. This is my code:
> from dbf import *
> from osgeo import ogr
> import os
> import sys
> def call():
> print "Ingresa el nombre para el nuevo mapa"
> arg1 = "R1G-GEODESIA2.shp"
> print arg1
> print "Ingresa la condicion"
> arg2 = "LAYER = 'R1G-GEODESIA'"
> print arg2
> print "Ingresa el nombre del mapa original"
> arg3 = 'C:/Python26/tapalpa_05_plani_point.shp'
> print arg3
> os.system('"C:/Archivos de programa/FWTools2.4.7/setfw"')
> os.system('"C:/Archivos de programa/FWTools2.4.7/bin/ogr2ogr.exe"'+" "
> +"arg1" +" "+ "-where" +" "+ "arg2" +" " +"arg3")
> call()
> The problem is that when I run the module it throws the error:
> Unable to open datasource`arg3' with the following drivers.
maybe the path to arg3 is incorrect? did arg1 shapefile load without a problem?
> ESRI Shapefile
> MapInfo File
> UK .NTFSDTS
> TIGER
> S57
> DGN
> VRT
> REC
> Memory
> BNA
> CSV
> NAS
> GML
> GPX
> KML
> GeoJSON
> Interlis 1
> Interlis 2
> GMT
> SQLite
> ODBC
> PGeo
> OGDI
> PostgreSQL
> MySQL
> XPlane
> AVCBin
> AVCE00
> DXF
> Geoconcept
> GeoRSS
> GPSTrackMaker
> VFK
> Can you help me please?
> _______________________________________________
> Tutor maillist - Tutor at python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
>
>
--
˙uʍop ǝpısdn p,uɹnʇ pןɹoʍ ǝɥʇ ǝǝs noʎ 'ʇuǝɯɐן sǝɯıʇ ǝɥʇ puɐ 'ʇuǝʇuoɔ
ǝq s,ʇǝן ʇǝʎ
%>>> "".join( [ {'*':'@','^':'.'}.get(c,None) or
chr(97+(ord(c)-83)%26) for c in ",adym,*)&uzq^zqf" ] )
More information about the Tutor
mailing list