Execute ogr2ogr from python

المشرف العام

Administrator
طاقم الإدارة
I tried to execute ogr2ogr from python with this shell command:

ogr2ogr.exe --config PG_LIST_ALL_TABLES YES -f "PostgreSQL" -append PG:"host=hostnamet user=username password=password dbname=dbname" nasfile.xml

The quick and dirty solution with os.system doesn't work. There is no data in the database after run this script

import osloadfile = path\\file.xmlcommand = "C:\\Program Files\\QGIS Chugiak\\bin\\ogr2ogr.exe --config PG_LIST_ALL_TABLES YES -f \"PostgreSQL\" -append PG:\"host=hostname user=username password=password dbname=dbname\" " + loadfileos.system(command)What is right syntax to execute it with subprocess.call



أكثر...
 
أعلى